Package nltk :: Package tag :: Module hmm :: Class LambdaTransform
[hide private]
[frames] | no frames]

Class LambdaTransform

source code

                           object --+        
                                    |        
api.HiddenMarkovModelTaggerTransformI --+    
                                        |    
         HiddenMarkovModelTaggerTransform --+
                                            |
                                           LambdaTransform

A subclass of HiddenMarkovModelTaggerTransform that is backed by an arbitrary user-defined function, instance method, or lambda function.

Instance Methods [hide private]
 
__init__(self, transform)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
list
transform(self, labeled_symbols)
Returns: a list of transformed symbols
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, transform)
(Constructor)

source code 

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

Parameters:
  • func (function) - a user-defined or lambda transform function
Overrides: HiddenMarkovModelTaggerTransform.__init__

transform(self, labeled_symbols)

source code 
Parameters:
  • labeled_symbols - a list of labeled untransformed symbols, i.e. symbols that are not (token, tag) or (word, tag)
Returns: list
a list of transformed symbols
Overrides: api.HiddenMarkovModelTaggerTransformI.transform
(inherited documentation)