Examples of CleartkExtractor


Examples of org.cleartk.classifier.feature.extractor.CleartkExtractor

    //        );
    this.tokenFeatureExtractors = new ArrayList<SimpleFeatureExtractor>();
    this.tokenFeatureExtractors.add(allExtractors);

    this.contextFeatureExtractors = new ArrayList<CleartkExtractor>();
    this.contextFeatureExtractors.add(new CleartkExtractor(
        BaseToken.class,
        allExtractors,
        new Preceding(3),
        new Following(3)));
    //    this.parseFeatureExtractors = new ArrayList<ParseSpanFeatureExtractor>();
View Full Code Here

Examples of org.cleartk.classifier.feature.extractor.CleartkExtractor

//        );
    this.tokenFeatureExtractors = new ArrayList<SimpleFeatureExtractor>();
    this.tokenFeatureExtractors.add(allExtractors);

    this.contextFeatureExtractors = new ArrayList<CleartkExtractor>();
    this.contextFeatureExtractors.add(new CleartkExtractor(
        BaseToken.class,
        allExtractors,
        new Preceding(3),
        new Following(3)));
//    this.parseFeatureExtractors = new ArrayList<ParseSpanFeatureExtractor>();
View Full Code Here

Examples of org.cleartk.classifier.feature.extractor.CleartkExtractor

  public void initialize(UimaContext context) throws ResourceInitializationException {
    super.initialize(context);
    CombinedExtractor baseExtractor = new CombinedExtractor(
        new CoveredTextExtractor(),
        new TypePathExtractor(BaseToken.class, "partOfSpeech"));
    this.contextExtractor = new CleartkExtractor(
        BaseToken.class,
        baseExtractor,
        new Preceding(3),
        new Covered(),
        new Following(3));
View Full Code Here

Examples of org.cleartk.classifier.feature.extractor.CleartkExtractor

  public void initialize(UimaContext context) throws ResourceInitializationException {
    super.initialize(context);
    CombinedExtractor baseExtractor = new CombinedExtractor(
        new CoveredTextExtractor(),
        new TypePathExtractor(BaseToken.class, "partOfSpeech"));
    this.contextExtractor = new CleartkExtractor(
        BaseToken.class,
        baseExtractor,
        new Preceding(3),
        new Covered(),
        new Following(3));
View Full Code Here

Examples of org.cleartk.classifier.feature.extractor.CleartkExtractor

    super.initialize(context);
    CombinedExtractor baseExtractor = new CombinedExtractor(
        new CoveredTextExtractor(),
        new TypePathExtractor(BaseToken.class, "partOfSpeech"));

    this.contextExtractor = new CleartkExtractor(
        BaseToken.class,
        baseExtractor,
        new Preceding(3),
        new Covered(),
        new Following(3));
View Full Code Here

Examples of org.cleartk.classifier.feature.extractor.CleartkExtractor

           new TypePathExtractor(AssertionCuePhraseAnnotation.class, "cuePhrase"),
           new TypePathExtractor(AssertionCuePhraseAnnotation.class, "cuePhraseCategory"),
           new TypePathExtractor(AssertionCuePhraseAnnotation.class, "cuePhraseAssertionFamily")
          );
   
    CleartkExtractor cuePhraseInWindowExtractor =
        new CleartkExtractor(
              AssertionCuePhraseAnnotation.class,
              baseExtractorCuePhraseCategory,
              new CleartkExtractor.Bag(new CleartkExtractor.Preceding(5)),
              new CleartkExtractor.Bag(new CleartkExtractor.Following(5))
              );
//              new CleartkExtractor.Ngram(new CleartkExtractor.Preceding(5), new CleartkExtractor.Following(5)));
              //new CoveredTextExtractor(),
//              new CleartkExtractor.Covered());
//              new CleartkExtractor.Preceding(5),
//              new CleartkExtractor.Following(5));
   
    CleartkExtractor tokenExtraction1 =
        new CleartkExtractor(
            BaseToken.class,
            new CoveredTextExtractor(),
            //new CleartkExtractor.Covered(),
            new CleartkExtractor.LastCovered(2),
            new CleartkExtractor.Preceding(5),
            new CleartkExtractor.Following(4),
            new CleartkExtractor.Bag(new CleartkExtractor.Preceding(10)),
            new CleartkExtractor.Bag(new CleartkExtractor.Following(10))
            );
   
    CleartkExtractor posExtraction1 =
        new CleartkExtractor(
            BaseToken.class,
            new TypePathExtractor(BaseToken.class, "partOfSpeech"),
            new CleartkExtractor.LastCovered(2),
            new CleartkExtractor.Preceding(3),
            new CleartkExtractor.Following(2)
View Full Code Here

Examples of org.cleartk.classifier.feature.extractor.CleartkExtractor

           new TypePathExtractor(AssertionCuePhraseAnnotation.class, "cuePhrase"),
           new TypePathExtractor(AssertionCuePhraseAnnotation.class, "cuePhraseCategory"),
           new TypePathExtractor(AssertionCuePhraseAnnotation.class, "cuePhraseAssertionFamily")
          );
   
    CleartkExtractor cuePhraseInWindowExtractor =
        new CleartkExtractor(
              AssertionCuePhraseAnnotation.class,
              baseExtractorCuePhraseCategory,
              new CleartkExtractor.Bag(new CleartkExtractor.Preceding(5)),
              new CleartkExtractor.Bag(new CleartkExtractor.Following(5))
              );
//              new CleartkExtractor.Ngram(new CleartkExtractor.Preceding(5), new CleartkExtractor.Following(5)));
              //new CoveredTextExtractor(),
//              new CleartkExtractor.Covered());
//              new CleartkExtractor.Preceding(5),
//              new CleartkExtractor.Following(5));
   
    List<CleartkExtractor> extractorList = new ArrayList<CleartkExtractor>();
    extractorList.add(cuePhraseInWindowExtractor);
   
    //NamingExtractor cuePhraseInWindowNamingExtractor = new NamingExtractor("cuePhraseCategory__", cuePhraseInWindowExtractor);

    Collection<IdentifiedAnnotation> identifiedAnnotations = JCasUtil.select(jcas,  IdentifiedAnnotation.class);
    for (IdentifiedAnnotation current : identifiedAnnotations)
    {
      if (!(current instanceof EntityMention) && !(current instanceof EventMention)) continue;
     
      // otherwise current is an entity or event mention...
      logger.info(String.format("identified annotation (event or entity) [%d-%d] \"%s\" [%s]", current.getBegin(), current.getEnd(), current.getCoveredText(), current.getClass().getName()));
     
      Collection<Sentence> coveringSentences = entityToSentenceMap.get(current);
      if (coveringSentences == null || coveringSentences.isEmpty())
      {
        logger.info("no covering sentences found!!! continuing with next entity/event...");
        continue;
      }
      logger.info(String.format("covering sentence count: %d", coveringSentences.size()));
      Sentence firstCoveringSentence = coveringSentences.iterator().next();
     
      logger.info(String.format(
          "first covering sentence: [%d-%d] \"%s\" (%s)",
          firstCoveringSentence.getBegin(), firstCoveringSentence.getEnd(),
          firstCoveringSentence.getCoveredText(),
          firstCoveringSentence.getClass().getName()));
     
      List<Feature> cuePhraseFeatures =
          //cuePhraseInSentenceExtractor.extract(jcas, firstCoveringSentence);
          cuePhraseInWindowExtractor.extractWithin(jcas, current, firstCoveringSentence);
          //cuePhraseInWindowNamingExtractor.extract(jcas, current);
      if (cuePhraseFeatures != null && !cuePhraseFeatures.isEmpty())
      {
        String featureDebugString = (cuePhraseFeatures == null) ? "(no cue phrase features)" : cuePhraseFeatures.toString();
        logger.info("### cue phrase features: " + featureDebugString);
View Full Code Here

Examples of org.cleartk.classifier.feature.extractor.CleartkExtractor

//        );
    this.tokenFeatureExtractors = new ArrayList<SimpleFeatureExtractor>();
    this.tokenFeatureExtractors.add(allExtractors);

    this.contextFeatureExtractors = new ArrayList<CleartkExtractor>();
    this.contextFeatureExtractors.add(new CleartkExtractor(
        BaseToken.class,
        allExtractors,
        new Preceding(2),
        new Following(2)));
//    this.parseFeatureExtractors = new ArrayList<ParseSpanFeatureExtractor>();
View Full Code Here

Examples of org.cleartk.classifier.feature.extractor.CleartkExtractor

  public void initialize(UimaContext context) throws ResourceInitializationException {
    super.initialize(context);
    CombinedExtractor baseExtractor = new CombinedExtractor(
        new CoveredTextExtractor(),
        new TypePathExtractor(BaseToken.class, "partOfSpeech"));
    this.contextExtractor = new CleartkExtractor(
        BaseToken.class,
        baseExtractor,
        new Preceding(3),
        new Covered(),
        new Following(3));
View Full Code Here

Examples of org.cleartk.classifier.feature.extractor.CleartkExtractor

    this.tokenFeatureExtractor = new CombinedExtractor(
        new CoveredTextExtractor(),
        new CharacterCategoryPatternExtractor(PatternType.ONE_PER_CHAR),
        new TypePathExtractor(BaseToken.class, "partOfSpeech"));
    this.contextFeatureExtractor = new CleartkExtractor(
        BaseToken.class,
        this.tokenFeatureExtractor,
        new Preceding(3),
        new Following(3));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.