-
-
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 build_vocab to poincare model #2505
Add build_vocab to poincare model #2505
Conversation
Add issue #2514 😃 |
@piskvorky Hi, please assign some reviewer |
We're busy finishing up a large "Gensim docs" project, but @mpenkov will get to your PR eventually. Thanks for your patience @koiizukag. |
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.
Thank you for your patience. Your changes look good overall, but I left you some minor comments.
gensim/models/poincare.py
Outdated
|
||
def _load_relations(self): | ||
def build_vocab(self, relations=None, update=False): |
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've made this a public method, so it needs a good docstring. Please look at other docstrings in the code for examples on how to write a good one.
add doc
…kag/gensim into add-build_vocab-to-poincare_model
gensim/models/poincare.py
Outdated
relations : list of tuples | ||
List of tuples of positive examples of the form (node_1_index, node_2_index). | ||
update : bool | ||
If true, the new nodes in `relations` will be added to model's vocab. |
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.
But relations
doesn't contain nodes. Its description above says it contains "node indexes" (btw where does the user find those?).
Also, what happens if False
(the default)?
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.
I modified the description of relations using init description.
But relations doesn't contain nodes. Its description above says it contains "node indexes" (btw where does the user find those?).
If update=False
, the embeddings are initialized by random values.
(It means that the trained embeddings are cleaned.)
Also, what happens if False (the default)?
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.
OK, I don't really understand that, but that information should appear in the documentation.
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.
I added update=False description in build_vocab 👍
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.
Very good. I'm going to suggest some very minor corrections for clarity. Please have a look and apply them if they make sense.
Co-Authored-By: Michael Penkov <m@penkov.dev>
Co-Authored-By: Michael Penkov <m@penkov.dev>
Co-Authored-By: Michael Penkov <m@penkov.dev>
Co-Authored-By: Michael Penkov <m@penkov.dev>
Co-Authored-By: Michael Penkov <m@penkov.dev>
Co-Authored-By: Michael Penkov <m@penkov.dev>
Co-Authored-By: Michael Penkov <m@penkov.dev>
Thanks for your modification. LGTM |
minor update
@mpenkov Is there anything to be done next❓ |
@piskvorky I think this PR is ready to merge. Please check here 🙏 |
@mpenkov will be with you shortly, we have a lot going on. Thanks for your patience. |
Merged. @koiizukag Congratulations on your first contribution to gensim 🥇 Thank you! |
This PR makes the following changes: to fix #2514