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

Class CRFInfo

source code

object --+
         |
        CRFInfo

An object used to record configuration information about a MalletCRF object. This configuration information can be serialized to an XML file, which can then be read by NLTK's custom interface to Mallet's CRF.

CRFInfo objects are typically created by the MalletCRF.train() method.

Advanced users may wish to directly create custom CRFInfo.WeightGroup objects and pass them to the MalletCRF.train() function. See CRFInfo.WeightGroup for more information.

Nested Classes [hide private]
  State
A description of a single CRF state.
  Transition
A description of a single CRF transition.
  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).
Instance Methods [hide private]
 
__init__(self, states, gaussian_variance, default_label, max_iterations, transduction_type, weight_groups, add_start_state, add_end_state, model_filename, feature_detector)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
toxml(self) source code
 
write(self, filename) source code

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

Static Methods [hide private]
 
fromstring(s) source code
 
_read(etree) source code
Class Variables [hide private]
  _XML_TEMPLATE = '<crf>\n <modelFile>%(model_filename)s</model...
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, states, gaussian_variance, default_label, max_iterations, transduction_type, weight_groups, add_start_state, add_end_state, model_filename, feature_detector)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

Class Variable Details [hide private]

_XML_TEMPLATE

Value:
'''<crf>
  <modelFile>%(model_filename)s</modelFile>
  <gaussianVariance>%(gaussian_variance)d</gaussianVariance>
  <defaultLabel>%(default_label)s</defaultLabel>
  <maxIterations>%(max_iterations)s</maxIterations>
  <transductionType>%(transduction_type)s</transductionType>
  <featureDetector name="%(feature_detector_name)s">
    %(feature_detector)s
...