edu.stanford.nlp.parser.lexparser
Class AbstractUnknownWordModelTrainer

java.lang.Object
  extended by edu.stanford.nlp.parser.lexparser.AbstractUnknownWordModelTrainer
All Implemented Interfaces:
UnknownWordModelTrainer
Direct Known Subclasses:
ArabicUnknownWordModelTrainer, BaseUnknownWordModelTrainer, ChineseUnknownWordModelTrainer, EnglishUnknownWordModelTrainer, FrenchUnknownWordModelTrainer

public abstract class AbstractUnknownWordModelTrainer
extends java.lang.Object
implements UnknownWordModelTrainer


Field Summary
 
Fields inherited from interface edu.stanford.nlp.parser.lexparser.UnknownWordModelTrainer
NULL_ITW, nullTag, nullWord, unknown
 
Constructor Summary
AbstractUnknownWordModelTrainer()
           
 
Method Summary
 void incrementTreesRead(double weight)
           
 void initializeTraining(Options op, Lexicon lex, Index<java.lang.String> wordIndex, Index<java.lang.String> tagIndex, double totalTrees)
          Initialize the trainer with a few of the data structures it needs to train.
 void train(java.util.Collection<Tree> trees)
          Tallies statistics for this particular collection of trees.
 void train(java.util.Collection<Tree> trees, double weight)
          Tallies statistics for a weighted collection of trees.
 void train(Tree tree, double weight)
          Tallies statistics for a single tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.stanford.nlp.parser.lexparser.UnknownWordModelTrainer
finishTraining, train
 

Constructor Detail

AbstractUnknownWordModelTrainer

public AbstractUnknownWordModelTrainer()
Method Detail

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

train

public final void train(java.util.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(java.util.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