Package jazzparser :: Package taggers :: Module models :: Class ModelTagger
[hide private]
[frames] | no frames]

Class ModelTagger

source code

   object --+    
            |    
tagger.Tagger --+
                |
               ModelTagger
Known Subclasses:

Base class for corpus-trained supertagging models. Provides interface and common methods for model classes, which must each provide their own training methods and the usual tagger methods (get_signs, etc).

The main thing this provides is stuff for storing and retreiving models.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
The tagger must have reference to the grammar being used to parse the input.
source code

Inherited from tagger.Tagger: get_all_signs, get_signs, get_string_input, get_tag_probability, get_word, get_word_duration

Inherited from tagger.Tagger (private): _get_input_length, _get_name

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods [hide private]

Inherited from tagger.Tagger: check_options

Static Methods [hide private]
 
partition_model_name(model_name, partition_number)
The model name to use when the given partition number is requested.
source code
Class Variables [hide private]
  COMPATIBLE_FORMALISMS = ['music_keyspan', 'music_halfspan']
  TAGGER_OPTIONS = [ModuleOption('model', filter= str, help_text...
Tagger-specific options.
  MODEL_CLASS = None
hash(x)

Inherited from tagger.Tagger: INPUT_TYPES, LEXICAL_PROBABILITY, shell_tools

Properties [hide private]

Inherited from tagger.Tagger: input_length, name

Inherited from object: __class__

Method Details [hide private]

__init__(self, *args, **kwargs)
(Constructor)

source code 

The tagger must have reference to the grammar being used to parse the input. It must also be given the full input when instantiated. The format of this input will depend on the tagger: for example, it might be a string or a MIDI file.

Parameters:
  • original_input - the input in its original, unprocessed form. This will usually be a string. This is optional, but in some circumstances things might fall apart if it hasn't been given. E.g. using a backoff model as backoff from a tagging model requires the original input to be passed to the backoff model.
  • logger - optional progress logger. Logging will be sent to this during initialization of the tagger and tagging. If not given, the logging will be lost. Subclasses may access the logger (or a dummy logger if none was given) in self.logger.
Overrides: object.__init__
(inherited documentation)

partition_model_name(model_name, partition_number)
Static Method

source code 

The model name to use when the given partition number is requested. The default implementation simply appends the number to the model name. Subclasses may override this if they want to do something different.


Class Variable Details [hide private]

TAGGER_OPTIONS

Tagger-specific options. List of ModuleOptions.

Value:
[ModuleOption('model', filter= str, help_text= "Model name. This model\
 must have been previously trained. Required", usage= "model=X, where \
X is the name of a trained model", required= True), ModuleOption('part\
ition', filter= int, help_text= "If given, a partitioned version of th\
e model will " "be used, taking the model name as the base name. The "\
 "partitioned models must have been trained separately.", usage= "part\
ition=P, where P is an int", default= None), ModuleOption('batch', fil\
ter= float, help_text= "Probability ratio between one tag and the next\
...