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

Add docstrings for Wordrank #1378

Merged
merged 6 commits into from
Jun 6, 2017
Merged

Conversation

parulsethi
Copy link
Contributor

@parulsethi parulsethi commented Jun 1, 2017

  1. Added description for wordrank training
  2. Corrected output_dir param (previous one would give error at .load_wordrank_model() which loads files from output_dir)
  3. fixed example doc in wordrank file (fix "TypeError: __init__() takes exactly 1 argument (4 given)" error when calling Wordrank  #1384)

@tmylk
Copy link
Contributor

tmylk commented Jun 1, 2017

Just the style failures W291 trailing whitespace

@@ -47,8 +47,12 @@ class Wordrank(KeyedVectors):
@classmethod
def train(cls, wr_path, corpus_file, out_name, size=100, window=15, symmetric=1, min_count=5, max_vocab_size=0,
sgd_num=100, lrate=0.001, period=10, iter=90, epsilon=0.75, dump_period=10, reg=0, alpha=100,
beta=99, loss='hinge', memory=4.0, cleanup_files=True, sorted_vocab=1, ensemble=0):
beta=99, loss='hinge', memory=4.0, cleanup_files=False, sorted_vocab=1, ensemble=0):
Copy link
Contributor

@menshikh-iv menshikh-iv Jun 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason for change cleanup_file to False?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cleanup_files=False will not delete the (word/context) embedding files and vocab file generated by wordrank during training, which are saved inside wordrank's directory . Though the train() method loads the final required embedding file before deleting everything that was generated during training but it could be confusing to users who expect to find it after the training is finished.
So, making the default behavior to not delete them could be better to avoid confusion.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please enumerate output files (filename and what the file contains) in docstring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the output filenames and content info. in out_name param description because it is the directory which contain these files.

@menshikh-iv
Copy link
Contributor

Thank you @parulsethi 👍

@menshikh-iv menshikh-iv merged commit 0e6f1b2 into piskvorky:develop Jun 6, 2017
@parulsethi parulsethi deleted the wordrank_docs branch June 12, 2017 14:51
@parulsethi parulsethi mentioned this pull request Jun 12, 2017
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.

"TypeError: __init__() takes exactly 1 argument (4 given)" error when calling Wordrank
3 participants