edu.stanford.nlp.parser.lexparser
Class AbstractUnknownWordModelTrainer
java.lang.Object
edu.stanford.nlp.parser.lexparser.AbstractUnknownWordModelTrainer
- All Implemented Interfaces:
- UnknownWordModelTrainer
- Direct Known Subclasses:
- ArabicUnknownWordModelTrainer, BaseUnknownWordModelTrainer, ChineseUnknownWordModelTrainer, EnglishUnknownWordModelTrainer, FrenchUnknownWordModelTrainer
public abstract class AbstractUnknownWordModelTrainer
- extends Object
- implements UnknownWordModelTrainer
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractUnknownWordModelTrainer
public AbstractUnknownWordModelTrainer()
initializeTraining
public void initializeTraining(Options op,
Lexicon lex,
Index<String> wordIndex,
Index<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
train
public final void train(Collection<Tree> trees)
- Description copied from interface:
UnknownWordModelTrainer
- Tallies statistics for this particular collection of trees. Can
be called multiple times.
- Specified by:
train in interface UnknownWordModelTrainer
train
public final void train(Collection<Tree> trees,
double weight)
- Description copied from interface:
UnknownWordModelTrainer
- Tallies statistics for a weighted collection of trees. Can
be called multiple times.
- Specified by:
train in interface UnknownWordModelTrainer
train
public final void train(Tree tree,
double weight)
- Description copied from interface:
UnknownWordModelTrainer
- Tallies statistics for a single tree.
Can be called multiple times.
- Specified by:
train in interface UnknownWordModelTrainer
incrementTreesRead
public void incrementTreesRead(double weight)
- Specified by:
incrementTreesRead in interface UnknownWordModelTrainer
Stanford NLP Group