Examples of AssertionCuePhraseAnnotation


Examples of org.apache.ctakes.typesystem.type.temporary.assertion.AssertionCuePhraseAnnotation

    }
  }

  private void addCuePhrase(JCas jCas, String key, int begin, int end){
    CuePhrase cueWord = cueWords.get(key);
    AssertionCuePhraseAnnotation cuePhraseAnnotation = new AssertionCuePhraseAnnotation(jCas);
    cuePhraseAnnotation.setBegin(begin);
    cuePhraseAnnotation.setEnd(end);

    cuePhraseAnnotation.setCuePhrase(key);

    cuePhraseAnnotation.setCuePhraseCategory(cueWord.category);
    cuePhraseAnnotation.setCuePhraseAssertionFamily(cueWord.family);

    cuePhraseAnnotation.addToIndexes();
   
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.temporary.assertion.AssertionCuePhraseAnnotation

      List<Sentence> sents = new ArrayList<Sentence>(JCasUtil.selectCovering(jCas, Sentence.class, entityOrEventMention.getBegin(), entityOrEventMention.getEnd()));
      if(sents.size() > 0){
        Sentence sentence = sents.get(0);
        List<AssertionCuePhraseAnnotation> cues = JCasUtil.selectCovered(AssertionCuePhraseAnnotation.class, sentence);
        int closest = Integer.MAX_VALUE;
        AssertionCuePhraseAnnotation closestCue = null;
        for(AssertionCuePhraseAnnotation cue : cues){
          List<BaseToken> tokens = JCasUtil.selectBetween(BaseToken.class, cue, entityOrEventMention);
          if(tokens.size() < closest){
            closestCue = cue;
            closest = tokens.size();
          }
//          instance.addAll(cuePhraseInWindowExtractor.extractBetween(jCas, cue, entityOrEventMention));
        }
        if(closestCue != null && closest < 21){
          instance.add(new Feature("ClosestCue_Word", closestCue.getCoveredText()));
//          instance.add(new Feature("ClosestCue_Phrase", closestCue.getCuePhrase()));
          instance.add(new Feature("ClosestCue_PhraseFamily", closestCue.getCuePhraseAssertionFamily()));
          instance.add(new Feature("ClosestCue_PhraseCategory", closestCue.getCuePhraseCategory()));
         
          // add hack-ey domain adaptation to these hacked-in features
          if (!fileToDomain.isEmpty() && ffDomainAdaptor!=null) {
            instance.addAll(ffDomainAdaptor.apply(new Feature("ClosestCue_Word", closestCue.getCoveredText())));
            instance.addAll(ffDomainAdaptor.apply(new Feature("ClosestCue_PhraseFamily", closestCue.getCuePhraseAssertionFamily())));
              instance.addAll(ffDomainAdaptor.apply(new Feature("ClosestCue_PhraseCategory", closestCue.getCuePhraseCategory())));
          }
         
        }
      }
//      if (cuePhraseFeatures != null && !cuePhraseFeatures.isEmpty())
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.temporary.assertion.AssertionCuePhraseAnnotation

      List<Sentence> sents = new ArrayList<Sentence>(JCasUtil.selectCovering(jCas, Sentence.class, entityOrEventMention.getBegin(), entityOrEventMention.getEnd()));
      if(sents.size() > 0){
        Sentence sentence = sents.get(0);
        List<AssertionCuePhraseAnnotation> cues = JCasUtil.selectCovered(AssertionCuePhraseAnnotation.class, sentence);
        int closest = Integer.MAX_VALUE;
        AssertionCuePhraseAnnotation closestCue = null;
        for(AssertionCuePhraseAnnotation cue : cues){
          List<BaseToken> tokens = JCasUtil.selectBetween(BaseToken.class, cue, entityOrEventMention);
          if(tokens.size() < closest){
            closestCue = cue;
            closest = tokens.size();
          }
//          instance.addAll(cuePhraseInWindowExtractor.extractBetween(jCas, cue, entityOrEventMention));
        }
        if(closestCue != null && closest < 21){
          instance.add(new Feature("ClosestCue_Word", closestCue.getCoveredText()));
//          instance.add(new Feature("ClosestCue_Phrase", closestCue.getCuePhrase()));
          instance.add(new Feature("ClosestCue_PhraseFamily", closestCue.getCuePhraseAssertionFamily()));
          instance.add(new Feature("ClosestCue_PhraseCategory", closestCue.getCuePhraseCategory()));
        }
      }
//      if (cuePhraseFeatures != null && !cuePhraseFeatures.isEmpty())
//      {
//        instance.addAll(cuePhraseFeatures);
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.temporary.assertion.AssertionCuePhraseAnnotation

    }
  }

  private void addCuePhrase(JCas jCas, String key, int begin, int end){
    CuePhrase cueWord = cueWords.get(key);
    AssertionCuePhraseAnnotation cuePhraseAnnotation = new AssertionCuePhraseAnnotation(jCas);
    cuePhraseAnnotation.setBegin(begin);
    cuePhraseAnnotation.setEnd(end);

    cuePhraseAnnotation.setCuePhrase(key);

    cuePhraseAnnotation.setCuePhraseCategory(cueWord.category);
    cuePhraseAnnotation.setCuePhraseAssertionFamily(cueWord.family);

    cuePhraseAnnotation.addToIndexes();
   
  }
View Full Code Here

Examples of org.apache.ctakes.typesystem.type.temporary.assertion.AssertionCuePhraseAnnotation

//        else
//        {
//          iv_logger.warn("Filtered out: "+text);
//        }

        AssertionCuePhraseAnnotation cuePhraseAnnotation = new AssertionCuePhraseAnnotation(jcas);
        cuePhraseAnnotation.setBegin(neBegin);
        cuePhraseAnnotation.setEnd(neEnd);
       
        cuePhraseAnnotation.setCuePhrase(cuePhrase);
        cuePhraseAnnotation.setCuePhraseFirstWord(cuePhraseFirstWord);
       
        cuePhraseAnnotation.setCuePhraseCategory(cuePhraseCategory);
        cuePhraseAnnotation.setCuePhraseAssertionFamily(cuePhraseFamily);
       
        cuePhraseAnnotation.addToIndexes();

      }
     

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.