public class SentenceEvaluation extends Object
SentenceEvaluation stores and reports the results of
evaluating a set of reference sentence chunkings and response
sentence chunkings. Evaluation results are available through the
method chunkingEvaluation(), which returns the evaluation
of the sentences as chunkings, and the method endBoundaryEvaluation(), which returns the evaluation of the
sentences chunkings solely on the basis of the end boundary index of the sentence.| Constructor and Description |
|---|
SentenceEvaluation()
Construct a sentence evaluation.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCase(Chunking referenceChunking,
Chunking responseChunking)
Add the case corresponding to the specified reference and
response chunkings.
|
ChunkingEvaluation |
chunkingEvaluation()
Return the chunking evaluation for this sentence evaluation.
|
PrecisionRecallEvaluation |
endBoundaryEvaluation()
Returns a precision/recall evaluation based on the end
boundaries in the reference and response cases.
|
Set<ChunkAndCharSeq> |
falseNegativeEndBoundaries()
Return the set of chunks and character sequences whose end
boundaries are in reference but not the response chunking.
|
Set<ChunkAndCharSeq> |
falsePositiveEndBoundaries()
Return the set of chunks and character sequences whose end
boundaries are in response but not the reference chunking.
|
String |
lastCaseToString(int lineLength)
Returns a formatted listing for the last case that was
evaluated, showing the underlying character sequence for the
chunkings, annotated with the sentence boundaries from the
reference and response chunking, with linebreaks inserted every
lineLength characters.
|
static String |
sentenceCaseToString(Chunking referenceChunking,
Chunking responseChunking,
int lineLength)
Given a pair of reference and response chunkings, returns a
string showing the underlying character sequence
chunking pair, annotated with the
sentence boundaries from each chunking, with linebreaks
inserted every lineLength characters.
|
Set<ChunkAndCharSeq> |
truePositiveEndBoundaries()
Return the set of chunks and character sequences whose end
boundaries are in both the reference and response.
|
public void addCase(Chunking referenceChunking, Chunking responseChunking)
SentenceChunker.SENTENCE_CHUNK_TYPE.referenceChunking - The reference chunking.responseChunking - The response chunking.IllegalArgumentException - If the reference chunking and
response chunking are not over the same characters or if either
contains chunks of type other than
SentenceChunker.SENTENCE_CHUNK_TYPE.public ChunkingEvaluation chunkingEvaluation()
public PrecisionRecallEvaluation endBoundaryEvaluation()
public Set<ChunkAndCharSeq> truePositiveEndBoundaries()
public Set<ChunkAndCharSeq> falsePositiveEndBoundaries()
public Set<ChunkAndCharSeq> falseNegativeEndBoundaries()
public String lastCaseToString(int lineLength)
lineLength - The line length of the formatted string.IllegalArgumentException - If the lineLength is < 1.IllegalStateException - If no cases have been evaluated.public static String sentenceCaseToString(Chunking referenceChunking, Chunking responseChunking, int lineLength)
SentenceChunker.SENTENCE_CHUNK_TYPE. The lineLength must be a
positive integer.referenceChunking - The reference chunking.responseChunking - The response chunking.lineLength - The line length of the formatted string.IllegalArgumentException - If the reference chunking and
response chunking are not over the same characters or if either
contains chunks of type other than
SentenceChunker.SENTENCE_CHUNK_TYPE, or if the
lineLength is < 1.Copyright © 2019 Alias-i, Inc.. All rights reserved.