Package org.apache.uima.fit.factory

Examples of org.apache.uima.fit.factory.AggregateBuilder


    ruta.getAnalysisEngineMetaData()
            .getTypeSystem()
            .addType("org.apache.uima.T1", "Type for Testing", "uima.tcas.Annotation");

    final AggregateBuilder builder = new AggregateBuilder();
    builder.add(ruta, "_InitialView", "text");

    return builder.createAggregate();
  }
View Full Code Here


    // This resource is shared between the UimaAcronymAnnotator and UimaMeetingAnnotator
    ExternalResourceDescription resource = createExternalResourceDescription(
            StringMapResource_impl.class,
            "file:src/main/resources/org/apache/uima/fit/examples/tutorial/ex6/uimaAcronyms.txt");

    AggregateBuilder builder = new AggregateBuilder();
    builder.add(createEngineDescription(UimaAcronymAnnotator.class,
            UimaAcronymAnnotator.RES_ACRONYM_TABLE, resource));
    builder.add(createEngineDescription(UimaMeetingAnnotator.class,
            UimaMeetingAnnotator.RES_UIMA_TERM_TABLE, resource));
    AnalysisEngine engine = createEngine(builder.createAggregateDescription());

    JCas jCas = engine.newJCas();
    jCas.setDocumentText("Let's meet to talk about the CPE. The meeting is over at Yorktown 01-144");
    new Meeting(jCas, 0, 33).addToIndexes();
View Full Code Here

    ExternalResourceDescription resource = createExternalResourceDescription(
            StringMapResource_impl.class,
            "file:org/apache/uima/fit/examples/tutorial/ex6/uimaAcronyms.txt");

    AggregateBuilder builder = new AggregateBuilder();
    builder.add(createEngineDescription(UimaAcronymAnnotator.class,
            UimaAcronymAnnotator.RES_ACRONYM_TABLE, resource));
    builder.add(createEngineDescription(UimaMeetingAnnotator.class,
            UimaMeetingAnnotator.RES_UIMA_TERM_TABLE, resource));
    AnalysisEngineDescription aggregate = builder.createAggregateDescription();

    aggregate.toXML(new FileOutputStream(new File(outputDirectory, "UimaMeetingDetectorTAE.xml")));
  }
View Full Code Here

    // 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
    // along with their part-of-speech tags which will be added to the
    // GOLD_VIEW
    AnalysisEngineDescription goldTagger = AnalysisEngineFactory.createEngineDescription(
            GoldTagger.class);
    builder.add(goldTagger);

    // The textCopier creates the SYSTEM_VIEW and set the text of this view
    // to that of the text found in GOLD_VIEW
    AnalysisEngineDescription textCopier = AnalysisEngineFactory.createEngineDescription(
            ViewTextCopierAnnotator.class,
            ViewTextCopierAnnotator.PARAM_SOURCE_VIEW_NAME, ViewNames.GOLD_VIEW,
            ViewTextCopierAnnotator.PARAM_DESTINATION_VIEW_NAME, ViewNames.SYSTEM_VIEW);
    builder.add(textCopier);

    // The sentenceAndTokenCopier copies Token and Sentence annotations in
    // the GOLD_VIEW into the SYSTEM_VIEW
    AnalysisEngineDescription sentenceAndTokenCopier = AnalysisEngineFactory
            .createEngineDescription(SentenceAndTokenCopier.class);
    builder.add(sentenceAndTokenCopier, ViewNames.VIEW1, ViewNames.GOLD_VIEW, ViewNames.VIEW2,
            ViewNames.SYSTEM_VIEW);

    // The baselineTagger is run on the SYSTEM_VIEW
    AnalysisEngineDescription baselineTagger = AnalysisEngineFactory.createEngineDescription(
            BaselineTagger.class);
    builder.add(baselineTagger, CAS.NAME_DEFAULT_SOFA, ViewNames.SYSTEM_VIEW);

    // The evaluator will compare the part-of-speech tags in the SYSTEM_VIEW
    // with those in the GOLD_VIEW
    AnalysisEngineDescription evaluator = AnalysisEngineFactory.createEngineDescription(
            Evaluator.class);
    builder.add(evaluator);

    // The xWriter writes out the contents of each CAS (one per sentence) to
    // an XMI file. It is instructive to open one of these
    // XMI files in the CAS Visual Debugger and look at the contents of each
    // view.
    AnalysisEngineDescription xWriter = AnalysisEngineFactory.createEngineDescription(
            XmiWriter.class, XmiWriter.PARAM_OUTPUT_DIRECTORY, "target/examples/pos/xmi");
    builder.add(xWriter);

    // runs the collection reader and the aggregate AE.
    SimplePipeline.runPipeline(lineReader, builder.createAggregate());
  }
View Full Code Here

          PlainTextCombinationReader.PARAM_LANGUAGE, "en",
          PlainTextCombinationReader.PARAM_COMBINATION_STRATEGY, CombinationStrategy.SAME_ROW_ONLY.toString());
 
      AnalysisEngineDescription seg = createEngineDescription(
          BreakIteratorSegmenter.class);
      AggregateBuilder builder = new AggregateBuilder();
      builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_1);
      builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_2);
      AnalysisEngine aggr_seg = builder.createAggregate();
     
//      AnalysisEngineDescription tt = createPrimitiveDescription(
//          TreeTaggerPosLemmaTT4J.class,
//          TreeTaggerPosLemmaTT4J.PARAM_LANGUAGE_CODE, "en");   
//      builder = new AggregateBuilder();
View Full Code Here

            SemEvalCorpusReader.PARAM_COMBINATION_STRATEGY, CombinationStrategy.SAME_ROW_ONLY.toString());
   
        AnalysisEngineDescription seg = createEngineDescription(
            BreakIteratorSegmenter.class);
       
        AggregateBuilder builder = new AggregateBuilder();
        builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_1);
        builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_2);
        AnalysisEngine aggr_seg = builder.createAggregate();
       
//        AnalysisEngineDescription tt = createPrimitiveDescription(
//            TreeTaggerPosLemmaTT4J.class,
//            TreeTaggerPosLemmaTT4J.PARAM_LANGUAGE_CODE, "en");   
//        builder = new AggregateBuilder();
View Full Code Here

            SemEvalCorpusReader.PARAM_COMBINATION_STRATEGY, CombinationStrategy.SAME_ROW_ONLY.toString(), SemEvalCorpusReader.PARAM_LANGUAGE, "en");
   
        // Tokenization
        AnalysisEngineDescription seg = createEngineDescription(
            BreakIteratorSegmenter.class);
        AggregateBuilder builder = new AggregateBuilder();
        builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_1);
        builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_2);
        AnalysisEngine aggr_seg = builder.createAggregate();
       
        // POS Tagging
        AnalysisEngineDescription pos = createEngineDescription(
            OpenNlpPosTagger.class,
            OpenNlpPosTagger.PARAM_LANGUAGE, "en");   
        builder = new AggregateBuilder();
        builder.add(pos, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_1);
        builder.add(pos, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_2);
        AnalysisEngine aggr_pos = builder.createAggregate();
       
        // Lemmatization
        AnalysisEngineDescription lem = createEngineDescription(
//            StanfordLemmatizer.class);
            GateLemmatizer.class);
        builder = new AggregateBuilder();
        builder.add(lem, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_1);
        builder.add(lem, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_2);
        AnalysisEngine aggr_lem = builder.createAggregate();
       
        // Stopword Filter (if applicable)
        AnalysisEngineDescription stopw = createEngineDescription(
            StopwordFilter.class,
            StopwordFilter.PARAM_STOPWORD_LIST, "classpath:/stopwords/stopwords_english_punctuation.txt",
            StopwordFilter.PARAM_ANNOTATION_TYPE_NAME, Lemma.class.getName(),
            StopwordFilter.PARAM_STRING_REPRESENTATION_METHOD_NAME, "getValue");
        builder = new AggregateBuilder();
        builder.add(stopw, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_1);
        builder.add(stopw, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_2);
        AnalysisEngine aggr_stopw = builder.createAggregate();
   
        // Similarity Scorer
        AnalysisEngine scorer = createEngine(SimilarityScorer.class,
            SimilarityScorer.PARAM_NAME_VIEW_1, CombinationReader.VIEW_1,
            SimilarityScorer.PARAM_NAME_VIEW_2, CombinationReader.VIEW_2,
View Full Code Here

          SemEvalCorpusReader.PARAM_LANGUAGE, "en",
          SemEvalCorpusReader.PARAM_COMBINATION_STRATEGY, CombinationStrategy.SAME_ROW_ONLY.toString());
     
      AnalysisEngineDescription seg = createEngineDescription(BreakIteratorSegmenter.class);
     
      AggregateBuilder builder = new AggregateBuilder();
      builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_1);
      builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_2);
      AnalysisEngine aggr_seg = builder.createAggregate();
 
      AnalysisEngine scorer = createEngine(SimilarityScorer.class,
            SimilarityScorer.PARAM_NAME_VIEW_1, CombinationReader.VIEW_1,
            SimilarityScorer.PARAM_NAME_VIEW_2, CombinationReader.VIEW_2,
            SimilarityScorer.PARAM_SEGMENT_FEATURE_PATH, Document.class.getName(),
View Full Code Here

//        PlainTextCombinationReader.PARAM_INPUT_DIR, "classpath:/datasets/test/plaintext",
//        PlainTextCombinationReader.PARAM_COMBINATION_STRATEGY, CombinationStrategy.SAME_ROW_ONLY.toString());

    AnalysisEngineDescription seg = createEngineDescription(BreakIteratorSegmenter.class);
   
    AggregateBuilder builder = new AggregateBuilder();
    builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_1);
    builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_2);
    AnalysisEngine aggr_seg = builder.createAggregate();

    AnalysisEngine scorer = createEngine(SimilarityScorer.class,
          SimilarityScorer.PARAM_NAME_VIEW_1, CombinationReader.VIEW_1,
          SimilarityScorer.PARAM_NAME_VIEW_2, CombinationReader.VIEW_2,
          SimilarityScorer.PARAM_SEGMENT_FEATURE_PATH, Document.class.getName(),
View Full Code Here

            ShortAnswerGradingReader.PARAM_INPUT_DIR, "classpath:/datasets/mm09",
            ShortAnswerGradingReader.PARAM_COMBINATION_STRATEGY, CombinationStrategy.SAME_ROW_ONLY.toString());
   
        AnalysisEngineDescription seg = createEngineDescription(BreakIteratorSegmenter.class);
       
        AggregateBuilder builder = new AggregateBuilder();
        builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_1);
        builder.add(seg, CombinationReader.INITIAL_VIEW, CombinationReader.VIEW_2);
        AnalysisEngine aggr_seg = builder.createAggregate();
       
//        AnalysisEngineDescription tt = createPrimitiveDescription(
//            TreeTaggerPosLemmaTT4J.class,
//            TreeTaggerPosLemmaTT4J.PARAM_LANGUAGE_CODE, "en");   
//        builder = new AggregateBuilder();
View Full Code Here

TOP

Related Classes of org.apache.uima.fit.factory.AggregateBuilder

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.