-
-
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
Add model_to_dict
one-liner to word2vec notebook. Fix #1269
#1776
Conversation
I've created a small patch now @gojomo |
docs/notebooks/word2vec.ipynb
Outdated
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"def model_to_dict():\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You no need this function for oneliner in notebook,
most_similars_precalc = {word : model.wv.most_similar(word) for word in model.wv.index2word}
enough here
docs/notebooks/word2vec.ipynb
Outdated
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Adding Word2Vec \"model to dict\" method to production pipeline" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add more motivation (why this can be useful, it will be good if you show concrete use-case, how you'll use most_similars_precalc
)
model_to_dict
one-liner to word2vec notebook. Fix #1269
Any changes required in the documentation? @menshikh-iv |
@kakshay21 concrete example with comparison with/without caching |
docs/notebooks/word2vec.ipynb
Outdated
"### Adding Word2Vec \"model to dict\" method to production pipeline\n", | ||
"Suppose, we still want more performance improvement in production. \n", | ||
"One good way is to cache all the similar words in a dictionary.\n", | ||
"\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No needed \n
after each sentence + you should add a link to the concrete issue in the notebook.
Is it fine? @menshikh-iv |
Thanks @kakshay21, congratz with the first contribution 🥇 |
Adding to the word2vec to production pipeline #1269