edu.stanford.nlp.parser.metrics
Class AbstractEval

java.lang.Object
  extended by edu.stanford.nlp.parser.metrics.AbstractEval
Direct Known Subclasses:
AbstractEval.CatErrorEval, AbstractEval.RuleErrorEval, AbstractEval.ScoreEval, Evalb, EvalbByCat, TaggingEval, UnlabeledAttachmentEval

public abstract class AbstractEval
extends Object

A framework for Set-based precision/recall/F1 evaluation.

Author:
Dan Klein

Nested Class Summary
static class AbstractEval.CatErrorEval
          This class counts which categories are over and underproposed in trees.
static class AbstractEval.RuleErrorEval
           
static class AbstractEval.ScoreEval
          This isn't really a kind of AbstractEval: we're sort of cheating here.
 
Field Summary
protected  double curF1
           
protected  double num
           
protected  boolean runningAverages
           
protected  String str
           
 
Constructor Summary
AbstractEval()
           
AbstractEval(boolean runningAverages)
           
AbstractEval(String str)
           
AbstractEval(String str, boolean runningAverages)
           
 
Method Summary
 void display(boolean verbose)
           
 void display(boolean verbose, PrintWriter pw)
           
 void evaluate(Tree guess, Tree gold)
           
 void evaluate(Tree guess, Tree gold, PrintWriter pw)
           
 void evaluate(Tree guess, Tree gold, PrintWriter pw, double weight)
           
 double getEvalbF1()
           
 double getEvalbF1Percent()
           
 double getExact()
           
 double getExactPercent()
           
 double getLastF1()
          Return the evalb F1% from the last call to evaluate(edu.stanford.nlp.trees.Tree, edu.stanford.nlp.trees.Tree).
 int getNum()
           
 double getSentAveF1()
           
protected abstract  Set<?> makeObjects(Tree tree)
           
protected static double precision(Set<?> s1, Set<?> s2)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

str

protected final String str

runningAverages

protected final boolean runningAverages

num

protected double num

curF1

protected double curF1
Constructor Detail

AbstractEval

public AbstractEval()

AbstractEval

public AbstractEval(boolean runningAverages)

AbstractEval

public AbstractEval(String str)

AbstractEval

public AbstractEval(String str,
                    boolean runningAverages)
Method Detail

getSentAveF1

public double getSentAveF1()

getEvalbF1

public double getEvalbF1()

getLastF1

public double getLastF1()
Return the evalb F1% from the last call to evaluate(edu.stanford.nlp.trees.Tree, edu.stanford.nlp.trees.Tree).

Returns:
The F1 percentage

getEvalbF1Percent

public double getEvalbF1Percent()
Returns:
The evalb (micro-averaged) F1 times 100 to make it a number between 0 and 100.

getExact

public double getExact()

getExactPercent

public double getExactPercent()

getNum

public int getNum()

precision

protected static double precision(Set<?> s1,
                                  Set<?> s2)

makeObjects

protected abstract Set<?> makeObjects(Tree tree)

evaluate

public void evaluate(Tree guess,
                     Tree gold)

evaluate

public void evaluate(Tree guess,
                     Tree gold,
                     PrintWriter pw)

evaluate

public void evaluate(Tree guess,
                     Tree gold,
                     PrintWriter pw,
                     double weight)

display

public void display(boolean verbose)

display

public void display(boolean verbose,
                    PrintWriter pw)


Stanford NLP Group