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

Flair and Pickle #3191

Open
michaelgoeggelmann opened this issue Apr 12, 2023 · 2 comments
Open

Flair and Pickle #3191

michaelgoeggelmann opened this issue Apr 12, 2023 · 2 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@michaelgoeggelmann
Copy link

michaelgoeggelmann commented Apr 12, 2023

Question

Is it just me or is it not possible anymore to load tagged Sentence objects that have been stored in pickle files? If I do so, there's an TypeError: Span.__new__() missing 1 required positional argument: 'tokens' thrown. This hasn't been an issue in older flair versions.

Any workarounds? Thank you all!

edit: pos-tagged sentences actually work, I just tried. It seems to be specifically NER that causes the problem - maybe other models I haven't tried as well.

@michaelgoeggelmann michaelgoeggelmann added the question Further information is requested label Apr 12, 2023
@helpmefindaname
Copy link
Member

Hi @michaelgoeggelmann
I am sorry for responding so late.
I am not sure if the DataObjects were ever intendet to be saveable via pickle, but in generall I would recommend you to avoid pickle whenever possible.

Depending on your usecase, you could use sentence.to_dict() to get a json-serializable dict and save that one instead.

@stale
Copy link

stale bot commented Sep 17, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Sep 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants