Package org.apache.uima.collection

Examples of org.apache.uima.collection.CollectionReader


    return engine;
  }

  public static CollectionReader getFractureDemoCollectionReader()
      throws ResourceInitializationException {
    CollectionReader colReader = CollectionReaderFactory
        .createCollectionReader(
            DBCollectionReader.class,
            "queryGetDocumentKeys",
            String.format(queryGetDocumentKeys,
                DBUtil.getYTEXTablePrefix(),
View Full Code Here


  public static void main(String[] args) throws Exception {

    Options options = CliFactory.parseArguments(Options.class, args);

    List<File> files = Arrays.asList(options.getInputDirectory().listFiles());
    CollectionReader collectionReader = getCollectionReader(files);

    AnalysisEngine annotationConsumer = AnalysisEngineFactory.createPrimitive(
        ProcessRelations.class,
        "EventOutputFile",
        options.getEventOutputFile());
View Full Code Here

      // create a collection reader that loads URIs for all Knowtator text files
      List<File> files = Lists.newArrayList();
      files.addAll(getTrainTextFiles(options.getBatchesDirectory()));
      files.addAll(getDevTextFiles(options.getBatchesDirectory()));
      files.addAll(getTestTextFiles(options.getBatchesDirectory()));
      CollectionReader reader = UriCollectionReader.getCollectionReaderFromFiles(files);

      // load the text from the URI, run the preprocessor, then run the
      // Knowtator XML reader
      AggregateBuilder builder = new AggregateBuilder();
      builder.add(UriToDocumentTextAnnotator.getDescription());
View Full Code Here

//      TypeSystemDescriptionFactory.createTypeSystemDescriptionFromPath("../common-type-system/desc/common_type_system.xml",
//                                       "../assertion/desc/medfactsTypeSystem.xml");

    AnalysisEngine ae = AnalysisEngineFactory.createAnalysisEngineFromPath("desc/analysis_engine/ODIESvmVectorCreator.xml");

    CollectionReader reader = CollectionReaderFactory.createCollectionReaderFromPath(
        "../ctakes-core/desc/collection_reader/FilesInDirectoryCollectionReader.xml",
        FilesInDirectoryCollectionReader.PARAM_INPUTDIR,
        inputRoot);

    AnalysisEngine serializer = AnalysisEngineFactory.createPrimitive(
View Full Code Here

      String[] paths = new String[trainFiles.size()];
      for (int i = 0; i < paths.length; ++i) {
        paths[i] = trainFiles.get(i).getPath();
      }
      CollectionReader reader = CollectionReaderFactory.createCollectionReader(
              XMIReader.class,
              XMIReader.PARAM_FILES,
              paths);
        
      JCasIterable casIter = new JCasIterable(reader);
View Full Code Here

    String[] paths = new String[trainFiles.size()];
    for (int i = 0; i < paths.length; ++i) {
      paths[i] = trainFiles.get(i).getPath();
    }
    CollectionReader reader = CollectionReaderFactory.createCollectionReader(
            XMIReader.class,
            XMIReader.PARAM_FILES,
            paths);
      
    JCasIterable casIter = new JCasIterable(reader);
View Full Code Here

  @Test
  public void TestCDASegmentPipeLine() throws Exception {
    TypeSystemDescription typeSystem = TypeSystemDescriptionFactory
        .createTypeSystemDescription();

    CollectionReader reader = CollectionReaderFactory
        .createCollectionReader(FilesCollectionReader.class,
            typeSystem, FilesCollectionReader.PARAM_ROOT_FILE,
            INPUT_FILE);

    AnalysisEngine sectionAnnotator = AnalysisEngineFactory
View Full Code Here

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

    CollectionReader collectionReader = CollectionReaderFactory.createCollectionReaderFromPath(
        "../ctakes-core/desc/collection_reader/FilesInDirectoryCollectionReader.xml",
        FilesInDirectoryCollectionReader.PARAM_INPUTDIR,
        options.getInputDirectory());

    AggregateBuilder aggregateBuilder = getPreprocessorAggregateBuilder();
View Full Code Here

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

    CollectionReader collectionReader = CollectionReaderFactory.createCollectionReaderFromPath(
        "../ctakes-core/desc/collection_reader/FilesInDirectoryCollectionReader.xml",
        FilesInDirectoryCollectionReader.PARAM_INPUTDIR,
        options.getInputDirectory());

    AggregateBuilder aggregateBuilder = getPreprocessorAggregateBuilder();
View Full Code Here

      } else {
        testFiles = Arrays.asList(options.testDirectory.listFiles());
      }
     
      if (!options.testOnly && !options.evalOnly) {
        CollectionReader trainCollectionReader = evaluation.getCollectionReader(trainFiles);
        evaluation.train(trainCollectionReader, modelsDir);
      }
     
      // run testing
      if (!options.trainOnly) {
        if (testFiles==null || testFiles.size()==0) {
          throw new RuntimeException("testFiles = " + testFiles + " testFiles.size() = " + (testFiles==null ? "null": testFiles.size())) ;
        }
        logger.debug("testFiles.size() = " + testFiles.size());
        CollectionReader testCollectionReader = evaluation.getCollectionReader(testFiles);
        Map<String, AnnotationStatisticsCompact> stats = evaluation.test(testCollectionReader, modelsDir);

        AssertionEvaluation.printScore(stats,  modelsDir!=null? modelsDir.getAbsolutePath() : "no_model");
      }
    }
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.