vsm.model.BeagleContextMulti

class vsm.model.BeagleContextMulti(corpus, env_corpus, env_matrix, context_type='sentence')

Methods

__init__(corpus, env_corpus, env_matrix[, ...]) Initialize BeagleContextMulti.
load(f) Takes a filename or file object and loads it as an npz archive
save(f) Takes a filename or file object and saves self.matrix in an npz archive.
train([n_procs]) Takes an optional argument n_procs, number of processors, and trains the model on the number of processors.
__init__(corpus, env_corpus, env_matrix, context_type='sentence')

Initialize BeagleContextMulti.

Parameters:
  • corpus (class:Corpus) – Souce of observed data.
  • env_corpus (class:Corpus) – BEAGLE environment corpus.
  • env_matrix (2-D array) – Matrix from BEAGLE environment model.
  • context_type (string, optional) – Name of tokenization stored in corpus whose tokens will be treated as documents. Default is sentence.
static load(f)

Takes a filename or file object and loads it as an npz archive into a BaseModel object.

Parameters:file (str-like or file-like object) – Designates the file to read. If file is a string ending in .gz, the file is first gunzipped. See numpy.load for further details.
Returns:A dictionary storing the data found in file.
See Also:numpy.load()
save(f)

Takes a filename or file object and saves self.matrix in an npz archive.

Parameters:file (str-like or file-like object) – Designates the file to which to save data. See numpy.savez for further details.
Returns:None
See Also:numpy.savez()
train(n_procs=2)

Takes an optional argument n_procs, number of processors, and trains the model on the number of processors. n_procs is 2 by default.

Parameters:n_procs (int, optional) – Number of processors. Default is 2.
Returs :None

Previous topic

vsm.model.BeagleComposite

Next topic

vsm.model.BeagleContextSeq

This Page