# Buggy code
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=False,
    sorted_vocab=1,
    ensemble=0,
):
    """
    The word and context embedding files are generated by wordrank binary and are saved in "out_name" directory
    which is created inside wordrank directory. The vocab and cooccurence files are generated using glove code
    available inside the wordrank directory. These files are used by the wordrank binary for training.

    `wr_path` is the path to the Wordrank directory.
    `corpus_file` is the filename of the text file to be used for training the Wordrank model.
    Expects file to contain space-separated tokens in a single line
    `out_name` is name of the directory which will be created (in wordrank folder) to save embeddings and training data.
    It will contain following contents:
        Word Embeddings saved after every dump_period and stored in a file model_word_"current iter".txt
        Context Embeddings saved after every dump_period and stored in a file model_context_"current iter".txt
        A meta directory which contain: 'vocab.txt' - vocab words, 'wiki.toy' - word-word coccurence values, 'meta' - vocab and coccurence lengths
    `size` is the dimensionality of the feature vectors.
    `window` is the number of context words to the left (and to the right, if symmetric = 1).
    `symmetric` if 0, only use left context words, else use left and right both.
    `min_count` = ignore all words with total frequency lower than this.
    `max_vocab_size` upper bound on vocabulary size, i.e. keep the <int> most frequent words. Default is 0 for no limit.
    `sgd_num` number of SGD taken for each data point.
    `lrate` is the learning rate (too high diverges, give Nan).
    `period` is the period of xi variable updates
    `iter` = number of iterations (epochs) over the corpus.
    `epsilon` is the power scaling value for weighting function.
    `dump_period` is the period after which embeddings should be dumped.
    `reg` is the value of regularization parameter.
    `alpha` is the alpha parameter of gamma distribution.
    `beta` is the beta parameter of gamma distribution.
    `loss` = name of the loss (logistic, hinge).
    `memory` = soft limit for memory consumption, in GB.
    `cleanup_files` if True, delete directory and files used by this wrapper, setting to False can be useful for debugging
    `sorted_vocab` = if 1 (default), sort the vocabulary by descending frequency before assigning word indexes.
    `ensemble` = 0 (default), use ensemble of word and context vectors
    """

    meta_data_path = "matrix.meta"
    vocab_file = "vocab.txt"
    temp_vocab_file = "tempvocab.txt"
    cooccurrence_file = "cooccurrence"
    cooccurrence_shuf_file = "wiki.toy"
    meta_file = "meta"

    # prepare training data (cooccurrence matrix and vocab)
    model_dir = os.path.join(wr_path, out_name)
    meta_dir = os.path.join(model_dir, "meta")
    os.makedirs(meta_dir)
    logger.info("Dumped data will be stored in '%s'", model_dir)
    copyfile(corpus_file, os.path.join(meta_dir, corpus_file.split("/")[-1]))
    os.chdir(meta_dir)

    cmd_vocab_count = [
        "../../glove/vocab_count",
        "-min-count",
        str(min_count),
        "-max-vocab",
        str(max_vocab_size),
    ]
    cmd_cooccurence_count = [
        "../../glove/cooccur",
        "-memory",
        str(memory),
        "-vocab-file",
        temp_vocab_file,
        "-window-size",
        str(window),
        "-symmetric",
        str(symmetric),
    ]
    cmd_shuffle_cooccurences = ["../../glove/shuffle", "-memory", str(memory)]
    cmd_del_vocab_freq = ["cut", "-d", " ", "-f", "1", temp_vocab_file]

    commands = [cmd_vocab_count, cmd_cooccurence_count, cmd_shuffle_cooccurences]
    input_fnames = [
        corpus_file.split("/")[-1],
        corpus_file.split("/")[-1],
        cooccurrence_file,
    ]
    output_fnames = [temp_vocab_file, cooccurrence_file, cooccurrence_shuf_file]

    logger.info("Prepare training data (%s) using glove code", ", ".join(input_fnames))
    for command, input_fname, output_fname in zip(
        commands, input_fnames, output_fnames
    ):
        with smart_open(input_fname, "rb") as r:
            with smart_open(output_fname, "wb") as w:
                utils.check_output(w, args=command, stdin=r)

    logger.info("Deleting frequencies from vocab file")
    with smart_open(vocab_file, "wb") as w:
        utils.check_output(w, args=cmd_del_vocab_freq)

    with smart_open(vocab_file, "rb") as f:
        numwords = sum(1 for line in f)
    with smart_open(cooccurrence_shuf_file, "rb") as f:
        numlines = sum(1 for line in f)
    with smart_open(meta_file, "wb") as f:
        meta_info = "{0} {1}\n{2} {3}\n{4} {5}".format(
            numwords, numwords, numlines, cooccurrence_shuf_file, numwords, vocab_file
        )
        f.write(meta_info.encode("utf-8"))

    if iter % dump_period == 0:
        iter += 1
    else:
        logger.warning(
            "Resultant embedding will be from %d iterations rather than the input %d iterations, "
            "as wordrank dumps the embedding only at dump_period intervals. "
            "Input an appropriate combination of parameters (iter, dump_period) such that "
            '"iter mod dump_period" is zero.',
            iter - (iter % dump_period),
            iter,
        )

    wr_args = {
        "path": "meta",
        "nthread": multiprocessing.cpu_count(),
        "sgd_num": sgd_num,
        "lrate": lrate,
        "period": period,
        "iter": iter,
        "epsilon": epsilon,
        "dump_prefix": "model",
        "dump_period": dump_period,
        "dim": size,
        "reg": reg,
        "alpha": alpha,
        "beta": beta,
        "loss": loss,
    }

    os.chdir("..")
    # run wordrank executable with wr_args
    cmd = ["mpirun", "-np", "1", "../wordrank"]
    for option, value in wr_args.items():
        cmd.append("--%s" % option)
        cmd.append(str(value))
    logger.info("Running wordrank binary")
    output = utils.check_output(args=cmd)

    # use embeddings from max. iteration's dump
    max_iter_dump = iter - (iter % dump_period)
    copyfile("model_word_%d.txt" % max_iter_dump, "wordrank.words")
    copyfile("model_context_%d.txt" % max_iter_dump, "wordrank.contexts")
    model = cls.load_wordrank_model(
        "wordrank.words",
        os.path.join("meta", vocab_file),
        "wordrank.contexts",
        sorted_vocab,
        ensemble,
    )
    os.chdir("../..")

    if cleanup_files:
        rmtree(model_dir)
    return model


# Traceback (ImportError)
rm -rf _build/*
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.5.3
making output directory...
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 82 source files that are out of date
updating environment: 82 added, 0 changed, 0 removed
reading sources... [  1%] about
reading sources... [  2%] apiref
reading sources... [  3%] changes_080
reading sources... [  4%] corpora/bleicorpus
reading sources... [  6%] corpora/corpora
reading sources... [  7%] corpora/csvcorpus
reading sources... [  8%] corpora/dictionary
reading sources... [  9%] corpora/hashdictionary
reading sources... [ 10%] corpora/indexedcorpus
reading sources... [ 12%] corpora/lowcorpus
reading sources... [ 13%] corpora/malletcorpus
reading sources... [ 14%] corpora/mmcorpus
reading sources... [ 15%] corpora/sharded_corpus
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/signal/_max_len_seq.py:8: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._max_len_seq_inner import _max_len_seq_inner
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/signal/_max_len_seq.py:8: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192, got 176
  from ._max_len_seq_inner import _max_len_seq_inner
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/signal/_upfirdn.py:36: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._upfirdn_apply import _output_len, _apply
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/signal/_upfirdn.py:36: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192, got 176
  from ._upfirdn_apply import _output_len, _apply
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/spatial/__init__.py:93: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from .ckdtree import *
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/spatial/__init__.py:93: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192, got 176
  from .ckdtree import *
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/spatial/__init__.py:94: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from .qhull import *
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/spatial/__init__.py:94: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192, got 176
  from .qhull import *
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/ndimage/measurements.py:36: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from . import _ni_label
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/ndimage/measurements.py:36: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192, got 176
  from . import _ni_label
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/signal/spectral.py:10: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._spectral import lombscargle
/home/lev/miniconda2/lib/python2.7/site-packages/scipy/signal/spectral.py:10: RuntimeWarning: numpy.ufunc size changed, may indicate binary incompatibility. Expected 192, got 176
  from ._spectral import lombscargle
reading sources... [ 17%] corpora/svmlightcorpus
reading sources... [ 18%] corpora/textcorpus
reading sources... [ 19%] corpora/ucicorpus
reading sources... [ 20%] corpora/wikicorpus
reading sources... [ 21%] dist_lda
reading sources... [ 23%] dist_lsi
reading sources... [ 24%] distributed
reading sources... [ 25%] indextoc
reading sources... [ 26%] install
reading sources... [ 28%] interfaces
reading sources... [ 29%] intro
reading sources... [ 30%] matutils
reading sources... [ 31%] models/atmodel
reading sources... [ 32%] models/coherencemodel
reading sources... [ 34%] models/doc2vec
reading sources... [ 35%] models/hdpmodel
reading sources... [ 36%] models/keyedvectors
reading sources... [ 37%] models/lda_dispatcher
reading sources... [ 39%] models/lda_worker
reading sources... [ 40%] models/ldamodel
reading sources... [ 41%] models/ldamulticore
reading sources... [ 42%] models/ldaseqmodel
reading sources... [ 43%] models/logentropy_model
reading sources... [ 45%] models/lsi_dispatcher
reading sources... [ 46%] models/lsi_worker
reading sources... [ 47%] models/lsimodel
reading sources... [ 48%] models/models
reading sources... [ 50%] models/normmodel
reading sources... [ 51%] models/phrases
reading sources... [ 52%] models/rpmodel
reading sources... [ 53%] models/tfidfmodel
reading sources... [ 54%] models/word2vec
reading sources... [ 56%] models/wrappers/dtmmodel
reading sources... [ 57%] models/wrappers/fasttext
reading sources... [ 58%] models/wrappers/ldamallet
reading sources... [ 59%] models/wrappers/ldavowpalwabbit
reading sources... [ 60%] models/wrappers/varembed
reading sources... [ 62%] models/wrappers/wordrank
reading sources... [ 63%] models/wrappers/wrappers
reading sources... [ 64%] parsing/porter
reading sources... [ 65%] parsing/preprocessing
reading sources... [ 67%] scripts/glove2word2vec
reading sources... [ 68%] scripts/make_wikicorpus
reading sources... [ 69%] scripts/word2vec_standalone
reading sources... [ 70%] similarities/docsim
reading sources... [ 71%] similarities/index
reading sources... [ 73%] similarities/simserver
reading sources... [ 74%] simserver
reading sources... [ 75%] sklearn_integration/sklearn_wrapper_gensim_ldamodel
reading sources... [ 76%] summarization/bm25
reading sources... [ 78%] summarization/commons
reading sources... [ 79%] summarization/graph
reading sources... [ 80%] summarization/keywords
reading sources... [ 81%] summarization/pagerank_weighted
reading sources... [ 82%] summarization/summariser
reading sources... [ 84%] summarization/syntactic_unit
reading sources... [ 85%] summarization/textcleaner
reading sources... [ 86%] support
reading sources... [ 87%] topic_coherence/aggregation
reading sources... [ 89%] topic_coherence/direct_confirmation_measure
reading sources... [ 90%] topic_coherence/indirect_confirmation_measure
reading sources... [ 91%] topic_coherence/probability_estimation
reading sources... [ 92%] topic_coherence/segmentation
reading sources... [ 93%] tut1
reading sources... [ 95%] tut2
reading sources... [ 96%] tut3
reading sources... [ 97%] tutorial
reading sources... [ 98%] utils
reading sources... [100%] wiki

/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/corpora/malletcorpus.rst:2: WARNING: Title underline too short.

:mod:`corpora.malletcorpus` -- Corpus in Mallet format of List-Of-Words.
==========================================================
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/corpora/sharded_corpus.rst:2: WARNING: Title underline too short.

:mod:`corpora.sharded_corpus` -- Corpus stored in separate files
==========================================================
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/install.rst:118: WARNING: nonlocal image URI found: https://api.travis-ci.org/piskvorky/gensim.png?branch=develop
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/install.rst:118: WARNING: nonlocal image URI found: https://api.travis-ci.org/piskvorky/gensim.png?branch=develop
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/coherencemodel.py:docstring of gensim.models.coherencemodel:10: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/coherencemodel.py:docstring of gensim.models.coherencemodel:11: WARNING: Explicit markup ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/coherencemodel.py:docstring of gensim.models.coherencemodel.CoherenceModel:25: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/coherencemodel.py:docstring of gensim.models.coherencemodel.CoherenceModel:25: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/coherencemodel.py:docstring of gensim.models.coherencemodel.CoherenceModel:39: WARNING: Definition list ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/coherencemodel.py:docstring of gensim.models.coherencemodel.CoherenceModel:41: ERROR: Unexpected indentation.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/coherencemodel.py:docstring of gensim.models.coherencemodel.CoherenceModel:42: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/coherencemodel.py:docstring of gensim.models.coherencemodel.CoherenceModel:55: WARNING: Definition list ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/keyedvectors.py:docstring of gensim.models.keyedvectors.KeyedVectors.evaluate_word_pairs:1: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/keyedvectors.py:docstring of gensim.models.keyedvectors.KeyedVectors.evaluate_word_pairs:20: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/models/ldaseqmodel.rst:2: WARNING: Title underline too short.

:mod:`models.ldaseqmodel` -- Dynamic Topic Modeling in Python
================================
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/ldaseqmodel.py:docstring of gensim.models.ldaseqmodel.LdaSeqModel.fit_lda_seq:6: ERROR: Unexpected indentation.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/ldaseqmodel.py:docstring of gensim.models.ldaseqmodel.sslm.compute_post_variance:5: WARNING: Inline substitution_reference start-string without end-string.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/ldaseqmodel.py:docstring of gensim.models.ldaseqmodel.sslm.compute_post_variance:8: WARNING: Inline substitution_reference start-string without end-string.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/word2vec.py:docstring of gensim.models.word2vec:31: WARNING: Literal block expected; none found.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/word2vec.py:docstring of gensim.models.word2vec.Word2Vec.score:13: WARNING: duplicate citation taddy, other instance in /home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/models/doc2vec.rst
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/word2vec.py:docstring of gensim.models.word2vec.Word2Vec.score:14: WARNING: duplicate citation deepir, other instance in /home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/models/doc2vec.rst
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/dtmmodel.py:docstring of gensim.models.wrappers.dtmmodel.DtmModel.dtm_coherence:4: ERROR: Unexpected indentation.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/fasttext.py:docstring of gensim.models.wrappers.fasttext.FastTextKeyedVectors.evaluate_word_pairs:1: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/fasttext.py:docstring of gensim.models.wrappers.fasttext.FastTextKeyedVectors.evaluate_word_pairs:20: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/fasttext.py:docstring of gensim.models.wrappers.fasttext.FastText.score:13: WARNING: duplicate citation taddy, other instance in /home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/models/word2vec.rst
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/fasttext.py:docstring of gensim.models.wrappers.fasttext.FastText.score:14: WARNING: duplicate citation deepir, other instance in /home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/models/word2vec.rst
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/ldamallet.py:docstring of gensim.models.wrappers.ldamallet.malletmodel2ldamodel:6: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/ldamallet.py:docstring of gensim.models.wrappers.ldamallet.malletmodel2ldamodel:6: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/ldamallet.py:docstring of gensim.models.wrappers.ldamallet.malletmodel2ldamodel:12: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/ldamallet.py:docstring of gensim.models.wrappers.ldamallet.malletmodel2ldamodel:12: SEVERE: Unexpected section title.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/ldavowpalwabbit.py:docstring of gensim.models.wrappers.ldavowpalwabbit.vwmodel2ldamodel:6: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/ldavowpalwabbit.py:docstring of gensim.models.wrappers.ldavowpalwabbit.vwmodel2ldamodel:6: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/ldavowpalwabbit.py:docstring of gensim.models.wrappers.ldavowpalwabbit.vwmodel2ldamodel:11: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/ldavowpalwabbit.py:docstring of gensim.models.wrappers.ldavowpalwabbit.vwmodel2ldamodel:11: SEVERE: Unexpected section title.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/varembed.py:docstring of gensim.models.wrappers.varembed.VarEmbed.evaluate_word_pairs:1: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/varembed.py:docstring of gensim.models.wrappers.varembed.VarEmbed.evaluate_word_pairs:20: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/wordrank.py:docstring of gensim.models.wrappers.wordrank.Wordrank.evaluate_word_pairs:1: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/models/wrappers/wordrank.py:docstring of gensim.models.wrappers.wordrank.Wordrank.evaluate_word_pairs:20: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/parsing/preprocessing.rst:2: WARNING: Title underline too short.

:mod:`parsing.preprocessing` -- Functions to preprocess raw text
=========================================================
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/scripts/glove2word2vec.rst:2: WARNING: Title underline too short.

:mod:`scripts.glove2word2vec` -- Convert glove format to word2vec
=========================================================
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/scripts/glove2word2vec.py:docstring of gensim.scripts.glove2word2vec:3: ERROR: Unexpected indentation.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/scripts/glove2word2vec.py:docstring of gensim.scripts.glove2word2vec.glove2word2vec:1: WARNING: Inline interpreted text or phrase reference start-string without end-string.
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/scripts/make_wikicorpus.rst:2: WARNING: Title underline too short.

:mod:`scripts.make_wikicorpus` -- Convert articles from a Wikipedia dump to vectors.
=========================================================
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/scripts/word2vec_standalone.rst:2: WARNING: Title underline too short.

:mod:`scripts.word2vec_standalone` -- Train word2vec on text file CORPUS
=========================================================
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/similarities/docsim.py:docstring of gensim.similarities.docsim.WmdSimilarity:28: ERROR: Unexpected indentation.
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/similarities/index.rst:2: WARNING: Title underline too short.

:mod:`similarities.index` -- Fast Approximate Nearest Neighbor Similarity with Annoy package
========================================================================
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/similarities/simserver.rst:4: WARNING: autodoc: failed to import module u'simserver.simserver'; the following exception was raised:
Traceback (most recent call last):
  File "/home/lev/miniconda2/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 551, in import_object
    __import__(self.modname)
ImportError: No module named simserver.simserver
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/sklearn_integration/sklearn_wrapper_gensim_ldamodel.rst:2: WARNING: Title underline too short.

:mod:`sklearn_integration.sklearn_wrapper_gensim_ldamodel.SklearnWrapperLdaModel` -- Scikit learn wrapper for Latent Dirichlet Allocation
======================================================
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/sklearn_integration/sklearn_wrapper_gensim_ldamodel.rst:4: WARNING: autodoc: failed to import module u'gensim.sklearn_integration.sklearn_wrapper_gensim_ldamodel.SklearnWrapperLdaModel'; the following exception was raised:
Traceback (most recent call last):
  File "/home/lev/miniconda2/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 551, in import_object
    __import__(self.modname)
ImportError: No module named SklearnWrapperLdaModel
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/summarization/keywords.rst:2: WARNING: Title underline too short.

:mod:`summarization.keywords` -- Keywords for TextRank summarization algorithm
=========================================================
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/summarization/pagerank_weighted.rst:2: WARNING: Title underline too short.

:mod:`summarization.pagerank_weighted` -- Weighted PageRank algorithm
=========================================================
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/summarization/summarizer.py:docstring of gensim.summarization.summarizer.summarize:13: ERROR: Unexpected indentation.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/summarization/summarizer.py:docstring of gensim.summarization.summarizer.summarize:14: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/summarization/summarizer.py:docstring of gensim.summarization.summarizer.summarize:16: ERROR: Unexpected indentation.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/summarization/summarizer.py:docstring of gensim.summarization.summarizer.summarize:17: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/summarization/syntactic_unit.rst:2: WARNING: Title underline too short.

:mod:`summarization.syntactic_unit` -- Syntactic Unit class
=========================================================
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/summarization/textcleaner.rst:2: WARNING: Title underline too short.

:mod:`summarization.textcleaner` -- Summarization pre-processing
=========================================================
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/summarization/textcleaner.rst:10: WARNING: Explicit markup ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/aggregation.py:docstring of gensim.topic_coherence.aggregation.arithmetic_mean:5: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/aggregation.py:docstring of gensim.topic_coherence.aggregation.arithmetic_mean:5: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/aggregation.py:docstring of gensim.topic_coherence.aggregation.arithmetic_mean:9: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/aggregation.py:docstring of gensim.topic_coherence.aggregation.arithmetic_mean:9: SEVERE: Unexpected section title.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/direct_confirmation_measure.py:docstring of gensim.topic_coherence.direct_confirmation_measure.log_conditional_probability:6: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/direct_confirmation_measure.py:docstring of gensim.topic_coherence.direct_confirmation_measure.log_conditional_probability:6: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/direct_confirmation_measure.py:docstring of gensim.topic_coherence.direct_confirmation_measure.log_conditional_probability:12: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/direct_confirmation_measure.py:docstring of gensim.topic_coherence.direct_confirmation_measure.log_conditional_probability:12: SEVERE: Unexpected section title.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/direct_confirmation_measure.py:docstring of gensim.topic_coherence.direct_confirmation_measure.log_ratio_measure:13: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/direct_confirmation_measure.py:docstring of gensim.topic_coherence.direct_confirmation_measure.log_ratio_measure:13: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/direct_confirmation_measure.py:docstring of gensim.topic_coherence.direct_confirmation_measure.log_ratio_measure:19: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/direct_confirmation_measure.py:docstring of gensim.topic_coherence.direct_confirmation_measure.log_ratio_measure:19: SEVERE: Unexpected section title.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/indirect_confirmation_measure.py:docstring of gensim.topic_coherence.indirect_confirmation_measure.cosine_similarity:4: ERROR: Unexpected indentation.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/indirect_confirmation_measure.py:docstring of gensim.topic_coherence.indirect_confirmation_measure.cosine_similarity:5: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/indirect_confirmation_measure.py:docstring of gensim.topic_coherence.indirect_confirmation_measure.cosine_similarity:8: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/indirect_confirmation_measure.py:docstring of gensim.topic_coherence.indirect_confirmation_measure.cosine_similarity:12: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/indirect_confirmation_measure.py:docstring of gensim.topic_coherence.indirect_confirmation_measure.cosine_similarity:15: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/indirect_confirmation_measure.py:docstring of gensim.topic_coherence.indirect_confirmation_measure.cosine_similarity:15: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/indirect_confirmation_measure.py:docstring of gensim.topic_coherence.indirect_confirmation_measure.cosine_similarity:24: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/indirect_confirmation_measure.py:docstring of gensim.topic_coherence.indirect_confirmation_measure.cosine_similarity:24: SEVERE: Unexpected section title.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/probability_estimation.py:docstring of gensim.topic_coherence.probability_estimation.p_boolean_document:5: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/probability_estimation.py:docstring of gensim.topic_coherence.probability_estimation.p_boolean_document:5: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/probability_estimation.py:docstring of gensim.topic_coherence.probability_estimation.p_boolean_document:10: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/probability_estimation.py:docstring of gensim.topic_coherence.probability_estimation.p_boolean_document:10: SEVERE: Unexpected section title.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/probability_estimation.py:docstring of gensim.topic_coherence.probability_estimation.p_boolean_sliding_window:7: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/probability_estimation.py:docstring of gensim.topic_coherence.probability_estimation.p_boolean_sliding_window:7: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/probability_estimation.py:docstring of gensim.topic_coherence.probability_estimation.p_boolean_sliding_window:14: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/probability_estimation.py:docstring of gensim.topic_coherence.probability_estimation.p_boolean_sliding_window:14: SEVERE: Unexpected section title.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_one:3: ERROR: Unexpected indentation.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_one:4: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_one:11: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_one:11: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_one:15: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_one:15: SEVERE: Unexpected section title.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_pre:3: ERROR: Unexpected indentation.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_pre:4: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_pre:11: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_pre:11: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_pre:15: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_pre:15: SEVERE: Unexpected section title.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_set:3: ERROR: Unexpected indentation.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_set:4: WARNING: Block quote ends without a blank line; unexpected unindent.
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_set:12: WARNING: Title underline too short.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_set:12: SEVERE: Unexpected section title.

Args:
----
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_set:16: WARNING: Title underline too short.

Returns:
-------
/home/lev/miniconda2/lib/python2.7/site-packages/gensim-1.0.1-py2.7-linux-x86_64.egg/gensim/topic_coherence/segmentation.py:docstring of gensim.topic_coherence.segmentation.s_one_set:16: SEVERE: Unexpected section title.

Returns:
-------
looking for now-outdated files... none found
pickling environment... done
checking consistency... /home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/about.rst:: WARNING: document isn't included in any toctree
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/changes_080.rst:: WARNING: document isn't included in any toctree
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/corpora/corpora.rst:: WARNING: document isn't included in any toctree
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/models/models.rst:: WARNING: document isn't included in any toctree
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/models/wrappers/wrappers.rst:: WARNING: document isn't included in any toctree
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/similarities/simserver.rst:: WARNING: document isn't included in any toctree
/home/lev/Dropbox/raretech/os/release/fix/gensim/docs/src/simserver.rst:: WARNING: document isn't included in any toctree
done
preparing documents... done
writing output... [  1%] about
writing output... [  2%] apiref
writing output... [  3%] changes_080
writing output... [  4%] corpora/bleicorpus
writing output... [  6%] corpora/corpora
writing output... [  7%] corpora/csvcorpus
writing output... [  8%] corpora/dictionary
writing output... [  9%] corpora/hashdictionary
writing output... [ 10%] corpora/indexedcorpus
writing output... [ 12%] corpora/lowcorpus
writing output... [ 13%] corpora/malletcorpus
writing output... [ 14%] corpora/mmcorpus
writing output... [ 15%] corpora/sharded_corpus
writing output... [ 17%] corpora/svmlightcorpus
writing output... [ 18%] corpora/textcorpus
writing output... [ 19%] corpora/ucicorpus
writing output... [ 20%] corpora/wikicorpus
writing output... [ 21%] dist_lda
writing output... [ 23%] dist_lsi
writing output... [ 24%] distributed
writing output... [ 25%] indextoc
writing output... [ 26%] install
writing output... [ 28%] interfaces
writing output... [ 29%] intro
writing output... [ 30%] matutils
writing output... [ 31%] models/atmodel
writing output... [ 32%] models/coherencemodel
writing output... [ 34%] models/doc2vec
writing output... [ 35%] models/hdpmodel
writing output... [ 36%] models/keyedvectors
writing output... [ 37%] models/lda_dispatcher
writing output... [ 39%] models/lda_worker
writing output... [ 40%] models/ldamodel
writing output... [ 41%] models/ldamulticore
writing output... [ 42%] models/ldaseqmodel
writing output... [ 43%] models/logentropy_model
writing output... [ 45%] models/lsi_dispatcher
writing output... [ 46%] models/lsi_worker
writing output... [ 47%] models/lsimodel
writing output... [ 48%] models/models
writing output... [ 50%] models/normmodel
writing output... [ 51%] models/phrases
writing output... [ 52%] models/rpmodel
writing output... [ 53%] models/tfidfmodel
writing output... [ 54%] models/word2vec
writing output... [ 56%] models/wrappers/dtmmodel
writing output... [ 57%] models/wrappers/fasttext
writing output... [ 58%] models/wrappers/ldamallet
writing output... [ 59%] models/wrappers/ldavowpalwabbit
writing output... [ 60%] models/wrappers/varembed
writing output... [ 62%] models/wrappers/wordrank
writing output... [ 63%] models/wrappers/wrappers
writing output... [ 64%] parsing/porter
writing output... [ 65%] parsing/preprocessing
writing output... [ 67%] scripts/glove2word2vec
writing output... [ 68%] scripts/make_wikicorpus
writing output... [ 69%] scripts/word2vec_standalone
writing output... [ 70%] similarities/docsim
writing output... [ 71%] similarities/index
writing output... [ 73%] similarities/simserver
writing output... [ 74%] simserver
writing output... [ 75%] sklearn_integration/sklearn_wrapper_gensim_ldamodel
writing output... [ 76%] summarization/bm25
writing output... [ 78%] summarization/commons
writing output... [ 79%] summarization/graph
writing output... [ 80%] summarization/keywords
writing output... [ 81%] summarization/pagerank_weighted
writing output... [ 82%] summarization/summariser
writing output... [ 84%] summarization/syntactic_unit
writing output... [ 85%] summarization/textcleaner
writing output... [ 86%] support
writing output... [ 87%] topic_coherence/aggregation
writing output... [ 89%] topic_coherence/direct_confirmation_measure
writing output... [ 90%] topic_coherence/indirect_confirmation_measure
writing output... [ 91%] topic_coherence/probability_estimation
writing output... [ 92%] topic_coherence/segmentation
writing output... [ 93%] tut1
writing output... [ 95%] tut2
writing output... [ 96%] tut3
writing output... [ 97%] tutorial
writing output... [ 98%] utils
writing output... [100%] wiki

generating indices... genindex
writing additional pages... index search
copying static files... WARNING: favicon file 'favicon.ico' does not exist
done
copying extra files... done
dumping search index in English (code: en) ... done
dumping object inventory... done
build succeeded, 112 warnings.
rm -r _build/html/_sources
cp -r _build/html/* ../

Build finished. The HTML pages are in ../


# Fixed code
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=False,
    sorted_vocab=1,
    ensemble=0,
):
    """
    The word and context embedding files are generated by wordrank binary and are saved in "out_name" directory
    which is created inside wordrank directory. The vocab and cooccurence files are generated using glove code
    available inside the wordrank directory. These files are used by the wordrank binary for training.

    `wr_path` is the path to the Wordrank directory.
    `corpus_file` is the filename of the text file to be used for training the Wordrank model.
    Expects file to contain space-separated tokens in a single line
    `out_name` is name of the directory which will be created (in wordrank folder) to save embeddings and training data.
    It will contain following contents:

        Word Embeddings saved after every dump_period and stored in a file model_word_current\ iter.txt
        Context Embeddings saved after every dump_period and stored in a file model_context_current\ iter.txt
        A meta directory which contain: 'vocab.txt' - vocab words, 'wiki.toy' - word-word coccurence values, 'meta' - vocab and coccurence lengths

    `size` is the dimensionality of the feature vectors.
    `window` is the number of context words to the left (and to the right, if symmetric = 1).
    `symmetric` if 0, only use left context words, else use left and right both.
    `min_count` = ignore all words with total frequency lower than this.
    `max_vocab_size` upper bound on vocabulary size, i.e. keep the <int> most frequent words. Default is 0 for no limit.
    `sgd_num` number of SGD taken for each data point.
    `lrate` is the learning rate (too high diverges, give Nan).
    `period` is the period of xi variable updates
    `iter` = number of iterations (epochs) over the corpus.
    `epsilon` is the power scaling value for weighting function.
    `dump_period` is the period after which embeddings should be dumped.
    `reg` is the value of regularization parameter.
    `alpha` is the alpha parameter of gamma distribution.
    `beta` is the beta parameter of gamma distribution.
    `loss` = name of the loss (logistic, hinge).
    `memory` = soft limit for memory consumption, in GB.
    `cleanup_files` if True, delete directory and files used by this wrapper, setting to False can be useful for debugging
    `sorted_vocab` = if 1 (default), sort the vocabulary by descending frequency before assigning word indexes.
    `ensemble` = 0 (default), use ensemble of word and context vectors
    """

    meta_data_path = "matrix.meta"
    vocab_file = "vocab.txt"
    temp_vocab_file = "tempvocab.txt"
    cooccurrence_file = "cooccurrence"
    cooccurrence_shuf_file = "wiki.toy"
    meta_file = "meta"

    # prepare training data (cooccurrence matrix and vocab)
    model_dir = os.path.join(wr_path, out_name)
    meta_dir = os.path.join(model_dir, "meta")
    os.makedirs(meta_dir)
    logger.info("Dumped data will be stored in '%s'", model_dir)
    copyfile(corpus_file, os.path.join(meta_dir, corpus_file.split("/")[-1]))
    os.chdir(meta_dir)

    cmd_vocab_count = [
        "../../glove/vocab_count",
        "-min-count",
        str(min_count),
        "-max-vocab",
        str(max_vocab_size),
    ]
    cmd_cooccurence_count = [
        "../../glove/cooccur",
        "-memory",
        str(memory),
        "-vocab-file",
        temp_vocab_file,
        "-window-size",
        str(window),
        "-symmetric",
        str(symmetric),
    ]
    cmd_shuffle_cooccurences = ["../../glove/shuffle", "-memory", str(memory)]
    cmd_del_vocab_freq = ["cut", "-d", " ", "-f", "1", temp_vocab_file]

    commands = [cmd_vocab_count, cmd_cooccurence_count, cmd_shuffle_cooccurences]
    input_fnames = [
        corpus_file.split("/")[-1],
        corpus_file.split("/")[-1],
        cooccurrence_file,
    ]
    output_fnames = [temp_vocab_file, cooccurrence_file, cooccurrence_shuf_file]

    logger.info("Prepare training data (%s) using glove code", ", ".join(input_fnames))
    for command, input_fname, output_fname in zip(
        commands, input_fnames, output_fnames
    ):
        with smart_open(input_fname, "rb") as r:
            with smart_open(output_fname, "wb") as w:
                utils.check_output(w, args=command, stdin=r)

    logger.info("Deleting frequencies from vocab file")
    with smart_open(vocab_file, "wb") as w:
        utils.check_output(w, args=cmd_del_vocab_freq)

    with smart_open(vocab_file, "rb") as f:
        numwords = sum(1 for line in f)
    with smart_open(cooccurrence_shuf_file, "rb") as f:
        numlines = sum(1 for line in f)
    with smart_open(meta_file, "wb") as f:
        meta_info = "{0} {1}\n{2} {3}\n{4} {5}".format(
            numwords, numwords, numlines, cooccurrence_shuf_file, numwords, vocab_file
        )
        f.write(meta_info.encode("utf-8"))

    if iter % dump_period == 0:
        iter += 1
    else:
        logger.warning(
            "Resultant embedding will be from %d iterations rather than the input %d iterations, "
            "as wordrank dumps the embedding only at dump_period intervals. "
            "Input an appropriate combination of parameters (iter, dump_period) such that "
            '"iter mod dump_period" is zero.',
            iter - (iter % dump_period),
            iter,
        )

    wr_args = {
        "path": "meta",
        "nthread": multiprocessing.cpu_count(),
        "sgd_num": sgd_num,
        "lrate": lrate,
        "period": period,
        "iter": iter,
        "epsilon": epsilon,
        "dump_prefix": "model",
        "dump_period": dump_period,
        "dim": size,
        "reg": reg,
        "alpha": alpha,
        "beta": beta,
        "loss": loss,
    }

    os.chdir("..")
    # run wordrank executable with wr_args
    cmd = ["mpirun", "-np", "1", "../wordrank"]
    for option, value in wr_args.items():
        cmd.append("--%s" % option)
        cmd.append(str(value))
    logger.info("Running wordrank binary")
    output = utils.check_output(args=cmd)

    # use embeddings from max. iteration's dump
    max_iter_dump = iter - (iter % dump_period)
    copyfile("model_word_%d.txt" % max_iter_dump, "wordrank.words")
    copyfile("model_context_%d.txt" % max_iter_dump, "wordrank.contexts")
    model = cls.load_wordrank_model(
        "wordrank.words",
        os.path.join("meta", vocab_file),
        "wordrank.contexts",
        sorted_vocab,
        ensemble,
    )
    os.chdir("../..")

    if cleanup_files:
        rmtree(model_dir)
    return model