|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--edu.stanford.nlp.ie.hmm.AnswerChecker
Utility class for checking whether words pulled from the HMM match the
errors created from an AnswerConstructor
.
Nested Class Summary | |
static class |
AnswerChecker.Range
Reprsents a range [from,to) (same semantics as substring). |
Constructor Summary | |
AnswerChecker(TypedTaggedDocument source)
Constructs a new AnswerChecker to check answers for the given TypedTaggedDocument. |
Method Summary | |
HashMap |
checkAnswers(int[] guesses,
boolean strict)
Returns a map from Integer (state type) -> PrecisionRecallStats for that state type. |
HashMap |
checkBestAnswers(Map bestGuessWordSequenceByType)
Takes a Map from Integer (type) -> List of Strings for best guess word sequence and returns a Map from type to PrecisionRecallStats for that state type. |
static HashMap |
getAnswerRanges(int[] answers)
Takes the given list of answer types and converts them into a map from type to a list of Ranges (start/end) indices. |
void |
printAnswers()
Prints answer word sequences for the correct answers for this document. |
void |
printAnswerWordSequences(int[] answers)
Prints the list of unique answers for each type determined by the given type sequence. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public AnswerChecker(TypedTaggedDocument source)
source.getTypeSequence()
.
Method Detail |
public static HashMap getAnswerRanges(int[] answers)
public HashMap checkBestAnswers(Map bestGuessWordSequenceByType)
public HashMap checkAnswers(int[] guesses, boolean strict)
HMM.getLabelsForSequence(int[])
).
If a state type is not in the map, it means no states of that
type were among the given given guesses or answers. If strict is false,
each unique answer need only be extracted once (i.e. slot-filling mode--if
the same answer appears in two places and is only extracted once, no false
negative is counted). If strict is true, every instance of every answer is
scored as either a true positive or a false negative.
public void printAnswers()
printAnswerWordSequences(int[])
public void printAnswerWordSequences(int[] answers)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |