Package org.apache.uima.fit.factory

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


          SemEvalCorpusReader.PARAM_INPUT_FILE, DATASET_DIR + "/test/STS.input." + dataset.toString() + ".txt",
          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


                   RTECorpusReader.PARAM_INPUT_FILE, RteUtil.getInputFilePathForDataset(DATASET_DIR, dataset));
   
        // 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(
            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_COMBINATION_STRATEGY, CombinationStrategy.SAME_ROW_ONLY.toString());
   
        // 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

    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

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.