-
-
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
Fix the train method of TranslationMatrix #1838
Conversation
…into fix-word2vec-notebook Conflicts: gensim/test/test_word2vec.py
@@ -393,6 +393,9 @@ def __init__(self, tagged_docs, source_lang_vec, target_lang_vec, random_state=N | |||
self.random_state = utils.get_random_state(random_state) | |||
self.translation_matrix = None | |||
|
|||
if tagged_docs is not None: |
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.
Problem isn't fixed in train
method (you continue to ignore passed parameter).
gensim/models/translation_matrix.py
Outdated
def train(self, tagged_docs): | ||
"""Build the translation matrix that mapping from the source model's vector to target model's vector | ||
|
||
Parameters | ||
---------- | ||
tagged_docs : list of :class:`~gensim.models.doc2vec.TaggedDocument`, optional | ||
THIS ARGUMENT WILL BE IGNORED. | ||
tagged_docs : list of :class:`~gensim.models.doc2vec.TaggedDocument` |
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.
Need to add a description for this parameter, what is it.
Thanks @robotcator 👍 |
* fix the compatibility between python2 & 3 * require explicit corpus size, epochs for train() * make all train() calls use explicit count, epochs * add tests to make sure that ValueError is indeed thrown * update test * fix the word2vec's reset_from() * require explicit corpus size, epochs for train() * make all train() calls use explicit count, epochs * fix some error * fix test error * make tagged_docs optional * fix the train method * add comments for the translation matrix
make the tagged_doc parameter as optional, and fixed some docstring.