@Override
protected void train(CollectionReader collectionReader, File directory) throws Exception {
// if(this.baseline) return;
if(this.skipTrain) return;
AggregateBuilder aggregateBuilder = this.getPreprocessorAggregateBuilder();
aggregateBuilder.add(CopyFromGold.getDescription(EventMention.class, TimeMention.class, BinaryTextRelation.class));
aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(RemoveCrossSentenceRelations.class));
if(!this.useGoldAttributes){
aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(RemoveGoldAttributes.class));
}
if (this.useClosure) {
aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(AddClosure.class));//aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(AddTransitiveContainsRelations.class));
// aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(AddContain2Overlap.class));
// aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(AddTransitiveBeforeAndOnRelations.class));
}
// aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(RemoveNonContainsRelations.class));
aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(AddFlippedOverlap.class));//add flipped overlap instances to training data
aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(RemoveEventEventRelations.class));
aggregateBuilder.add(EventTimeRelationAnnotator.createDataWriterDescription(
// LIBSVMStringOutcomeDataWriter.class,
TKSVMlightStringOutcomeDataWriter.class,
// TKLIBSVMStringOutcomeDataWriter.class,
// SVMlightStringOutcomeDataWriter.class,
directory,
params.probabilityOfKeepingANegativeExample));
SimplePipeline.runPipeline(collectionReader, aggregateBuilder.createAggregate());
String[] optArray;
if(this.kernelParams == null){
ArrayList<String> svmOptions = new ArrayList<String>();
svmOptions.add("-c"); svmOptions.add(""+params.svmCost); // svm cost