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 documentation for gensim.models.wrappers #1859

Merged
merged 16 commits into from
Feb 16, 2018

Conversation

kakshay21
Copy link
Contributor

@kakshay21 kakshay21 commented Jan 25, 2018

[WIP]

  • Add docstring.

  • Description starts with captal letter.

  • Add installation guide for all wrappers.

  • Improve example with all initialization.

@menshikh-iv menshikh-iv changed the title Add numpy style docstring Fix documentation for gensim.models.wrappers Jan 26, 2018
Copy link
Contributor

@menshikh-iv menshikh-iv left a comment

Choose a reason for hiding this comment

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

Nice start @kakshay21, please continue 👍

@@ -6,16 +6,17 @@
# Based on Copyright (C) 2014 Radim Rehurek <radimrehurek@seznam.cz>


"""
Python wrapper for Dynamic Topic Models (DTM) and the Document Influence Model (DIM) [1].
"""Python wrapper for Dynamic Topic Models (DTM) and the Document Influence Model (DIM) [1].

Copy link
Contributor

Choose a reason for hiding this comment

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

It will be really great if you add short instruction "How to install 'backend' for it" for each wrapper.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure!, I forgot about it.

----------
dtm_path : str
path to the dtm executable, e.g. `C:/dtm/dtm-win64.exe`.
corpus : sparse vector
Copy link
Contributor

Choose a reason for hiding this comment

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

typical corpus type is iterable of iterable of (int, int)

Parameters
----------
dtm_path : str
path to the dtm executable, e.g. `C:/dtm/dtm-win64.exe`.
Copy link
Contributor

Choose a reason for hiding this comment

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

All descriptions must begin with a capital letter.

Example:

Examples
--------
>>> model = gensim.models.wrappers.DtmModel('dtm-win64.exe', my_corpus, my_timeslices,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add imports to examples (this impossible to make it really executable, but this can be very near to executable variant (i.e. all needed imports, define all variables, etc), here and everywhere.

@kakshay21
Copy link
Contributor Author

@menshikh-iv I've added reference to installation guide (link to repo) in
References
-----------
tag. Please check

@menshikh-iv
Copy link
Contributor

I fix & cleanup ldamallet & dtmmodel, main remarks:

  • missed methods (and missed arguments for existent docstrings)
  • lack of description for methods that generate path to temporary file
  • lack of links to concrete classes / methods (this needed for fast navigation in documentation), I mean something like
:class:`~gensim.models.wrappers.ldamallet.LdaMallet`
  • problem with block-formatting (for installation examples)

So, please make same cleanup for other files + add description, what's stored in file for functions like (for other + for ldamallet & dtm)

    def fcorpusmallet(self):
        """Get path to temporary file.

        Returns
        -------
        str
            Path to file.

        """

@menshikh-iv menshikh-iv merged commit 0659c10 into piskvorky:develop Feb 16, 2018
@kakshay21 kakshay21 deleted the akshay-wrapper-doc-string branch February 16, 2018 13:46
sj29-innovate pushed a commit to sj29-innovate/gensim that referenced this pull request Feb 21, 2018
* Add numpy style docstring

* First letter caps in description

* Add instalation guide and example

* Fix build failures

* fix PEP8

* fix dtmmodel

* fix dtmmodel[2]

* fix dtmmodel[3]

* fix ldamallet + typo in dtm

* Fix format of installation and docstring mistakes

* fix missing docstring in dtm & fix build (wordrank)

* fix vw[1]

* fix vw[2]

* fix varembed

* fix wordrank[1] & massive warnings about wrapper

* fix wordrank[2]
Parameters
----------
dtm_path : str
Path to the dtm executable, e.g. `C:/dtm/dtm-win64.exe`.
Path to the dtm binary, e.g. `/home/username/dtm/dtm/main`.
Copy link
Owner

Choose a reason for hiding this comment

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

-1: the Windows example was better. Windows users are generally more clueless; Linux ppl can easily do the mental bridge between Windows .exe => Linux binary, but Windows users can't.

Or just simply use both examples.

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.

3 participants