evaluation
Class AnnotationStats

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<java.lang.String,Counter>
          extended by evaluation.AnnotationStats
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,Counter>

public class AnnotationStats
extends java.util.HashMap<java.lang.String,Counter>

Statistics of annotation

Author:
Mateusz Kopec
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
 java.util.Map<java.lang.String,java.lang.String> senseIdToOrth
          Maps: sense id -> orth of lexeme
 java.util.Map<java.lang.String,java.lang.String> senseIdToPos
          Maps: sense id -> part of speech of lexeme
 
Constructor Summary
AnnotationStats(corpusapi.tei.TEISenseInventory dict)
          Constructor
 
Method Summary
 void addAnnotation(java.lang.String lexeme, java.lang.String senseId)
          Adds an annotation of chosen lexeme with chosen sense id
 int getAllCount()
          Gets number of annotations
 int getAllCount(java.lang.String pos)
          Gets number of annotations for given part of speech
 int getCountForLexeme(java.lang.String lexeme)
          Gets number of annotations for lexeme
 int getCountForSubsense(java.lang.String lexeme, java.lang.String subsenseId)
          Returns number of annotations with particular subsense
 java.util.Set<java.lang.String> getLexemeSet()
          Returns all lexemes
 java.util.Set<java.lang.String> getLexemeSet(java.lang.String pos)
          Returns set of lexemes of chosen part of speech
 double getMfsForLexeme(java.lang.String lexeme)
          Returns MFS accuracy for a lexeme
 double getSenseWeight(java.lang.String lexeme, java.lang.String subsenseId)
          Get the RARE value for given subsense of a lexeme
 java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Double>> getSortedMfs()
          Returns list of pairs : , sorted from lowest mfs
 java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Double>> getSortedMfs(java.lang.String pos)
          Returns list of pairs : , sorted from lowest mfs (and filtered for only chosen part of speech).
 java.util.List<java.lang.String> getSubsensesList(java.lang.String lexeme)
          Returns list of subsense ids of given lexeme
 java.lang.Double getTotalMFSAccuracy(java.lang.String pos)
          Calculates MFS accuracy for given annotation and part of speech
 java.lang.Double getTotalRandomAccuracy(java.lang.String pos)
          Gets random accuracy for this annotation and given part of speech
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

senseIdToOrth

public java.util.Map<java.lang.String,java.lang.String> senseIdToOrth
Maps: sense id -> orth of lexeme


senseIdToPos

public java.util.Map<java.lang.String,java.lang.String> senseIdToPos
Maps: sense id -> part of speech of lexeme

Constructor Detail

AnnotationStats

public AnnotationStats(corpusapi.tei.TEISenseInventory dict)
Constructor

Parameters:
dict - dictionary of senses
Method Detail

getAllCount

public int getAllCount()
Gets number of annotations

Returns:
number

getAllCount

public int getAllCount(java.lang.String pos)
Gets number of annotations for given part of speech

Parameters:
pos - part of speech
Returns:
number

getCountForLexeme

public int getCountForLexeme(java.lang.String lexeme)
Gets number of annotations for lexeme

Parameters:
lexeme -
Returns:
number

addAnnotation

public void addAnnotation(java.lang.String lexeme,
                          java.lang.String senseId)
Adds an annotation of chosen lexeme with chosen sense id

Parameters:
lexeme -
senseId -

getLexemeSet

public java.util.Set<java.lang.String> getLexemeSet()
Returns all lexemes

Returns:
lexemes

getLexemeSet

public java.util.Set<java.lang.String> getLexemeSet(java.lang.String pos)
Returns set of lexemes of chosen part of speech

Parameters:
pos - part of speech
Returns:
lexemes

getSubsensesList

public java.util.List<java.lang.String> getSubsensesList(java.lang.String lexeme)
Returns list of subsense ids of given lexeme

Parameters:
lexeme -
Returns:
list of subsense ids

getSenseWeight

public double getSenseWeight(java.lang.String lexeme,
                             java.lang.String subsenseId)
Get the RARE value for given subsense of a lexeme

Parameters:
lexeme -
subsenseId -
Returns:
result

getCountForSubsense

public int getCountForSubsense(java.lang.String lexeme,
                               java.lang.String subsenseId)
Returns number of annotations with particular subsense

Parameters:
lexeme - chosen lexeme
subsenseId - subsense of this lexeme
Returns:
number

getMfsForLexeme

public double getMfsForLexeme(java.lang.String lexeme)
Returns MFS accuracy for a lexeme

Parameters:
lexeme -
Returns:
mfs accuracy

getSortedMfs

public java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Double>> getSortedMfs()
Returns list of pairs : , sorted from lowest mfs

Returns:
list

getSortedMfs

public java.util.List<java.util.Map.Entry<java.lang.String,java.lang.Double>> getSortedMfs(java.lang.String pos)
Returns list of pairs : , sorted from lowest mfs (and filtered for only chosen part of speech).

Parameters:
pos - part of speech
Returns:
list

getTotalRandomAccuracy

public java.lang.Double getTotalRandomAccuracy(java.lang.String pos)
Gets random accuracy for this annotation and given part of speech

Parameters:
pos - part of speech
Returns:
random accuracy

getTotalMFSAccuracy

public java.lang.Double getTotalMFSAccuracy(java.lang.String pos)
Calculates MFS accuracy for given annotation and part of speech

Parameters:
pos - part of speech
Returns:
mfs accuracy