@Test public void testPipeline() throws UIMAException, IOException { String note = "The patient is a 55-year-old man referred by Dr. Good for recently diagnosed colorectal cancer. " + "The patient was well till 6 months ago, when he started having a little blood with stool."; JCas jcas = JCasFactory.createJCas(); jcas.setDocumentText(note); AggregateBuilder builder = new AggregateBuilder(); builder.add(getTokenProcessingPipeline()); builder.add(AnalysisEngineFactory .createEngineDescription(CopyNPChunksToLookupWindowAnnotations.class)); builder.add(AnalysisEngineFactory .createEngineDescription(RemoveEnclosedLookupWindows.class)); builder.add(ClearNLPDependencyParserAE.createAnnotatorDescription()); builder.add(BackwardsTimeAnnotator .createAnnotatorDescription("/org/apache/ctakes/temporal/ae/timeannotator/model.jar")); builder.add(EventAnnotator .createAnnotatorDescription("/org/apache/ctakes/temporal/ae/eventannotator/model.jar")); builder.add(AnalysisEngineFactory.createEngineDescription(AddEvent.class)); builder.add(EventEventRelationAnnotator .createAnnotatorDescription("/org/apache/ctakes/temporal/ae/eventevent/model.jar")); SimplePipeline.runPipeline(jcas, builder.createAggregateDescription()); Collection<TemporalTextRelation> relations = JCasUtil.select(jcas, TemporalTextRelation.class); for (TemporalTextRelation relation : relations) { LOGGER.info("Relation: " + relation.getArg1() + " " + relation.getArg2() + " Category: " + relation.getCategory()); } }
public static AnalysisEngineDescription createAnnotatorDescription(String modelPath) throws ResourceInitializationException { return AnalysisEngineFactory.createEngineDescription( EventEventRelationAnnotator.class, CleartkAnnotator.PARAM_IS_TRAINING, false, GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH, modelPath); }
EventEventRelationAnnotator extends TemporalRelationExtractorAnnotator { public static AnalysisEngineDescription createAnnotatorDescription(String modelPath) throws ResourceInitializationException { return AnalysisEngineFactory.createEngineDescription( EventEventRelationAnnotator.class, CleartkAnnotator.PARAM_IS_TRAINING, false, GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH, modelPath); } }
EventEventRelationAnnotator extends TemporalRelationExtractorAnnotator { public static AnalysisEngineDescription createAnnotatorDescription(String modelPath) throws ResourceInitializationException { return AnalysisEngineFactory.createEngineDescription( EventEventRelationAnnotator.class, CleartkAnnotator.PARAM_IS_TRAINING, false, GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH, modelPath); }  }
EventEventRelationAnnotator extends TemporalRelationExtractorAnnotator { public static AnalysisEngineDescription createAnnotatorDescription(String modelPath) throws ResourceInitializationException { return AnalysisEngineFactory.createEngineDescription( EventEventRelationAnnotator.class, CleartkAnnotator.PARAM_IS_TRAINING, false, GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH, modelPath); }  static AnalysisEngineDescription createDataWriterDescription(
			Class<? extends DataWriter<String>> dataWriterClass,
					File outputDirectory,
					double probabilityOfKeepingANegativeExample); static AnalysisEngineDescription createAnnotatorDescription(String modelPath); @SuppressWarnings("dep-ann") static AnalysisEngineDescription createAnnotatorDescription(File modelDirectory); @Override void initialize( final UimaContext context ); }
EventEventRelationAnnotator extends TemporalRelationExtractorAnnotator { public static AnalysisEngineDescription createAnnotatorDescription(String modelPath) throws ResourceInitializationException { return AnalysisEngineFactory.createEngineDescription( EventEventRelationAnnotator.class, CleartkAnnotator.PARAM_IS_TRAINING, false, GenericJarClassifierFactory.PARAM_CLASSIFIER_JAR_PATH, modelPath); }  static AnalysisEngineDescription createDataWriterDescription(
			Class<? extends DataWriter<String>> dataWriterClass,
					File outputDirectory,
					double probabilityOfKeepingANegativeExample); static AnalysisEngineDescription createAnnotatorDescription(String modelPath); @SuppressWarnings("dep-ann") static AnalysisEngineDescription createAnnotatorDescription(File modelDirectory); @Override void initialize( final UimaContext context );  }