Skip to content

Fix cohere custom ner #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 25, 2024
Merged

Fix cohere custom ner #235

merged 4 commits into from
Jul 25, 2024

Conversation

RedhaWassim
Copy link
Contributor

No description provided.

start_index = input_string.index('[')
end_index = input_string.rindex(']')
json_text = input_string[start_index:end_index + 1]
json_text = json_text.replace("'", '"')
return json.loads(json_text)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

J'aurais just fait moi un try catch du json.loads au cas où ça raise une exception, sauf si t'es sure que c'est catché en dehors de cette fonction dans tout les cas. et que tu ne veux pas retourné un truc précis si y'a l'exception

@DninoAdnane DninoAdnane merged commit eff5304 into master Jul 25, 2024
3 checks passed
@DninoAdnane DninoAdnane deleted the fix-cohere-custom-ner branch July 25, 2024 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants