edu.stanford.nlp.parser.lexparser
Class BaseUnknownWordModelTrainer
java.lang.Object
edu.stanford.nlp.parser.lexparser.AbstractUnknownWordModelTrainer
edu.stanford.nlp.parser.lexparser.BaseUnknownWordModelTrainer
- All Implemented Interfaces:
- UnknownWordModelTrainer
- Direct Known Subclasses:
- GermanUnknownWordModelTrainer
public class BaseUnknownWordModelTrainer
- extends AbstractUnknownWordModelTrainer
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseUnknownWordModelTrainer
public BaseUnknownWordModelTrainer()
initializeTraining
public void initializeTraining(Options op,
Lexicon lex,
Index<java.lang.String> wordIndex,
Index<java.lang.String> tagIndex,
double totalTrees)
- Description copied from interface:
UnknownWordModelTrainer
- Initialize the trainer with a few of the data structures it needs
to train. Also, it is necessary to estimate the number of trees
that it will be given, as many of the UWMs switch training modes
after seeing a fraction of the trees.
This is an initialization method and not part of the constructor
because these Trainers are generally loaded by reflection, and
making this a method instead of a constructor lets the compiler
catch silly errors.
- Specified by:
initializeTraining
in interface UnknownWordModelTrainer
- Overrides:
initializeTraining
in class AbstractUnknownWordModelTrainer
train
public void train(TaggedWord tw,
int loc,
double weight)
- Description copied from interface:
UnknownWordModelTrainer
- Tallies statistics for a single word.
Can be called multiple times.
finishTraining
public UnknownWordModel finishTraining()
- Description copied from interface:
UnknownWordModelTrainer
- Returns the trained UWM. Many of the subclasses build exactly
one model, and some of the finishTraining methods manipulate the
data in permanent ways, so this should only be called once
buildUWM
protected UnknownWordModel buildUWM()
Stanford NLP Group