Package jazzparser :: Package taggers :: Package candc :: Module tagger :: Class CandcTagger
[hide private]
[frames] | no frames]

Class CandcTagger

source code

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

Superclass of both kinds of C&C tagger. Don't use this: use one of the subclasses below.

Nested Classes [hide private]
  MODEL_CLASS
This is really a fake: it doesn't actually save models itself, since we hand over to the C&C tagger to do that.
Instance Methods [hide private]
 
__init__(self, grammar, input, options={}, dict_cutoff=5, *args, **kwargs)
The tagger must have reference to the grammar being used to parse the input.
source code
 
_get_input_length(self)
Returns the number of words (chords) in the input.
source code
 
get_signs_for_word(self, index, offset=0) source code
 
get_word(self, index)
Returns the input word at this index.
source code

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

Inherited from tagger.Tagger (private): _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]

Inherited from models.ModelTagger: partition_model_name

Class Variables [hide private]
  COMPATIBLE_FORMALISMS = ['music_roman', 'music_keyspan', 'musi...
  INPUT_TYPES = ['db', 'chords']
List of allowed input datatypes.
  TAG_BATCH_RATIO = 0.8
  DEFAULT_UNSEEN_TAG_PROB = 0.001
  TAGGER_OPTIONS = [ModuleOption('batch', filter= float, help_te...
Tagger-specific options.

Inherited from tagger.Tagger: LEXICAL_PROBABILITY, shell_tools

Properties [hide private]
  input_length
Returns the number of words (chords) in the input.

Inherited from tagger.Tagger: name

Inherited from object: __class__

Method Details [hide private]

__init__(self, grammar, input, options={}, dict_cutoff=5, *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)

_get_input_length(self)

source code 

Returns the number of words (chords) in the input.

Overrides: tagger.Tagger._get_input_length

get_word(self, index)

source code 

Returns the input word at this index. This does not need to be a string, but must have a sensible __str__, so that it can be converted to a readable string. The purpose of this is to provide a readable form of the input for the parser to store in derivation traces.

Overrides: tagger.Tagger.get_word
(inherited documentation)

Class Variable Details [hide private]

COMPATIBLE_FORMALISMS

Value:
['music_roman', 'music_keyspan', 'music_halfspan']

TAGGER_OPTIONS

Tagger-specific options. List of ModuleOptions.

Value:
[ModuleOption('batch', filter= float, help_text= "Probability ratio be\
tween one tag and the next " "that allows the second to be returned in\
 the same batch.", usage= "batch=X, where X is a floating point value \
between 0 and 1", default= TAG_BATCH_RATIO), ModuleOption('model', hel\
p_text= "Name of the C&C trained model to use. Use the C&C " "training\
 scripts to produce this.", usage= "model=X, where X is the model name\
. Split up multi-level models with dots.", required= True), ModuleOpti\
on('unseen_tag_prob', filter= float, help_text= "Probability mass rese\
...

Property Details [hide private]

input_length

Returns the number of words (chords) in the input.

Get Method:
_get_input_length(self) - Returns the number of words (chords) in the input.