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

Fix the train method of TranslationMatrix #1838

Merged
merged 22 commits into from
Jan 15, 2018

Conversation

robotcator
Copy link
Contributor

make the tagged_doc parameter as optional, and fixed some docstring.

@@ -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:
Copy link
Contributor

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).

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`
Copy link
Contributor

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.

@menshikh-iv
Copy link
Contributor

Thanks @robotcator 👍

@menshikh-iv menshikh-iv merged commit 1d638cf into piskvorky:develop Jan 15, 2018
sj29-innovate pushed a commit to sj29-innovate/gensim that referenced this pull request Feb 21, 2018
* 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
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

Successfully merging this pull request may close these issues.

None yet

3 participants