corpora.mmcorpus – Corpus in Matrix Market format

Corpus in the Matrix Market format.

class gensim.corpora.mmcorpus.MmCorpus(fname)

Corpus in the Matrix Market format.

Initialize the matrix reader.

The fname is a path to a file on local filesystem, which is expected to be in sparse (coordinate) Matrix Market format. Documents are assumed to be rows of the matrix (and document features are columns).

classmethod load(fname)
Load a previously saved object from file (also see save).
save(fname)
Save the object to file via pickling (also see load).
static saveCorpus(fname, corpus, id2word=None)
Save a corpus in the Matrix Market format to disk.

Previous topic

corpora.lowcorpus – Corpus in List-of-Words format

Next topic

corpora.svmlightcorpus – Corpus in SVMlight format