opennlp.tools.postag
Class POSTaggerCrossValidator

java.lang.Object
  extended by opennlp.tools.postag.POSTaggerCrossValidator

public class POSTaggerCrossValidator
extends Object


Constructor Summary
POSTaggerCrossValidator(String languageCode, ModelType modelType, POSDictionary tagDictionary, Dictionary ngramDictionary)
           
POSTaggerCrossValidator(String languageCode, ModelType modelType, POSDictionary tagDictionary, Dictionary ngramDictionary, int cutoff, int iterations)
          Deprecated. use POSTaggerCrossValidator(String, TrainingParameters, POSDictionary, Dictionary, POSTaggerEvaluationMonitor...) instead and pass in a TrainingParameters object.
POSTaggerCrossValidator(String languageCode, TrainingParameters trainParam, POSDictionary tagDictionary, Dictionary ngramDictionary, POSTaggerEvaluationMonitor... listeners)
           
POSTaggerCrossValidator(String languageCode, TrainingParameters trainParam, POSDictionary tagDictionary, Integer ngramCutoff, POSTaggerEvaluationMonitor... listeners)
           
POSTaggerCrossValidator(String languageCode, TrainingParameters trainParam, POSDictionary tagDictionary, POSTaggerEvaluationMonitor... listeners)
           
 
Method Summary
 void evaluate(ObjectStream<POSSample> samples, int nFolds)
          Starts the evaluation.
 double getWordAccuracy()
          Retrieves the accuracy for all iterations.
 long getWordCount()
          Retrieves the number of words which where validated over all iterations.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

POSTaggerCrossValidator

@Deprecated
public POSTaggerCrossValidator(String languageCode,
                                          ModelType modelType,
                                          POSDictionary tagDictionary,
                                          Dictionary ngramDictionary,
                                          int cutoff,
                                          int iterations)
Deprecated. use POSTaggerCrossValidator(String, TrainingParameters, POSDictionary, Dictionary, POSTaggerEvaluationMonitor...) instead and pass in a TrainingParameters object.


POSTaggerCrossValidator

public POSTaggerCrossValidator(String languageCode,
                               ModelType modelType,
                               POSDictionary tagDictionary,
                               Dictionary ngramDictionary)

POSTaggerCrossValidator

public POSTaggerCrossValidator(String languageCode,
                               TrainingParameters trainParam,
                               POSDictionary tagDictionary,
                               POSTaggerEvaluationMonitor... listeners)

POSTaggerCrossValidator

public POSTaggerCrossValidator(String languageCode,
                               TrainingParameters trainParam,
                               POSDictionary tagDictionary,
                               Integer ngramCutoff,
                               POSTaggerEvaluationMonitor... listeners)

POSTaggerCrossValidator

public POSTaggerCrossValidator(String languageCode,
                               TrainingParameters trainParam,
                               POSDictionary tagDictionary,
                               Dictionary ngramDictionary,
                               POSTaggerEvaluationMonitor... listeners)
Method Detail

evaluate

public void evaluate(ObjectStream<POSSample> samples,
                     int nFolds)
              throws IOException,
                     IOException
Starts the evaluation.

Parameters:
samples - the data to train and test
nFolds - number of folds
Throws:
IOException

getWordAccuracy

public double getWordAccuracy()
Retrieves the accuracy for all iterations.

Returns:
the word accuracy

getWordCount

public long getWordCount()
Retrieves the number of words which where validated over all iterations. The result is the amount of folds multiplied by the total number of words.

Returns:
the word count


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.