gate.util
Class AnnotationDiffer

java.lang.Object
  |
  +--gate.util.AnnotationDiffer

public class AnnotationDiffer
extends Object


Nested Class Summary
(package private)  class AnnotationDiffer.Choice
          Represents a pairing of a key annotation with a response annotation and the associated score for that pairing.
 
Field Summary
static int CORRECT
           
protected  int correctMatches
           
static int DIFFERENT
           
protected  List finalChoices
          A list with the choices selected for the best result.
protected  List keyChoices
          A list of lists representing all possible choices for each key
protected  List keyList
          A list with all the key annotations
static int PARTIALLY_CORRECT
           
protected  int partiallyCorrectMatches
           
protected  List possibleChoices
          All the posible choices are added to this list for easy iteration.
protected  List responseChoices
          A list of lists representing all possible choices for each response
protected  List responseList
          A list with all the response annotations
private  Set significantFeaturesSet
           
 
Constructor Summary
AnnotationDiffer()
           
 
Method Summary
protected  void addChoice(AnnotationDiffer.Choice choice, int index, List listOfChoices)
           
 void calculateDiff(Collection key, Collection response)
          Computes a diff between two collections of annotations.
 int getFalsePositivesLenient()
           
 int getFalsePositivesStrict()
           
 double getFMeasureLenient(double beta)
           
 double getFMeasureStrict(double beta)
           
 double getPrecisionLenient()
           
 double getPrecisionStrict()
           
 double getRecallLenient()
           
 double getRecallStrict()
           
 Set getSignificantFeaturesSet()
           
 void printMissmatches()
           
(package private)  void sanityCheck()
          Performs some basic checks over the internal data structures from the last run.
 void setSignificantFeaturesSet(Set significantFeaturesSet)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CORRECT

public static final int CORRECT
See Also:
Constant Field Values

PARTIALLY_CORRECT

public static final int PARTIALLY_CORRECT
See Also:
Constant Field Values

DIFFERENT

public static final int DIFFERENT
See Also:
Constant Field Values

significantFeaturesSet

private Set significantFeaturesSet

correctMatches

protected int correctMatches

partiallyCorrectMatches

protected int partiallyCorrectMatches

keyList

protected List keyList
A list with all the key annotations


responseList

protected List responseList
A list with all the response annotations


keyChoices

protected List keyChoices
A list of lists representing all possible choices for each key


responseChoices

protected List responseChoices
A list of lists representing all possible choices for each response


possibleChoices

protected List possibleChoices
All the posible choices are added to this list for easy iteration.


finalChoices

protected List finalChoices
A list with the choices selected for the best result.

Constructor Detail

AnnotationDiffer

public AnnotationDiffer()
Method Detail

calculateDiff

public void calculateDiff(Collection key,
                          Collection response)
Computes a diff between two collections of annotations.

Parameters:
key -
response -

getPrecisionStrict

public double getPrecisionStrict()

getRecallStrict

public double getRecallStrict()

getPrecisionLenient

public double getPrecisionLenient()

getRecallLenient

public double getRecallLenient()

getFMeasureStrict

public double getFMeasureStrict(double beta)

getFMeasureLenient

public double getFMeasureLenient(double beta)

getFalsePositivesStrict

public int getFalsePositivesStrict()

getFalsePositivesLenient

public int getFalsePositivesLenient()

printMissmatches

public void printMissmatches()

sanityCheck

void sanityCheck()
           throws Exception
Performs some basic checks over the internal data structures from the last run.

Throws:
Exception

addChoice

protected void addChoice(AnnotationDiffer.Choice choice,
                         int index,
                         List listOfChoices)
Parameters:
choice - the choice to be added
index - the index in the list of choices

getSignificantFeaturesSet

public Set getSignificantFeaturesSet()

setSignificantFeaturesSet

public void setSignificantFeaturesSet(Set significantFeaturesSet)