nltk/nltk — Issue #58: classifier API
Author: alexrudnick
Created: 2012-01-17 06:25:04+00:00
State: open

Classifiers are trained using a factory function, e.g.:

nltk.NaiveBayesClassifier.train(train_set)

N-Gram taggers used to be trained like this too, but we changed them to do
training in constructor, e.g.:

nltk.BigramTagger(train_sents)

NEChunkParserTagger, NGramModel, FreqDist, and ConditionalFreqDist are also
initialized with data to the constructor. So how about:

nltk.NaiveBayesClassifier(train_set) ?

Migrated from http://code.google.com/p/nltk/issues/detail?id=316

earlier comments

peter.ljunglof@heatherleaf.se said, at 2009-04-02T18:05:16.000Z:

The BrillTaggerTrainer (and Fast-) also have train methods, perhaps they could be cleaned too?

>>> trainer = nltk.BrillTaggerTrainer(basetagger, templates)
>>> tagger = trainer.train(training_data)

How about this instead:

>>> tagger = nltk.BrillTaggerTrainer(basetagger, templates, training_data)

StevenBird1 said, at 2009-05-04T01:11:41.000Z:

It would be good to resolve this in 0.9.9