|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jmwe.harness.result.MWEResult<T,S>
T
- the type of tokens contained in the unit and its associated
multi-word expressions.S
- the type of sentence whose results are stored. Is parameterized by
tokens of type T.public class MWEResult<T extends IToken,S extends IMarkedSentence<T>>
Default implementation of IOverallResult
interface. Contains the
overall precision and recall scores with and without partial credit. All of
the data stored in this result is organized by part of speech.
Constructor Summary | |
---|---|
MWEResult(Map<MWEPOS,Integer> answer,
Map<MWEPOS,Integer> found,
Map<MWEPOS,Integer> correct,
Map<MWEPOS,Double> partial,
Map<String,ISentenceResult<T,S>> detailed)
Constructs the result from the answer, found and correct data, and the precision, recall and partial credit scores. |
Method Summary | |
---|---|
static double |
calcF1Score(double precision,
double recall)
Calculates the f1 score. |
protected double |
calcPartialPrecision(MWEPOS pos)
Calculates the precision over the specified part of speech, taking into account partial credit for the specified MWE part of speech. |
protected double |
calcPartialRecall(MWEPOS pos)
Calculates the recall over the specified part of speech, taking into account partial credit for the specified MWE part of speech. |
static double |
calcPrecision(double correctlyRetrieved,
double totalRetrieved)
Given the total number of MWEs retrieved and the number of MWEs that are correct, calculates precision. |
protected double |
calcPrecision(MWEPOS pos)
Calculates the precision over the specified parts of speech, or all parts of speech if the specified part of speech is null |
static double |
calcRecall(double correctlyRetrieved,
double totalAnswers)
Given the total number of answer MWEs and the number of MWEs that are correct, calculates recall. |
protected double |
calcRecall(MWEPOS pos)
Calculates the recall over the specified parts of speech, or all parts of speech if the specified part of speech is null |
Map<MWEPOS,Integer> |
getAnswerData()
Returns a map that stores the number of answer multi-word expressions for each part of speech. |
Map<MWEPOS,Integer> |
getCorrectData()
Returns a map that stores the number of multi-word expressions correctly found by the detector for each part of speech. |
Map<String,ISentenceResult<T,S>> |
getDetails()
Returns a map that stores the results for a unit under its ID. |
Map<MWEPOS,Double> |
getF1Scores()
Returns a map that stores the f1 measures of the detector for each part of speech. |
Map<MWEPOS,Integer> |
getFoundData()
Returns a map that stores the number of multi-word expressions found by the detector for each part of speech. |
double |
getFScore()
Returns the F1 score, a double between zero and 1, inclusive. |
double |
getPartialF1Score()
Returns the total F score earned by the detector, taking into account partial credit. |
Map<MWEPOS,Double> |
getPartialF1Scores()
Returns a map that stores the f1 measure of the detector for each part of speech after adding the partial credit to its correct score. |
double |
getPartialPrecision()
Returns the total precision of the detector after counting partial credit. |
Map<MWEPOS,Double> |
getPartialPrecisionScores()
Returns a map that stores the precision of the detector for each part of speech after adding the partial credit to its correct score. |
double |
getPartialRecall()
Returns the total recall of the detector after counting partial credit. |
Map<MWEPOS,Double> |
getPartialRecallScores()
Returns a map that stores the recall of the detector for each part of speech after adding the partial credit to its correct score. |
double |
getPartialScore()
Returns the total partial credit earned by the detector. |
Map<MWEPOS,Double> |
getPartialScores()
Returns a map that stores the partial credit for the partially correct multi-word expressions found by the detector for each part of speech. |
double |
getPrecision()
Returns the precision, a double between zero and 1, inclusive. |
Map<MWEPOS,Double> |
getPrecisionScores()
Returns a map that stores the precision of the detector for each part of speech. |
double |
getRecall()
Returns the recall, a double between zero and 1, inclusive. |
Map<MWEPOS,Double> |
getRecallScores()
Returns a map that stores the recall of the detector for each part of speech. |
int |
getTotalAnswers()
Returns the total number of answers. |
int |
getTotalCorrect()
Returns the total number of items correctly identified. |
int |
getTotalFound()
Returns the total number items found. |
static double |
sumDbl(Iterable<? extends Double> m)
Return the sum of all the values stored in the map. |
static int |
sumInt(Iterable<? extends Integer> m)
Return the sum of all the values stored in the map. |
String |
toString()
|
static String |
toString(IOverallResult<?,?> result)
Creates a table displaying the number of answer, found and correct multi-word expressions and the precision, recall and partial credit scores of the detector for each part of speech. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MWEResult(Map<MWEPOS,Integer> answer, Map<MWEPOS,Integer> found, Map<MWEPOS,Integer> correct, Map<MWEPOS,Double> partial, Map<String,ISentenceResult<T,S>> detailed)
ISentenceResult
objects for a unit under its ID.
answer
- a map that stores the number of answer multi-word expressions
for each part of speech.found
- a map that stores the number of multi-word expressions found
by the detector for each part of speech.correct
- a map that stores the number of multi-word expressions
correctly found by the detector for each part of speech.partial
- a map that stores the partial credit for the partially correct
multi-word expressions found by the detector for each part of
speech.detailed
- a map that stores the results for a unit under its ID.Method Detail |
---|
public double getPrecision()
IBaseResult
getPrecision
in interface IBaseResult
public double getRecall()
IBaseResult
getRecall
in interface IBaseResult
public Map<MWEPOS,Double> getPrecisionScores()
IOverallResult
null
.
getPrecisionScores
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public Map<MWEPOS,Double> getRecallScores()
IOverallResult
null
.
getRecallScores
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public Map<MWEPOS,Double> getF1Scores()
IOverallResult
null
.
getF1Scores
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public int getTotalAnswers()
IBaseResult
getTotalAnswers
in interface IBaseResult
public int getTotalCorrect()
IBaseResult
getTotalCorrect
in interface IBaseResult
public int getTotalFound()
IBaseResult
getTotalFound
in interface IBaseResult
public Map<MWEPOS,Integer> getAnswerData()
IOverallResult
null
.
getAnswerData
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public Map<MWEPOS,Integer> getFoundData()
IOverallResult
null
.
getFoundData
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public Map<MWEPOS,Integer> getCorrectData()
IOverallResult
null
.
getCorrectData
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public double getPartialPrecision()
IOverallResult
getPartialPrecision
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public double getPartialRecall()
IOverallResult
getPartialRecall
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public Map<MWEPOS,Double> getPartialScores()
IOverallResult
null
.
getPartialScores
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public Map<MWEPOS,Double> getPartialPrecisionScores()
IOverallResult
null
.
getPartialPrecisionScores
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public Map<MWEPOS,Double> getPartialRecallScores()
IOverallResult
null
.
getPartialRecallScores
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public Map<MWEPOS,Double> getPartialF1Scores()
IOverallResult
null
.
getPartialF1Scores
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public double getPartialScore()
IOverallResult
getPartialScore
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public double getFScore()
IBaseResult
getFScore
in interface IBaseResult
public double getPartialF1Score()
IOverallResult
getPartialF1Score
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public Map<String,ISentenceResult<T,S>> getDetails()
IOverallResult
null
.
getDetails
in interface IOverallResult<T extends IToken,S extends IMarkedSentence<T>>
public String toString()
toString
in class Object
protected double calcPrecision(MWEPOS pos)
null
pos
- the part of speech over which the precision is to be calculated;
null
means all parts of speech
protected double calcRecall(MWEPOS pos)
null
pos
- the part of speech over which the recall is to be calculated;
null
means all parts of speech
protected double calcPartialPrecision(MWEPOS pos)
pos
- the MWE pos for which the precision should be calculated; or
null
if for all
protected double calcPartialRecall(MWEPOS pos)
pos
- the MWE pos for which the recall should be calculated; or
null
if for all
public static String toString(IOverallResult<?,?> result)
result
- a non-null IResult
public static double calcPrecision(double correctlyRetrieved, double totalRetrieved)
Double.NaN
if the
number of correct MWEs is greater than 0 and there are no found MWEs,
since this is undefined. Will return 1.0, a perfect score, if both the
number of found MWEs and correct MWEs are 0 or if both numbers are equal.
correctlyRetrieved
- the number of MWEs that are correctly identifiedtotalRetrieved
- the number of MWEs retrieved
Double.NaN
if the number of
correct MWEs is greater than 0 and there are no found MWEs. Will
return 1.0, a perfect score, if both the number of found MWEs and
correct MWEs are 0 or if both numbers are equal.public static double calcRecall(double correctlyRetrieved, double totalAnswers)
Double.NaN
if the number
of correct MWEs is greater than 0 and there are no answer MWEs,
since this is undefined. Will return 1.0, a perfect score, if both the
number of answer MWEs and correct MWEs are 0 or if both numbers are
equal.
correctlyRetrieved
- the number of MWEs that are correctly identifiedtotalAnswers
- the total number of answer MWEs
Double.NaN
if the number of
correct MWEs is greater than 0 and there are no answer MWEs.
Will return 1.0, a perfect score, if both the number of answer
MWEs and correct MWEs are 0 or if both numbers are equal.public static double calcF1Score(double precision, double recall)
Double.NaN
.
precision
- the precision. Must be a non-negative double less than 1.0.recall
- the recall. Must be a non-negative double less than 1.0.
Double.NaN
if either the
precision or recall is undefined; otherwise, will be a
nonnegative double between 0.0 and 1.0.public static int sumInt(Iterable<? extends Integer> m)
m
- the map whose values are to be summed
public static double sumDbl(Iterable<? extends Double> m)
m
- the map whose values are to be summed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |