public class Evaluate extends AbstractEvaluate
Modifier and Type | Field and Description |
---|---|
protected java.text.DecimalFormat |
format |
NF
Constructor and Description |
---|
Evaluate(SentimentModel model) |
Modifier and Type | Method and Description |
---|---|
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.
|
void |
eval(Tree tree) |
static void |
main(java.lang.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.txt
Other arguments are available, for example -numClasses . |
void |
populatePredictedLabels(java.util.List<Tree> trees)
Sets the predicted sentiment label for all trees given.
|
void |
printSummary() |
void |
reset() |
approxAccuracy, approxCombinedAccuracy, countLengthAccuracy, countRoot, countTree, eval, exactNodeAccuracy, exactRootAccuracy, lengthAccuracies, printConfusionMatrix, printLengthAccuracies
public Evaluate(SentimentModel model)
public void reset()
reset
in class AbstractEvaluate
public void eval(Tree tree)
eval
in class AbstractEvaluate
protected void countUnks(Tree tree)
public void printSummary()
printSummary
in class AbstractEvaluate
public void populatePredictedLabels(java.util.List<Tree> trees)
AbstractEvaluate
RNNCoreAnnotations.PredictedClass
annotation
for all nodes in all trees.populatePredictedLabels
in class AbstractEvaluate
trees
- List of Trees to be annotatedpublic static void main(java.lang.String[] args)
-model model -treebank treebank
java edu.stanford.nlp.sentiment.Evaluate
-model edu/stanford/nlp/models/sentiment/sentiment.ser.gz
-treebank /u/nlp/data/sentiment/sentiment-treebank/fiveclass/dev.txt
Other 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
.