Package nltk_lite :: Package contrib :: Module marshal :: Class MarshalUnigram
[hide private]
[frames] | no frames]

Class MarshalUnigram

source code

     object --+                
              |                
yaml.YAMLObject --+            
                  |            
           tag.TagI --+        
                      |        
  tag.SequentialBackoff --+    
                          |    
        tag.unigram.Unigram --+
                              |
                             MarshalUnigram

Nested Classes [hide private]

Inherited from yaml.YAMLObject: __metaclass__, yaml_dumper, yaml_loader

Instance Methods [hide private]
 
marshal(self, filename)
Marshals (saves to a plain text file) the tagger model.
source code
 
unmarshal(self, filename)
Unmarshals (loads from a plain text file) the tagger model.
source code

Inherited from tag.unigram.Unigram: __init__, __repr__, size, tag_one, train

Inherited from tag.SequentialBackoff: tag, tag_sents

Inherited from tag.SequentialBackoff (private): _backoff_tag_one

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

Class Methods [hide private]

Inherited from yaml.YAMLObject: from_yaml, to_yaml

Class Variables [hide private]
  _classname = 'UnigramTagger'

Inherited from tag.unigram.Unigram: yaml_tag

Inherited from yaml.YAMLObject: yaml_flow_style

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

marshal(self, filename)

source code 

Marshals (saves to a plain text file) the tagger model.

Parameters:
  • filename (string) - Name of the file to which save the model (will be overwritten if it already exists).

unmarshal(self, filename)

source code 

Unmarshals (loads from a plain text file) the tagger model. For safety, this operation is intended to be performed only on newly created taggers (i.e., without any previous model).

Parameters:
  • filename (string) - Name of the file from which the model will be read.