Class SentimentCrossValidator
java.lang.Object
opennlp.tools.sentiment.SentimentCrossValidator
Class for performing cross validation on the Sentiment Analysis Parser.
-
Constructor Summary
ConstructorsConstructorDescriptionSentimentCrossValidator(String lang, opennlp.tools.util.TrainingParameters params, SentimentFactory factory, opennlp.tools.sentiment.SentimentEvaluationMonitor[] monitors) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidevaluate(opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample> samples, int nFolds) Performs evaluationopennlp.tools.util.eval.FMeasureReturns the F-Measure
-
Constructor Details
-
SentimentCrossValidator
public SentimentCrossValidator(String lang, opennlp.tools.util.TrainingParameters params, SentimentFactory factory, opennlp.tools.sentiment.SentimentEvaluationMonitor[] monitors) Constructor
-
-
Method Details
-
evaluate
public void evaluate(opennlp.tools.util.ObjectStream<opennlp.tools.sentiment.SentimentSample> samples, int nFolds) throws IOException Performs evaluation- Parameters:
samples- stream of SentimentSamplesnFolds- the number of folds to be used in cross validation- Throws:
IOException
-
getFMeasure
public opennlp.tools.util.eval.FMeasure getFMeasure()Returns the F-Measure- Returns:
- the F-Measure
-