public class CorpusBenchmarkTool extends Object
Constructor and Description |
---|
CorpusBenchmarkTool() |
Modifier and Type | Method and Description |
---|---|
protected String |
avgPrint(double value,
int count) |
protected void |
calculateAvgTotal() |
protected int |
countWords(Document annotDoc)
Count all Token.kind=word annotations in the document
|
protected void |
evaluateAllThree(Document persDoc,
Document cleanDoc,
Document markedDoc,
File errDir) |
protected void |
evaluateCorpus(File fileDir,
File processedDir,
File markedDir,
File errorDir) |
protected void |
evaluateDocuments(Document persDoc,
Document cleanDoc,
Document markedDoc,
File errDir) |
protected void |
evaluateMarkedClean(File markedDir,
File cleanDir,
File errDir) |
protected void |
evaluateMarkedStored(File markedDir,
File storedDir,
File errDir) |
protected void |
evaluateTwoDocs(Document keyDoc,
Document respDoc,
File errDir) |
void |
execute() |
void |
execute(File dir) |
protected void |
generateCorpus(File fileDir,
File outputDir) |
Set<String> |
getDiffFeaturesList() |
double |
getFMeasureAverage() |
double |
getFmeasureAverageCalc() |
double |
getFMeasureAverageProc() |
boolean |
getGenerateMode() |
boolean |
getMarkedClean() |
boolean |
getMarkedDS() |
boolean |
getMarkedStored() |
boolean |
getMoreInfo() |
double |
getPrecisionAverage()
Returns the average precision over the entire set of processed documents.
|
double |
getPrecisionAverageCalc() |
double |
getPrecisionAverageProc()
For processed documents
|
double |
getRecallAverage()
Returns the average recall over the entire set of processed documents.
|
double |
getRecallAverageCalc() |
double |
getRecallAverageProc() |
File |
getStartDirectory() |
double |
getThreshold() |
boolean |
getVerboseMode() |
void |
init() |
void |
initPRs() |
boolean |
isGenerateMode() |
static void |
main(String[] args) |
protected AnnotationDiffer |
measureDocs(Document keyDoc,
Document respDoc,
String annotType) |
protected void |
printAnnotations(AnnotationDiffer annotDiff,
Document keyDoc,
Document respDoc) |
protected void |
printAnnotations(Set<Annotation> set,
Document doc) |
void |
printStatistics() |
protected void |
printStatsForType(String annotType) |
protected void |
printTableHeader() |
protected void |
processDocument(Document doc) |
void |
setApplicationFile(File newAppFile) |
void |
setDiffFeaturesList(Set<String> features) |
void |
setGenerateMode(boolean mode) |
void |
setMarkedClean(boolean mode) |
void |
setMarkedDS(boolean mode) |
void |
setMarkedStored(boolean mode) |
void |
setMoreInfo(boolean mode) |
void |
setStartDirectory(File dir) |
void |
setThreshold(double newValue) |
void |
setVerboseMode(boolean mode) |
protected void |
storeAnnotations(String type,
AnnotationDiffer annotDiffer,
Document keyDoc,
Document respDoc,
Writer errFileWriter) |
protected void |
storeAnnotations(String type,
Set<Annotation> set,
Document doc,
Writer file) |
void |
unloadPRs() |
protected void |
updateStatistics(AnnotationDiffer annotDiffer,
String annotType) |
protected void |
updateStatisticsProc(AnnotationDiffer annotDiffer,
String annotType)
Update statistics for processed documents
The same procedure as updateStatistics with different hashTables
|
public void initPRs()
public void unloadPRs()
public void execute()
public void init()
public void execute(File dir)
public static void main(String[] args) throws GateException
GateException
public void setGenerateMode(boolean mode)
public boolean getGenerateMode()
public boolean getVerboseMode()
public void setVerboseMode(boolean mode)
public void setMoreInfo(boolean mode)
public boolean getMoreInfo()
public void setMarkedStored(boolean mode)
public boolean getMarkedStored()
public void setMarkedClean(boolean mode)
public boolean getMarkedClean()
public void setMarkedDS(boolean mode)
public boolean getMarkedDS()
public void setApplicationFile(File newAppFile)
public double getPrecisionAverage()
If the tool has been evaluating the original documents against the previously-stored automatically annotated ones, then the precision will be the average precision on those two sets.
If the tool was run in -marked mode, i.e., was evaluating the stored automatically processed ones against the human-annotated ones, then the precision will be the average precision on those two sets of documents.
public double getRecallAverage()
If the tool has been evaluating the original documents against the previously-stored automatically annotated ones, then the recall will be the average recall on those two sets.
If the tool was run in -marked mode, i.e., was evaluating the stored automatically processed ones against the human-annotated ones, then the recall will be the average recall on those two sets of documents.
public double getFMeasureAverage()
public double getPrecisionAverageProc()
public double getRecallAverageProc()
public double getFMeasureAverageProc()
public boolean isGenerateMode()
public double getThreshold()
public void setThreshold(double newValue)
public File getStartDirectory()
public void setStartDirectory(File dir)
protected void evaluateCorpus(File fileDir, File processedDir, File markedDir, File errorDir)
protected void evaluateMarkedStored(File markedDir, File storedDir, File errDir)
protected void processDocument(Document doc)
protected void evaluateDocuments(Document persDoc, Document cleanDoc, Document markedDoc, File errDir) throws ResourceInstantiationException
ResourceInstantiationException
protected int countWords(Document annotDoc)
protected void evaluateAllThree(Document persDoc, Document cleanDoc, Document markedDoc, File errDir) throws ResourceInstantiationException
ResourceInstantiationException
protected void evaluateTwoDocs(Document keyDoc, Document respDoc, File errDir) throws ResourceInstantiationException
ResourceInstantiationException
protected void printTableHeader()
protected void updateStatistics(AnnotationDiffer annotDiffer, String annotType)
protected void updateStatisticsProc(AnnotationDiffer annotDiffer, String annotType)
public void printStatistics()
protected void printStatsForType(String annotType)
protected String avgPrint(double value, int count)
public double getPrecisionAverageCalc()
public double getRecallAverageCalc()
public double getFmeasureAverageCalc()
protected void calculateAvgTotal()
protected AnnotationDiffer measureDocs(Document keyDoc, Document respDoc, String annotType) throws ResourceInstantiationException
ResourceInstantiationException
protected void storeAnnotations(String type, AnnotationDiffer annotDiffer, Document keyDoc, Document respDoc, Writer errFileWriter)
protected void storeAnnotations(String type, Set<Annotation> set, Document doc, Writer file) throws IOException
IOException
protected void printAnnotations(AnnotationDiffer annotDiff, Document keyDoc, Document respDoc)
protected void printAnnotations(Set<Annotation> set, Document doc)
Copyright © 2024 GATE. All rights reserved.