//Set up the segmentation
Segmentation segmentation = factory.constructSegmentation();
//Create a labeling controller
LabelingController labelingController = new LabelingController();
//Provide implementations of the needed processes
factory.configureLabeling(labelingController);
//Process the input messages
MessageSet messages = this.loadMessages(options.inputCSVFile);
FeatureSpecification spec = this.loadFeatureSpecification(options.inputFeatureSpecFile);
Model model = this.loadModel(options.inputModelFile);
SegmentSet segments = segmentation.segment(messages);
//Run the labeling process
labelingController.setModel(model);
labelingController.setSegmentSet(segments);
labelingController.setFeatureSpecification(spec);
labelingController.run();
//Get the outputs
EvaluationReport evalReport = labelingController.getEvaluationReport();
System.out.println("== Saving Output ==");
saveEvaluationReport(evalReport, options.outputEvaluationReportFile);
if (options.makeROC) {
ROC roc = evalReport.getROCs().get(0);
saveROC(roc, options.outputROCFile);
}
if (options.outputFeatureValues) {
Instances featureValues = labelingController.getFeatureValues();
saveInstances(featureValues, options.outputFeatureValuesFile);
}
saveMessages(messages, options.outputCSVFile);