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

Serialization #62

Open
stevemarin opened this issue Jun 9, 2021 · 3 comments
Open

Serialization #62

stevemarin opened this issue Jun 9, 2021 · 3 comments

Comments

@stevemarin
Copy link

Have you thought about adding serialization/saving to disk? At the very least, would you point out what to store for, say, the ngram vectorizer?

Thank you very much for the examples on training word/document vectors using this and comparing to USE! Giving it a try now on my data and it looks pretty good! Thank you!

@stevemarin
Copy link
Author

Does this portion capture what's needed for the ngram vectorizer?

https://github.com/TutteInstitute/vectorizers/blob/master/vectorizers/ngram_vectorizer.py#L269-L276

@stevemarin
Copy link
Author

Sorry for all the comments! Pickling the ngram vectorizer seems to work as long as all the numba attributes in the class are converted back to regular Python objects. Does this agree with your understanding?

@lmcinnes
Copy link
Contributor

Yes -- to properly handle things we really need to set up the __getstate__ and __setstate__ methods to properly convert the numba based attributes back and forth. Usually this isn't too hard, but it is something that we haven't gotten to yet. With that done pickling should just work. I'll add an issue for that so that we hopefully don't forget it.

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