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

"fromstring deprecated" (warnings in Jupyter notebook) #5

Closed
TScheffler opened this issue Oct 16, 2019 · 2 comments
Closed

"fromstring deprecated" (warnings in Jupyter notebook) #5

TScheffler opened this issue Oct 16, 2019 · 2 comments

Comments

@TScheffler
Copy link

I'm trying to use SoMeWeTa in a notebook and get this error over and over:

self.weights = {f: np.fromstring(base64.b85decode(w), np.float64) for f, w in zip(features, weights)} /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/someweta/tagger.py:225: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead

The model (German social media) does not even load, I can't run this minimal example:
asptagger = ASPTagger(beam_size=5, iterations=10) asptagger.load(pos_model) print("got model!")

much less actually tag something:
asptagger.tag_sentence(["Ein", "Satz", "ist", "eine", "Liste", "von", "Tokens", "."])

This used to work before (i.e. last year) so I'm not sure what changed.

@tsproisl
Copy link
Owner

Unfortunately I wasn't able to replicate the DeprecationWarning. Nevertheless, I changed np.fromstring() to np.frombuffer(). Could you update to v1.6.2 and check if everything works as expected?

@TScheffler
Copy link
Author

Thank you it works now! I managed to tag the test sentence. Many thanks for the quick fix.

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

No branches or pull requests

2 participants