Skip to content

Add docstrings for Wordrank #1378

Merged
menshikh-iv merged 6 commits into
piskvorky:developfrom
parulsethi:wordrank_docs
Jun 6, 2017
Merged

Add docstrings for Wordrank #1378
menshikh-iv merged 6 commits into
piskvorky:developfrom
parulsethi:wordrank_docs

Conversation

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

tmylk commented Jun 1, 2017

Just the style failures W291 trailing whitespace

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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