-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Update on-disk word vector binary format for faster load #788
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…s part of more general refactoring
…e all sense2vec code that doesn't make sense for a generalized vectors implementation
…o char pointers before copying
…ails due to representation precision limits
NB 4 of 6 tests actually succeeded. The sdist builds are misconfigured. |
Need to cleanup the commit history first. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
To use the new loading code a new binary file will need to be generated:
import spacy
import spacy.txtvec2bin as v2b
v2b.vec2bin("glove.840B.300d.txt", "vec.bin", 1000000)
Description
Create simplified version of vectors.pyx from sense2vec
Store all word vectors in memory normalized
Automatically update the norm when updating the vector
Update all references to lexeme vector to use the new vectors structure living in Vocab
Create a more efficient binary format for word vectors
the version on disk and, if desired, maintain loaders for multiple versions
the document save code currently does not use the new vector code path, but we can easily add that
if so desired
Although rather invasive, the change is quite straightforward.
Ran pytest under 2.7 and 3.6m. Ran nn_text_class.py under 3.6m.
Types of changes
Checklist: