Package nltk :: Package tag :: Module crf :: Class CRFInfo :: Class WeightGroup
[hide private]
[frames] | no frames]

Class WeightGroup

source code

object --+
         |
        CRFInfo.WeightGroup

A configuration object used by MalletCRF to specify how input-features (which are a function of only the input) should be mapped to joint-features (which are a function of both the input and the output tags).

Each weight group specifies that a given set of input features should be paired with all transitions from a given set of source tags to a given set of destination tags.

Instance Methods [hide private]
 
__init__(self, name, src, dst, features='.*')
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
toxml(self) source code
 
match(self, src, dst) source code

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

Static Methods [hide private]
 
_read(etree) source code
Class Variables [hide private]
  _XML_TEMPLATE = ' <weightGroup name="%(name)s" src="%(src)s...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, src, dst, features='.*')
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Parameters:
  • name - A unique name for this weight group.
  • src - The set of source tags that should be used for this weight group, specified as either a list of state names or a regular expression.
  • dst - The set of destination tags that should be used for this weight group, specified as either a list of state names or a regular expression.
  • features - The set of input feature that should be used for this weight group, specified as either a list of feature names or a regular expression. WARNING: currently, this regexp is passed streight to java -- i.e., it must be a java-style regexp!
Overrides: object.__init__

Class Variable Details [hide private]

_XML_TEMPLATE

Value:
'    <weightGroup name="%(name)s" src="%(src)s" dst="%(dst)s" features\
="%(features)s" />'