|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.mit.jmwe.harness.result.SentenceResult<T,S>
T
- the token typeS
- the sentence typepublic class SentenceResult<T extends IToken,S extends IMarkedSentence<T>>
Default implementation of the ISentenceResult
interface.
Constructor Summary | |
---|---|
SentenceResult(List<IMWE<T>> answer,
List<IMWE<T>> retrieved,
S sentence)
Constructs a sentence result from a list of answer multi-word expressions and a list of multi-word expressions found by the detector. |
|
SentenceResult(List<IMWE<T>> answer,
List<IMWE<T>> retrieved,
S sentence,
boolean reallocate)
Constructs a sentence result from a list of answer multi-word expressions and a list of multi-word expressions found by the detector. |
Method Summary | ||
---|---|---|
List<IMWE<T>> |
getAnswers()
Returns the answer multi-word expression in the sentence. |
|
List<IMWE<T>> |
getFalseNegatives()
Returns a list of the false negatives. |
|
List<IMWE<T>> |
getFalsePositives()
Returns a list of the false positives. |
|
List<IMWE<T>> |
getFound()
Returns the multi-word expression found by the detector in the sentence. |
|
double |
getFScore()
Returns the F1 score, a double between zero and 1, inclusive. |
|
double |
getPrecision()
Returns the precision, a double between zero and 1, inclusive. |
|
double |
getRecall()
Returns the recall, a double between zero and 1, inclusive. |
|
S |
getSentence()
Returns the sentence corresponding to this result. |
|
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. |
|
List<IMWE<T>> |
getTruePositives()
Returns a list of the true positives. |
|
static
|
printTable(StringBuilder sb,
ISentenceResult<T,S> result,
Formatter f)
Prints a table of the correct, false negative and false positive expressions found by the detector in columns. |
|
String |
toString()
|
|
static
|
toString(ISentenceResult<T,S> result,
S sentence,
boolean table)
Creates a graphical representation of the multi-word expressions found by the detector for a given sentence. |
|
static
|
toString(ISentenceResult<T,U> result,
U sentence)
Creates a graphical representation of the multi-word expressions found by the detector for a given sentence. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SentenceResult(List<IMWE<T>> answer, List<IMWE<T>> retrieved, S sentence)
answer
- a non-null list of answer multi-word expressions.retrieved
- a non-null list of multi-word expressions found by the
detector.
NullPointerException
- if either list is null
public SentenceResult(List<IMWE<T>> answer, List<IMWE<T>> retrieved, S sentence, boolean reallocate)
answer
- a non-null list of answer multi-word expressions.retrieved
- a non-null list of multi-word expressions found by the
detector.reallocate
- If true, will allocate new internal lists for the answer and
retrieved lists.
NullPointerException
- if either list is null
Method Detail |
---|
public S getSentence()
ISentenceResult
getSentence
in interface ISentenceResult<T extends IToken,S extends IMarkedSentence<T>>
public List<IMWE<T>> getFalseNegatives()
ISentenceResult
null
.
getFalseNegatives
in interface ISentenceResult<T extends IToken,S extends IMarkedSentence<T>>
null
.public List<IMWE<T>> getFalsePositives()
ISentenceResult
null
.
getFalsePositives
in interface ISentenceResult<T extends IToken,S extends IMarkedSentence<T>>
null
.public List<IMWE<T>> getTruePositives()
ISentenceResult
null
.
getTruePositives
in interface ISentenceResult<T extends IToken,S extends IMarkedSentence<T>>
null
.public List<IMWE<T>> getAnswers()
ISentenceResult
null
.
getAnswers
in interface ISentenceResult<T extends IToken,S extends IMarkedSentence<T>>
null
.public List<IMWE<T>> getFound()
ISentenceResult
null
.
getFound
in interface ISentenceResult<T extends IToken,S extends IMarkedSentence<T>>
null
.public double getPrecision()
IBaseResult
getPrecision
in interface IBaseResult
public double getRecall()
IBaseResult
getRecall
in interface IBaseResult
public double getFScore()
IBaseResult
getFScore
in interface IBaseResult
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 String toString()
toString
in class Object
public static <T extends IToken,U extends IMarkedSentence<T>> String toString(ISentenceResult<T,U> result, U sentence)
T
- the type of tokens in the sentence and its associated multi-word
expressionsU
- the type of sentence. Is parameterized by tokens of type T.result
- the sentence result obtained after running the detector over the
sentencesentence
- the sentence the detector is run over
public static <T extends IToken,S extends IMarkedSentence<T>> String toString(ISentenceResult<T,S> result, S sentence, boolean table)
T
- the type of tokens in the sentence and its associated multi-word
expressionsS
- the type of sentence. Is parameterized by tokens of type T.result
- the sentence result obtained after running the detector over the
sentencesentence
- the sentence the detector is run overtable
- if true, prints the correct, false negative, and false
positive expressions in columns under the sentence.
public static <T extends IToken,S extends IMarkedSentence<T>> void printTable(StringBuilder sb, ISentenceResult<T,S> result, Formatter f)
T
- the type of tokens in the sentence and its associated
multi-word expressionsS
- the type of sentence. Is parameterized by tokens of type T.sb
- the string builder to which the table should be writtenresult
- the result to be writtenf
- the formatter to be used
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |