The following is an evaluation of TrigramTagger
, one the simpler taggers offered by the NLTK.
To replicate this, clone https://github.com/cltk/greek_treebank_perseus and copy the .pos
into your current directory, naming it greek_training_set.pos
.
from nltk.corpus.reader import TaggedCorpusReader
from nltk.tag import TrigramTagger
from nltk.tokenize import wordpunct_tokenize
reader = TaggedCorpusReader('.', 'greek_training_set.pos')
train_sents = reader.tagged_sents()
tagger = TrigramTagger(train_sents)
tagger.evaluate(train_sents)
To replicate this, clone https://github.com/cltk/latin_treebank_perseus and copy the .pos
into your current directory, naming it latin_training_set.pos
.
reader = TaggedCorpusReader('.', 'latin_training_set.pos')
train_sents = reader.tagged_sents()
tagger = TrigramTagger(train_sents)
tagger.evaluate(train_sents)