try {
reportOutputStream = new FileOutputStream(reportFile);
reportListener = new POSTaggerFineGrainedReportListener(
reportOutputStream);
} catch (FileNotFoundException e) {
throw new TerminateToolException(-1,
"IO error while creating POS Tagger fine-grained report file: "
+ e.getMessage());
}
}
POSTaggerCrossValidator validator;
try {
validator = new POSTaggerCrossValidator(params.getLang(), mlParams,
params.getDict(), params.getNgram(), params.getTagDictCutoff(),
params.getFactory(), missclassifiedListener, reportListener);
validator.evaluate(sampleStream, params.getFolds());
} catch (IOException e) {
throw new TerminateToolException(-1, "IO error while reading training data or indexing data: "
+ e.getMessage(), e);
} finally {
try {
sampleStream.close();
} catch (IOException e) {