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) {
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 (ParametersForLbjCode.currentParameters.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 (ParametersForLbjCode.currentParameters.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 };
}
use of edu.illinois.cs.cogcomp.lbjava.classify.TestDiscrete in project cogcomp-nlp by CogComp.
the class TestPOS method main.
/**
* Implements the program described above.
*
* @param args The command line parameters.
**/
public static void main(String[] args) {
// Parse the command line
// if (args.length != 1) {
// logger.error("usage: java edu.illinois.cs.cogcomp.lbj.pos.TestPOS <text file>");
// System.exit(1);
// }
// String testingFile = args[0];
ResourceManager rm = new POSConfigurator().getDefaultConfig();
String testingFile = rm.getString("testData");
TestDiscrete.testDiscrete(new TestDiscrete(), new POSTagger(), new POSLabel(), new POSBracketToToken(testingFile), true, 0);
}
Aggregations