Package org.apache.uima.collection

Examples of org.apache.uima.collection.CollectionReader


  public static void main(String[] args) throws Exception {
    List<File> files = Lists.newArrayList();
    for (String path : args) {
      files.add(new File(path));
    }
    CollectionReader reader = UriCollectionReader.getCollectionReaderFromFiles(files);
    AnalysisEngine engine = AnalysisEngineFactory.createPrimitive(THYMEAnaforaXMLReader.class);
    SimplePipeline.runPipeline(reader, engine);
  }
View Full Code Here


        samplePosFileName = "src/org/apache/uima/fit/examples/pos/sample-gold.txt";
    }

    // The lineReader simply copies the lines from the input file into the
    // default view - one line per CAS
    CollectionReader lineReader = CollectionReaderFactory.createReader(LineReader.class,
            LineReader.PARAM_INPUT_FILE, samplePosFileName);

    AggregateBuilder builder = new AggregateBuilder();

    // The goldTagger parses the data in the default view into Token objects
View Full Code Here

              + "in classloader");
    }
    File collectionReaderDescriptor = new File(filename);
    CollectionReaderDescription collectionReaderDescription = UIMAFramework.getXMLParser()
            .parseCollectionReaderDescription(new XMLInputSource(collectionReaderDescriptor));
    CollectionReader collectionReader = UIMAFramework
            .produceCollectionReader(collectionReaderDescription);
    eeUimaEngine.setCollectionReader(collectionReader);
    initialize(eeUimaEngine, appCtx);
    waitUntilInitialized();
    runCrTest(eeUimaEngine, 7);
View Full Code Here

    // add Collection Reader if specified
    if (collectionReaderDescriptor != null) {
      CollectionReaderDescription collectionReaderDescription = UIMAFramework.getXMLParser()
              .parseCollectionReaderDescription(new XMLInputSource(collectionReaderDescriptor));

      CollectionReader collectionReader = UIMAFramework
              .produceCollectionReader(collectionReaderDescription);

      uimaEEEngine.setCollectionReader(collectionReader);
    }
    uimaEEEngine.addStatusCallbackListener(new StatusCallbackListenerImpl());
View Full Code Here

   
    List<Integer> patientSets = options.getPatients().getList();
    List<Integer> trainItems = THYMEData.getTrainPatientSets(patientSets);
    List<File> files = THYMEData.getFilesFor(trainItems, options.getRawTextDirectory());

    CollectionReader reader = UriCollectionReader.getCollectionReaderFromFiles(files);
    AggregateBuilder aggregateBuilder = new AggregateBuilder();
    aggregateBuilder.add(UriToDocumentTextAnnotator.getDescription());
    aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(
        XMIReader.class,
        XMIReader.PARAM_XMI_DIRECTORY,
View Full Code Here

    Options options = CliFactory.parseArguments(Options.class, args);
    List<Integer> patientSets = options.getPatients().getList();
    List<Integer> trainItems = THYMEData.getTrainPatientSets(patientSets);
    List<File> files = THYMEData.getFilesFor(trainItems, options.getRawTextDirectory());

    CollectionReader reader = UriCollectionReader.getCollectionReaderFromFiles(files);
    AggregateBuilder aggregateBuilder = new AggregateBuilder();
    aggregateBuilder.add(UriToDocumentTextAnnotator.getDescription());
    aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(
        XMIReader.class,
        XMIReader.PARAM_XMI_DIRECTORY,
View Full Code Here

    Options options = CliFactory.parseArguments(Options.class, args);
   
    List<Integer> patientSets = options.getPatients().getList();
    List<Integer> trainItems = THYMEData.getTrainPatientSets(patientSets);
    List<File> trainFiles = Utils.getFilesFor(trainItems, options.getInputDirectory());
    CollectionReader collectionReader = Utils.getCollectionReader(trainFiles);
   
    AnalysisEngine annotationConsumer = AnalysisEngineFactory.createPrimitive(
        RelationContextPrinter.class);
       
    SimplePipeline.runPipeline(collectionReader, annotationConsumer);
View Full Code Here

    List<Integer> patientSets = options.getPatients().getList();
    List<Integer> trainItems = THYMEData.getTrainPatientSets(patientSets);
    //List<Integer> devItems = THYMEData.getDevPatientSets(patientSets);
    //List<Integer> testItems = THYMEData.getTestPatientSets(patientSets);

    CollectionReader reader = UriCollectionReader.getCollectionReaderFromFiles(THYMEData.getFilesFor(trainItems, options.getRawTextDirectory()));
    AggregateBuilder aggregateBuilder = new AggregateBuilder();
    aggregateBuilder.add(UriToDocumentTextAnnotator.getDescription());
    aggregateBuilder.add(AnalysisEngineFactory.createPrimitiveDescription(
        XMIReader.class,
        XMIReader.PARAM_XMI_DIRECTORY,
View Full Code Here

  public static void main(String[] args) throws Exception {
   
    Options options = CliFactory.parseArguments(Options.class, args);

    List<File> trainFiles = Arrays.asList(options.getInputDirectory().listFiles());
    CollectionReader collectionReader = getCollectionReader(trainFiles);
   
    AnalysisEngine annotationConsumer = AnalysisEngineFactory.createPrimitive(
        EventAndTokenContextWriter.class,
        "TokenOutputFile",
        options.getTokenOutputFile(),
View Full Code Here

    Options options = CliFactory.parseArguments(Options.class, args);
   
    List<Integer> patientSets = options.getPatients().getList();
    List<Integer> trainItems = THYMEData.getTrainPatientSets(patientSets);
    List<File> trainFiles = getFilesFor(trainItems, options.getInputDirectory());
    CollectionReader collectionReader = getCollectionReader(trainFiles);
   
    AnalysisEngine annotationConsumer = AnalysisEngineFactory.createPrimitive(
        RelationContextPrinter.class,
        "OutputFile",
        options.getOutputFile());
View Full Code Here

TOP

Related Classes of org.apache.uima.collection.CollectionReader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.