Home | Trees | Index | Help |
|
---|
Package nltk_lite :: Package tag :: Module ngram :: Class Ngram |
|
object
--+ |TagI
--+ |SequentialBackoff
--+ | Ngram
Bigram
,
MarshalNgram
,
Trigram
tagger.Ngram
can be used, it should be trained on a tagged
corpus. Using this training data, it will construct a frequency
distribution describing the frequencies with each word is tagged in
different contexts. The context considered consists of the word to be
tagged and the n-1 previous words' tags. Once the tagger has been
trained, it uses this frequency distribution to tag words by assigning
each word the tag with the maximum frequency given its context. If the
tagger.Ngram
encounters a word in a context for which it has
no data, it will assign it the tag None
.
Method Summary | |
---|---|
Construct an n-gram stochastic tagger. | |
__repr__(self)
| |
size(self)
| |
tag_one(self,
token,
history)
| |
Train this tagger.Ngram using the given training
data. | |
Inherited from SequentialBackoff :
tag ,
tag_sents
Inherited from object :
__delattr__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__str__
|
Method Details |
---|
__init__(self,
n,
cutoff=1,
backoff=None)
Construct an n-gram stochastic tagger. The tagger must be
trained using the |
train(self, tagged_corpus, verbose=False)Train thistagger.Ngram using the given training
data.
|
Home | Trees | Index | Help |
|
---|
Generated by Epydoc 2.1 on Tue Sep 5 09:37:21 2006 | http://epydoc.sf.net |