Package miopia :: Package tagger :: Module BrillTagger :: Class BrillTagger
[hide private]
[frames] | no frames]

Class BrillTagger

source code

                   object --+    
                            |    
AbstractTagger.AbstractTagger --+
                                |
                               BrillTagger

Wrapper of the NLTK Brill tagger. It builds a Brill-based tagger.

Instance Methods [hide private]
 
__init__(self, training_set, test_set, list_initial_taggers, back_off_tagger, fine_tag=True)
Constructor
source code
 
get_accuracy(self)
Returns: The theoretical accuracy of the trained tagger
source code
 
_backoff_tagger(self, train_sets, tagger_classes, backoff=None) source code
 
_train_brill_tagger(self, initial_tagger, train_sents, **kwargs) source code
 
_fine_tag_to_cposfeats(self, postag) source code
 
tag(self, tokens)
Returns: A list of tuples (word,InfoTag)
source code
 
_tag(self, tokens)
Returns: A list of tuples (word,InfoTag)
source code

Inherited from AbstractTagger.AbstractTagger: dis_accentuate, get_gold_set, get_training_set

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, training_set, test_set, list_initial_taggers, back_off_tagger, fine_tag=True)
(Constructor)

source code 

Constructor

Parameters:
  • training_set - A list of [(word,tag)]
  • test_test - A list of [(word,tag)]
  • list_initial_taggers - A list of taggers of type nltk.tag.sequential
  • back_off_tagger - A back off tagger of initial tagger. None for not to include any back-off tagger
  • fineTag - A boolean. True for using Fine PoS-tags, False for Coarse PoS-tags
Overrides: object.__init__

get_accuracy(self)

source code 
Returns:
The theoretical accuracy of the trained tagger

_fine_tag_to_cposfeats(self, postag)

source code 
Parameters:
  • postag - A fine part-of-speech tag according with the regexp cpostag:nameofFeat_valueofFeat-nameofFeat-... @return An InfoTag

tag(self, tokens)

source code 
Parameters:
  • tokens - A list of tokens. Each token is a string.
Returns:
A list of tuples (word,InfoTag)

_tag(self, tokens)

source code 
Parameters:
  • tokens - A list of tokens
Returns:
A list of tuples (word,InfoTag)