class_docstr: Corpus in Blei's LDA-C format.
  
  The corpus is represented as two files: one describing the documents, and another
  describing the mapping between words and their ids.
  
  Each document is one line::
  
      N fieldId1:fieldValue1 fieldId2:fieldValue2 ... fieldIdN:fieldValueN
  
  
  The vocabulary is a file with words, one word per line; word at line K has an implicit `id=K`.
class_docstr_tok: ["Corpus","in","Blei","'s","LDA-C","format",".","The","corpus","is","represented","as","two","files",":","one","describing","the","documents",",","and","another","describing","the","mapping","between","words","and","their","ids",".","Each","document","is","one","line",":",":","N","fieldId1",":","fieldValue1","fieldId2",":","fieldValue2","...","fieldIdN",":","fieldValueN","The","vocabulary","is","a","file","with","words",",","one","word","per","line",";","word","at","line","K","has","an","implicit","`","id=K","`","."]
docstr: Parameters
  ----------
  fname : str
      Path to corpus.
  fname_vocab : str, optional
      Vocabulary file. If `fname_vocab` is None, searching one of variants:
  
      * `fname`.vocab
      * `fname`/vocab.txt
      * `fname_without_ext`.vocab
      * `fname_folder`/vocab.txt
  
  Raises
  ------
  IOError
      If vocabulary file doesn't exist.
docstr_tok: ["Parameters","--","--","--","--","--","fname",":","str","Path","to","corpus",".","fname_vocab",":","str",",","optional","Vocabulary","file",".","If","`","fname_vocab","`","is","None",",","searching","one","of","variants",":","*","`","fname","`",".vocab","*","`","fname","`","\/vocab.txt","*","`","fname_without_ext","`",".vocab","*","`","fname_folder","`","\/vocab.txt","Raises","--","--","--","IOError","If","vocabulary","file","does","n't","exist","."]
code: def __init__(self, fname, fname_vocab=None):
      """
  
      Parameters
      ----------
      fname : str
          Path to corpus.
      fname_vocab : str, optional
          Vocabulary file. If `fname_vocab` is None, searching one of variants:
  
          * `fname`.vocab
          * `fname`/vocab.txt
          * `fname_without_ext`.vocab
          * `fname_folder`/vocab.txt
  
      Raises
      ------
      IOError
          If vocabulary file doesn't exist.
  
      """
      IndexedCorpus.__init__(self, fname)
      logger.info("loading corpus from %s", fname)
  
      if fname_vocab is None:
          fname_base, _ = path.splitext(fname)
          fname_dir = path.dirname(fname)
          for fname_vocab in [
              utils.smart_extension(fname, ".vocab"),
              utils.smart_extension(fname, "/vocab.txt"),
              utils.smart_extension(fname_base, ".vocab"),
              utils.smart_extension(fname_dir, "/vocab.txt"),
          ]:
              if path.exists(fname_vocab):
                  break
          else:
              raise IOError(
                  "BleiCorpus: could not find vocabulary file"
              )
  
      self.fname = fname
      with utils.open(fname_vocab, "rb") as fin:
          words = [utils.to_unicode(word).rstrip() for word in fin]
      self.id2word = dict(enumerate(words))
  
file_path: gensim/gensim/corpora/bleicorpus.py
imports: from __future__ import with_statement
  from os import path
  import logging
  from gensim import utils
  from gensim.corpora import IndexedCorpus
label_desc: Use image node_id 1 to create a new BleiCorpus object from inherited base classes: IndexedCorpus with example: obj = BleiCorpus(fname, fname_vocab)