Package org.chasen.crfpp

Examples of org.chasen.crfpp.Tagger


  public static String run(String model, ArrayList<String> list)
  {
    String taggedResult = "";

    //set model and parameters
    Tagger tagger = new Tagger("-m " + model);
    // clear internal context
    tagger.clear();
     
    String fVector = "";
    for(String s : list)
    {
      fVector += s;
    }
    //apply model / tag
    tagger.parse(fVector);

    /**
     * get and refine tagged context
     */
    for (int i = 0; i < tagger.size(); ++i) {
      for (int j = 0; j < tagger.xsize(); ++j) {}
      taggedResult +=  tagger.x(i, 0) + "\t" + tagger.y2(i) + "\n"; //get filename:TokenId and predicted label
    }
    tagger.delete();
   
  return taggedResult;
  }
View Full Code Here

TOP

Related Classes of org.chasen.crfpp.Tagger

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.