Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.apache.ctakes.temporal.eval;
 
 import java.io.File;
 import java.util.List;
 
 import  org.cleartk.eval.AnnotationStatistics;
 import  org.cleartk.opennlp.tools.ParserAnnotator;
 import  org.cleartk.opennlp.tools.PosTaggerAnnotator;
 import  org.cleartk.opennlp.tools.SentenceAnnotator;
 import  org.cleartk.snowball.DefaultSnowballStemmer;
 import  org.cleartk.timeml.event.EventAnnotator;
 import  org.cleartk.timeml.type.Event;
 import  org.cleartk.token.tokenizer.TokenAnnotator;
 
 
 
   public static void main(String[] argsthrows Exception {
     Options options = CliFactory.parseArguments(Options.classargs);
     List<IntegerpatientSets = options.getPatients().getList();
     List<IntegertrainItems = getTrainItems(options);
     List<IntegertestItems = getTestItems(options);
     
         new File("target/eval/cleartk-event-spans"),
         options.getRawTextDirectory(),
         options.getXMLDirectory(),
         options.getXMLFormat(),
         options.getSubcorpus(),
         options.getXMIDirectory());
     evaluation.prepareXMIsFor(patientSets);
     evaluation.setLogging(.new File("target/eval/cleartk-event-errors.log"));
     AnnotationStatistics<Stringstats = evaluation.trainAndTest(trainItemstestItems);
     ..println(stats);
   }
 
       File baseDirectory,
       File rawTextDirectory,
       File xmlDirectory,
       XMLFormat xmlFormat,
       Subcorpus subcorpus,
       File xmiDirectory) {
     super(baseDirectoryrawTextDirectoryxmlDirectoryxmlFormatsubcorpusxmiDirectoryEventMention.class);
   }
 
   @Override
       throws ResourceInitializationException {
     // not training a model - just using the ClearTK one
     return AnalysisEngineFactory.createEngineDescription(NoOpAnnotator.class);
   }
 
   @Override
   protected void trainAndPackage(File directorythrows Exception {
     // not training a model - just using the ClearTK one
   }
 
   @Override
       throws ResourceInitializationException {
     AggregateBuilder aggregateBuilder = new AggregateBuilder();
     aggregateBuilder.add(SentenceAnnotator.getDescription());
     aggregateBuilder.add(TokenAnnotator.getDescription());
     aggregateBuilder.add(PosTaggerAnnotator.getDescription());
     aggregateBuilder.add(DefaultSnowballStemmer.getDescription("English"));
     aggregateBuilder.add(ParserAnnotator.getDescription());
     aggregateBuilder.add(EventAnnotator.FACTORY.getAnnotatorDescription());
    return aggregateBuilder.createAggregateDescription();
  }
  protected Collection<? extends AnnotationgetGoldAnnotations(JCas jCasSegment segment) {
    return selectExact(jCasEventMention.classsegment);
  }
  protected Collection<? extends AnnotationgetSystemAnnotations(JCas jCasSegment segment) {
    return JCasUtil.selectCovered(jCas, Event.classsegment);
  }
New to GrepCode? Check out our FAQ X