Package org.apache.uima.alchemy.ts.categorization

Examples of org.apache.uima.alchemy.ts.categorization.Category


public class CategorizationProcessor implements AlchemyOutputProcessor {

  public void process(JCas cas, Results results) throws Exception {
    try {
      FeatureStructure fs = new Category(cas);
      Type type = fs.getType();
      fs.setFeatureValueFromString(type.getFeatureByBaseName("score"),
              ((CategorizationResults) results).getScore());
      fs.setFeatureValueFromString(type.getFeatureByBaseName("text"),
              ((CategorizationResults) results).getCategory());
      cas.addFsToIndexes(fs);
    } catch (Exception e) {
      e.printStackTrace();
      throw new MappingException(e);
View Full Code Here

TOP

Related Classes of org.apache.uima.alchemy.ts.categorization.Category

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.