lingscope.algorithms
Class AnnotationComparer

java.lang.Object
  extended by lingscope.algorithms.AnnotationComparer

public class AnnotationComparer
extends java.lang.Object

Compares two annotations or two annotation files


Constructor Summary
AnnotationComparer(int numFolds)
           
 
Method Summary
 void compareAnnotationFiles(java.lang.String goldFile, java.lang.String testFile)
           
 void compareAnnotations(AnnotatedSentence goldSentence, AnnotatedSentence testSentence)
           
 double[] getAccuracies()
           
 double getAccuracy(double tp, double fp, double fn, double tn)
           
 double getFScore(double recall, double precision)
           
 double[] getFScores(double[] recalls, double[] precisions)
           
 double[] getPerfectAccuracies()
           
 double getPerfectAccuracy(double trues, double total)
           
 double getPrecision(double tp, double fp)
           
 double[] getPrecisions()
           
 double getRecall(double tp, double fn)
           
 double[] getRecalls()
           
 void printStats()
           
 void reset()
          Resets the values for the comparer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnnotationComparer

public AnnotationComparer(int numFolds)
Method Detail

reset

public final void reset()
Resets the values for the comparer


compareAnnotationFiles

public void compareAnnotationFiles(java.lang.String goldFile,
                                   java.lang.String testFile)

compareAnnotations

public void compareAnnotations(AnnotatedSentence goldSentence,
                               AnnotatedSentence testSentence)

printStats

public void printStats()

getRecalls

public double[] getRecalls()

getPrecisions

public double[] getPrecisions()

getFScores

public double[] getFScores(double[] recalls,
                           double[] precisions)

getAccuracies

public double[] getAccuracies()

getPerfectAccuracies

public double[] getPerfectAccuracies()

getPerfectAccuracy

public double getPerfectAccuracy(double trues,
                                 double total)

getAccuracy

public double getAccuracy(double tp,
                          double fp,
                          double fn,
                          double tn)

getRecall

public double getRecall(double tp,
                        double fn)

getPrecision

public double getPrecision(double tp,
                           double fp)

getFScore

public double getFScore(double recall,
                        double precision)