Skip to content
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

[Question]: sentence.to_dict(tag_type='ner') no longer have the 'entities' key #3265

Closed
javinator48 opened this issue Jun 13, 2023 · 4 comments · Fixed by #3271
Closed

[Question]: sentence.to_dict(tag_type='ner') no longer have the 'entities' key #3265

javinator48 opened this issue Jun 13, 2023 · 4 comments · Fixed by #3271
Labels
question Further information is requested

Comments

@javinator48
Copy link

Question

Currently I run the example shown here in a previous issues question. However I am unable to get the correct format for the sentence.to_dict(tag_type='ner') output. Currently I am expecting there to be an entities key but my out put doesn't have the key. I was wondering if there is a flag I have to set when calling the to_dict function. Why isn't it working the same as before?
Screen Shot 2023-06-13 at 3 01 39 PM

Screen Shot 2023-06-13 at 3 04 50 PM
@javinator48 javinator48 added the question Further information is requested label Jun 13, 2023
@helpmefindaname helpmefindaname linked a pull request Jun 19, 2023 that will close this issue
@helpmefindaname
Copy link
Collaborator

Hi @javinator48 can you check if #3271 fixes your issue?

@javinator48
Copy link
Author

javinator48 commented Jun 20, 2023

Hi @helpmefindaname , can you please explain a little bit more about what I should do now? Currently I am installing the package using pip install flair. However, the version installed is the latest version 0.12.2 which was from March 30, 2023. #3271 shows that you updated your code in the sentence.to_dict function to return the entities key as well. That is what I needed. I think #3271 should solve my issue.
Can you please explain what I should do at the moment to solve the issue? Currently I checked PyPi and your code doesn't seem to be updated there. I see that you reverted some changes to the sentence.to_dict function. Do you know what was the pypi package version when you updated the sentence.to_dict function to not have the 'entities' key in the return?

@javinator48
Copy link
Author

Thanks for the help. I managed to solve my issue by using the flair0.10 pip install flair==0.10.

@helpmefindaname
Copy link
Collaborator

Hi @helpmefindaname , can you please explain a little bit more about what I should do now? Currently I am installing the package using pip install flair. However, the version installed is the latest version 0.12.2 which was from March 30, 2023. #3271 shows that you updated your code in the sentence.to_dict function to return the entities key as well. That is what I needed. I think #3271 should solve my issue. Can you please explain what I should do at the moment to solve the issue? Currently I checked PyPi and your code doesn't seem to be updated there. I see that you reverted some changes to the sentence.to_dict function. Do you know what was the pypi package version when you updated the sentence.to_dict function to not have the 'entities' key in the return?

I am asking you to pip install the branch, instead of the pypi repo. e.g. running pip install git+https://github.com/flairNLP/flair.git@3265-question-sentenceto_dicttag_type=ner-no-longer-have-the-entities-key and then try the code again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants