Package org.cleartk.classifier

Examples of org.cleartk.classifier.Feature


        // features from previous classifications
        int nPreviousClassifications = 2;
        for (int i = nPreviousClassifications; i > 0; --i) {
          int index = tokenIndex - i;
          String previousOutcome = index < 0 ? "O" : outcomes.get(index);
          features.add(new Feature("PreviousOutcome_" + i, previousOutcome));
        }
        // features from dominating parse tree
//        for(SimpleFeatureExtractor extractor : this.parseFeatureExtractors){
        BaseToken startToken = token;
        for(int i = tokenIndex-1; i >= 0; --i){
View Full Code Here


  @Override
  public List<Feature> apply(@Nullable Feature input) {
    String featureName = Feature.createName(DEFAULT_NAME, input.getName());
    Object featureValue = input.getValue();
    if(featureValue instanceof String){
      return Collections.singletonList(new Feature(featureName, word2class.containsKey(featureValue) ? word2class.get(featureValue) : "NoCluster"));
    }
    return Collections.emptyList();
  }
View Full Code Here

  public List<Feature> extract(JCas view, Annotation focusAnnotation)
      throws CleartkExtractorException {
    List<Feature> featList = new ArrayList<Feature>();
   
    IdentifiedAnnotation mention = (IdentifiedAnnotation) focusAnnotation;
    featList.add(new Feature("IsNegated", mention.getPolarity() == CONST.NE_POLARITY_NEGATION_PRESENT));
    return featList;
  }
View Full Code Here

    List<Feature> features = new ArrayList<Feature>();
    SimpleTree tree = extractAboveRightConceptTree(jcas, annotation, sems);
   
    for(SimpleTree frag : frags){
      if(TreeUtils.containsIgnoreCase(tree, frag)){
        features.add(new Feature("TreeFrag_" + prefix, frag.toString()));
      }
    }
 
    return features;
  }
View Full Code Here

    List<Feature> feats = new ArrayList<Feature>();
    List<Sentence> sents = JCasUtil.selectCovering(jCas, Sentence.class, entity.getBegin(), entity.getEnd());
    if(sents!= null && sents.size() > 0){
      List<String> srlFeats = getEntityFeats(jCas, (IdentifiedAnnotation) entity, sents.get(0));
      for(String feat : srlFeats){
        feats.add(new Feature(feat));
      }
    }
    return feats;
  }
View Full Code Here

    List<Feature> features = new ArrayList<Feature>();
    SimpleTree tree = extractAboveLeftConceptTree(jcas, annotation, sems);
   
    for(SimpleTree frag : frags){
      if(TreeUtils.containsIgnoreCase(tree, frag)){
        features.add(new Feature("TreeFrag_" + prefix, frag.toString()));
      }
    }
 
    return features;
  }
View Full Code Here

    }
   
    ArrayList<Feature> featureList = new ArrayList<Feature>();
    for (Zone zone : zoneList)
    {
      Feature currentFeature = new Feature("zone", zone.getLabel());
      logger.info(String.format("zone: %s", zone.getLabel()));
      logger.info(String.format("zone feature: %s", currentFeature.toString()));
      featureList.add(currentFeature);
    }
   
    logger.debug("SurroundingExtractor.extract() END");
    return featureList;
View Full Code Here

        System.err.println("Tree is null!");
      }else{
        AssertionTreeUtils.replaceDependencyWordsWithSemanticClasses(tree, sems);
        for(SimpleTree frag : frags){
          if(TreeUtils.containsDepFragIgnoreCase(tree, frag)){
            features.add(new Feature("TreeFrag_" + prefix, frag.toString()));
          }
        }
      }

    }
View Full Code Here

       
        for(int componentNum = 0; componentNum < componentOutcomes.size(); componentNum++){
          String outcome = componentOutcomes.get(componentNum).get(tokenIndex);
          if(tokenIndex > 0){
//            features.add(new Feature("PreviousOutcome", outcomes.get(tokenIndex-1)));
            features.add(new Feature(String.format("Component%d_PreviousLabel", componentNum), componentOutcomes.get(componentNum).get(tokenIndex-1)));
          }
          features.add(new Feature(String.format("Component%d_Label", componentNum), outcome));
          if(tokenIndex < tokens.size() -1){
            features.add(new Feature(String.format("Component%d_NextLabel", componentNum), componentOutcomes.get(componentNum).get(tokenIndex+1)));
          }
//          if(!outcome.equals("O")){
//            features.add(new Feature(String.format("Component%d_IsTime", componentNum)));
//          }
        }
View Full Code Here

        tree.addChild(termTree);
      }
    }
    tree.addChild(arg2Tree);
   
    features.add(new Feature("TK_BOP", tree.toString()));
    return features;
  }
View Full Code Here

TOP

Related Classes of org.cleartk.classifier.Feature

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.