use of edu.illinois.cs.cogcomp.lbjava.classify.TestDiscrete in project cogcomp-nlp by CogComp.
the class NETesterMultiDataset method printAllTestResultsAsOneDataset.
/**
* assumes that the data has been annotated by both levels of taggers
*/
public static TestDiscrete[] printAllTestResultsAsOneDataset(Vector<Data> dataCollection, boolean verbose, ParametersForLbjCode params) {
TestDiscrete resultsPhraseLevel1 = new TestDiscrete();
resultsPhraseLevel1.addNull("O");
TestDiscrete resultsTokenLevel1 = new TestDiscrete();
resultsTokenLevel1.addNull("O");
TestDiscrete resultsPhraseLevel2 = new TestDiscrete();
resultsPhraseLevel2.addNull("O");
TestDiscrete resultsTokenLevel2 = new TestDiscrete();
resultsTokenLevel2.addNull("O");
TestDiscrete resultsByBILOU = new TestDiscrete();
TestDiscrete resultsSegmentation = new TestDiscrete();
resultsByBILOU.addNull("O");
resultsSegmentation.addNull("O");
for (int dataSetId = 0; dataSetId < dataCollection.size(); dataSetId++) reportPredictions(dataCollection.elementAt(dataSetId), resultsTokenLevel1, resultsTokenLevel2, resultsPhraseLevel1, resultsPhraseLevel2, resultsByBILOU, resultsSegmentation);
System.out.println("------------------------------------------------------------");
System.out.println("****** Combined performance on all the datasets :");
for (int i = 0; i < dataCollection.size(); i++) System.out.println("\t>>> Dataset path : \t" + dataCollection.elementAt(i).datasetPath);
System.out.println("------------------------------------------------------------");
if (verbose) {
if (params.featuresToUse.containsKey("PredictionsLevel1")) {
System.out.println("Phrase-level Acc Level2:");
resultsPhraseLevel2.printPerformance(System.out);
System.out.println("Token-level Acc Level2:");
resultsTokenLevel2.printPerformance(System.out);
System.out.println("Level2 BILOU Accuracy, letter-by-letter:");
resultsByBILOU.printPerformance(System.out);
System.out.println("Level2 BILOU PHRASE/BOUNDARY DETECTION Accuracy");
resultsSegmentation.printPerformance(System.out);
}
System.out.println("Phrase-level Acc Level1:");
resultsPhraseLevel1.printPerformance(System.out);
System.out.println("Token-level Acc Level1:");
resultsTokenLevel1.printPerformance(System.out);
} else {
System.out.println("\t Level 1: " + resultsPhraseLevel1.getOverallStats()[2]);
if (params.featuresToUse.containsKey("PredictionsLevel1"))
System.out.println("\t Level 2: " + resultsPhraseLevel2.getOverallStats()[2]);
}
System.out.println("------------------------------------------------------------");
System.out.println("************************************************************");
System.out.println("------------------------------------------------------------");
return new TestDiscrete[] { resultsPhraseLevel1, resultsPhraseLevel2 };
}
Aggregations