Package jazzparser :: Package parsers :: Package tagrank :: Module chart :: Class TagProbabilitySignHashSet
[hide private]
[frames] | no frames]

Class TagProbabilitySignHashSet

source code

       object --+        
                |        
     data.HashSet --+    
                    |    
cky.chart.SignHashSet --+
                        |
                       TagProbabilitySignHashSet

For this chart's internal data structure, we use a modified implementation of the HashSet which adds some basic handling of the tag probabilities that came from the tagger's model.

Instance Methods [hide private]
 
__init__(self, *args, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_add_existing_value(self, existing_value, new_value)
When a value already exists in the table, this is called instead of adding the value.
source code
 
_max_probability(self) source code
 
_apply_beam(self)
Applies a beam, using the already given threshold, to the set, pruning out any signs with a probability lower than the given ratio of the most probable sign.
source code
 
ranked(self)
Returns the signs in the set ranked by tag probability product (highest first).
source code

Inherited from cky.chart.SignHashSet: append, get_distinct_categories, get_signs_by_category, get_signs_grouped_by_category, remove

Inherited from data.HashSet: __contains__, __len__, extend, values

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

Class Variables [hide private]
  DEFAULT_THRESHOLD = 0.001
  DEFAULT_MAX_SIZE = 50
  DEFAULT_BEAMING_THRESHOLD = 20
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

_add_existing_value(self, existing_value, new_value)

source code 

When a value already exists in the table, this is called instead of adding the value. By default, it does nothing (i.e. drops the new value), but you can override it if you want to do something else to combine the values.

Note that your custom methods must only modify the sign that's already in the set (existing_value), not add a new sign and not modify new_value.

Overrides: data.HashSet._add_existing_value
(inherited documentation)