vsm.model.BeagleOrderSeq

class vsm.model.BeagleOrderSeq(corpus, env_matrix, context_type='sentence', psi=None, rand_perm=None, lmda=7)

BeagleOrderSeq stores word order information in the context.

Methods

__init__(corpus, env_matrix[, context_type, ...]) Initialize BeagleOrderSeq.
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() Trains the model.
__init__(corpus, env_matrix, context_type='sentence', psi=None, rand_perm=None, lmda=7)

Initialize BeagleOrderSeq.

Parameters:
  • corpus (Corpus) – Soure of observed data.
  • env_matrix (2-D array) – BEAGLE environment matrix.
  • context_type (string, optional) – Name of tokenization stored in corpus whose tokens will be treated as documents. Default is sentence.
  • psi (int, optional) –
  • rand_perm (boolean, optional) –
  • lmda (int, optional) –
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()

Trains the model.

Previous topic

vsm.model.BeagleOrderMulti

Next topic

vsm.model.LdaCgsSeq

This Page