|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.aliasi.chunk.ChunkerEvaluator
public class ChunkerEvaluator
The ChunkerEvaulator class provides an evaluation
framework for chunkers. An instance of this class is constructed
based on the chunker to be evaluated. This class implements the
ChunkHandler interface in order to receive reference
chunkings. Reference chunkings may be added directly using the
handle(Chunking) or by passing this handler to an
appropriate parser. Either way, the sequence is extracted from the
reference chunking, the contained chunker is used to generate
a response chunking, and then the reference and response chunkings
are added to a contained ChunkingEvaluation which maintains
a running score. The method evaluation() returns the
contained chunking evaluation, which may be inspected for partial
results at any time.
| Constructor Summary | |
|---|---|
ChunkerEvaluator(Chunker chunker)
Construct an evaluator for the specified chunker. |
|
| Method Summary | |
|---|---|
ScoredPrecisionRecallEvaluation |
confidenceEvaluation()
Returns the scored precision-recall evaluation derived from a confidence-based chunker. |
ChunkingEvaluation |
evaluation()
Return the first-best chunking evaluation. |
void |
handle(Chunking referenceChunking)
Handle the specified reference chunking. |
void |
handle(String[] tokens,
String[] whitespaces,
String[] tags)
Handle the specified reference chunking encoded in the standard BIO tag chunking format. |
String |
lastConfidenceCaseReport()
Returns a string-based representation of the last evaluation case's confidence evaluation. |
String |
lastFirstBestCaseReport()
Returns a string-based representation of the last evaluation case and the first-best result. |
String |
lastNBestCaseReport()
Returns a string-based representation of the last n-best evaluation case. |
ObjectToCounterMap<Integer> |
nBestEvaluation()
Returns the n-best evaluation in the form of a mapping from ranks to the number of times the reference chunking was that rank in the evaluation. |
void |
setMaxConfidenceChunks(int n)
Sets the maximum number of chunks extracted by a confidence-based chunker for evaluation. |
void |
setMaxNBest(int n)
Sets the maximum number of chunkings extracted by an n-best chunker for evaluation. |
void |
setMaxNBestReport(int n)
Sets the maximum number of chunkings that will be reported in a case report. |
void |
setVerbose(boolean isVerbose)
Sets the verbosity level of this evaluator to the specified value. |
String |
toString()
Returns a string-based representation of this evaluation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ChunkerEvaluator(Chunker chunker)
chunker - Chunker to evaluate.| Method Detail |
|---|
public void setVerbose(boolean isVerbose)
true, calls to handle(Chunking) will print (to System.out) a report
for each chunking evaluation (first-best, n-best and
confidence).
The reports that are written are also available as strings
programmatically through the methods lastNBestCaseReport(), and
lastConfidenceCaseReport(),
isVerbose - true for standard output per
case.public String lastFirstBestCaseReport()
public void setMaxConfidenceChunks(int n)
n - Number of chunks to extract with confidence.public String lastConfidenceCaseReport()
null.
public void setMaxNBest(int n)
n - Number of chunkings to evaluate in n-best chunking.public void setMaxNBestReport(int n)
lastNBestCaseReport() method.
n - Number of n-best results to print in a case report.public String lastNBestCaseReport()
public void handle(String[] tokens,
String[] whitespaces,
String[] tags)
null,
a single space character is used to separate tokens.
See handle(Chunking) for
more information.
handle in interface TagHandlertokens - Array of tokens.whitespaces - Array of whitespaces.tags - Array of tags.public void handle(Chunking referenceChunking)
If the contained chunker returns null for
a given input, this method will fill in a chunking over
the appropriate sequence with no chunks for evaluation.
handle in interface ChunkHandlerhandle in interface ObjectHandler<Chunking>referenceChunking - The reference chunking case.public ScoredPrecisionRecallEvaluation confidenceEvaluation()
This is the actual evaluation used by this class, so changing it will affect this class's results.
public ChunkingEvaluation evaluation()
This is the actual evaluation used by this class, so changing it will affect this class's results.
public ObjectToCounterMap<Integer> nBestEvaluation()
Integer, with -1 being the rank
assigned to cases in which the reference chunking was not
among the n-best results.
This is the actual counter used by this class, so changing it will affect this class's results.
If the chunker being evaluated is not an n-best chunker, then this evaluation will be empty.
public String toString()
toString in class Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||