Package lingscope.algorithms
Class AnnotationComparer
- java.lang.Object
-
- lingscope.algorithms.AnnotationComparer
-
public class AnnotationComparer extends Object
Compares two annotations or two annotation files- Author:
- shashank
-
-
Constructor Summary
Constructors Constructor Description AnnotationComparer(int numFolds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcompareAnnotationFiles(String goldFile, String testFile)voidcompareAnnotations(AnnotatedSentence goldSentence, AnnotatedSentence testSentence)double[]getAccuracies()doublegetAccuracy(double tp, double fp, double fn, double tn)doublegetFScore(double recall, double precision)double[]getFScores(double[] recalls, double[] precisions)double[]getPerfectAccuracies()doublegetPerfectAccuracy(double trues, double total)doublegetPrecision(double tp, double fp)double[]getPrecisions()doublegetRecall(double tp, double fn)double[]getRecalls()voidprintStats()voidreset()Resets the values for the comparer
-
-
-
Method Detail
-
reset
public final void reset()
Resets the values for the comparer
-
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)
-
-