| Trees | Indices | Help |
|
|---|
|
|
object --+
|
models.TaggerModel --+
|
NgramTaggerModel
hash(x)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from Inherited from |
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
|||
|
|||
MODEL_TYPE = hash(x) |
|||
TRAINING_OPTIONS = [ModuleOption('n', filter= int, help_text=
|
|||
|
|||
| tags | |||
| readable_parameters | |||
|
Inherited from Inherited from Inherited from |
|||
|
|||
An n-gram model to be used as a tagging model. Uses NLTK to represent, train and evaluate the n-gram model.
|
Trains the loaded model using the data in the list of sequences.
|
Subclasses should implement this method to load up the model data given in the argument data. They should return an instance of themselves. The data will be in the form of a dictionary, as returned by the class' _get_model_data(). A default implementation that just uses simple pickling is provided. It assumes that the class can be instantiated using no arguments.
|
Subclasses should implement this method to return the raw data of the model in a form that can be pickled and written out to a file. A default implementation to complement the implementation of _load_model is provided. *** IMPORTANT: *** Some implementations perform part of the model storage in their _get_model_data method, so you shouldn't use this just to get the data if you don't plan to store it. (Not sure why you'd want the raw data anyway and this is a private method - just warning you!)
|
Just for a laugh, use the trained n-gram to generate a chord sequence and output it in a playable form. Returns a tuple: (chords, tags) To Do: this isn't implemented yet for n-grams. It's not a high priority, but would be fun. |
|
|||
TRAINING_OPTIONS
|
|
|||
tags
|
readable_parameters
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Nov 26 16:04:58 2012 | http://epydoc.sourceforge.net |