|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.eval.Mistake
public class Mistake
Each instance of this class describe a mistake. They are used by the
MistakeAnalyzer
.
Nested Class Summary | |
---|---|
static class |
Mistake.MistakeTypes
The types of mistakes that can occur. |
Field Summary | |
---|---|
static String |
CONFUSION_SEPARATOR
Used in the confusion matrix to separated the (expected) answer key type from the actually encountered prediction type: " -> " (starts and ends with a space). |
Constructor Summary | |
---|---|
Mistake(Extraction myAnswerKey,
Extraction myPrediction,
SortedSet<Mistake.MistakeTypes> myMistakes,
String mySource)
Creates a new instance. |
Method Summary | |
---|---|
static String |
confusionType(Extraction ansKey,
Extraction pred)
Returns a string representing the the confusion between the types of an answer key. |
static String |
flatten(SortedSet<Mistake.MistakeTypes> mistakeSet)
Flattens a set of mistake types into a string. |
Extraction |
getAnswerKey()
Returns the answer key involved in the mistake. |
SortedSet<Mistake.MistakeTypes> |
getMistakes()
Returns the set of the mistake types that occurred. |
Extraction |
getPrediction()
Returns prediction involved in the mistake. |
String |
getSource()
Returns the source document where this mistake occurred. |
String |
toString()
Returns a string representation of this object comprising 2 or 3 lines. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String CONFUSION_SEPARATOR
Constructor Detail |
---|
public Mistake(Extraction myAnswerKey, Extraction myPrediction, SortedSet<Mistake.MistakeTypes> myMistakes, String mySource)
myAnswerKey
or myPrediction
might be null
, but not both --
if myMistakes
contains a "WrongType" mistake, neither
may be null.
myAnswerKey
- the answer key involved in the mistake
(might be null
)myPrediction
- the prediction involved in the mistake
(might be null
myMistakes
- a set of the mistake types that occurredmySource
- the
source
document where this mistake occurredMethod Detail |
---|
public static String flatten(SortedSet<Mistake.MistakeTypes> mistakeSet)
mistakeSet
- the set of mistake types to flatten
public static String confusionType(Extraction ansKey, Extraction pred)
CONFUSION_SEPARATOR
.
ansKey
- the answer keypred
- the prediction
public Extraction getAnswerKey()
null
)public SortedSet<Mistake.MistakeTypes> getMistakes()
public Extraction getPrediction()
null
)public String getSource()
public String toString()
flattened
set of mistakes, followed by a space and the
confusionType(Extraction, Extraction)
if a
Mistake.MistakeTypes.WrongType
mistake occurred. The following line(s)
contain the answer key
(prefixed by "Answer: ")
and the prediction
(prefixed by "Prediction: ")
if they are present (either of them must always be present, but not
necessarily both). Answer keys and predictions are followed by their
number of tokens in paranthesis (e.g. "(5 tokens)" or "(1 token)").
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |