Package edu.stanford.nlp.sentiment
Class Evaluate
- java.lang.Object
-
- edu.stanford.nlp.sentiment.AbstractEvaluate
-
- edu.stanford.nlp.sentiment.Evaluate
-
public class Evaluate extends AbstractEvaluate
- Author:
- John Bauer
-
-
Field Summary
Fields Modifier and Type Field Description protected DecimalFormatformat-
Fields inherited from class edu.stanford.nlp.sentiment.AbstractEvaluate
NF
-
-
Constructor Summary
Constructors Constructor Description Evaluate(SentimentModel model)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcountUnks(Tree tree)Keep track of how many trees have at least one unknown, and how many of those have the top level annotation correct.voideval(Tree tree)static voidmain(String[] args)Expected arguments are-model model -treebank treebank
For example
java edu.stanford.nlp.sentiment.Evaluate -model edu/stanford/nlp/models/sentiment/sentiment.ser.gz -treebank /u/nlp/data/sentiment/sentiment-treebank/fiveclass/dev.txtOther arguments are available, for example-numClasses.voidpopulatePredictedLabels(List<Tree> trees)Sets the predicted sentiment label for all trees given.voidprintSummary()voidreset()-
Methods inherited from class edu.stanford.nlp.sentiment.AbstractEvaluate
approxAccuracy, approxCombinedAccuracy, countLengthAccuracy, countRoot, countTree, eval, exactNodeAccuracy, exactRootAccuracy, lengthAccuracies, printConfusionMatrix, printLengthAccuracies
-
-
-
-
Field Detail
-
format
protected DecimalFormat format
-
-
Constructor Detail
-
Evaluate
public Evaluate(SentimentModel model)
-
-
Method Detail
-
reset
public void reset()
- Overrides:
resetin classAbstractEvaluate
-
eval
public void eval(Tree tree)
- Overrides:
evalin classAbstractEvaluate
-
countUnks
protected void countUnks(Tree tree)
Keep track of how many trees have at least one unknown, and how many of those have the top level annotation correct.
-
printSummary
public void printSummary()
- Overrides:
printSummaryin classAbstractEvaluate
-
populatePredictedLabels
public void populatePredictedLabels(List<Tree> trees)
Description copied from class:AbstractEvaluateSets the predicted sentiment label for all trees given. This method sets theRNNCoreAnnotations.PredictedClassannotation for all nodes in all trees.- Specified by:
populatePredictedLabelsin classAbstractEvaluate- Parameters:
trees- List of Trees to be annotated
-
main
public static void main(String[] args)
Expected arguments are-model model -treebank treebank
For example
java edu.stanford.nlp.sentiment.Evaluate -model edu/stanford/nlp/models/sentiment/sentiment.ser.gz -treebank /u/nlp/data/sentiment/sentiment-treebank/fiveclass/dev.txtOther arguments are available, for example-numClasses. See RNNOptions.java, RNNTestOptions.java and RNNTrainOptions.java for more arguments. The configuration is usually derived from the RNN model file, which is not available here as the predictions are external. It is the caller's responsibility to provide a configuration matching the settings of the external predictor. Flags of interest include-equivalenceClasses.
-
-