Package org.fnlp.nlp.pipe.seq.templet

Examples of org.fnlp.nlp.pipe.seq.templet.TempletGroup


    if (cl != null){
      factory = cl.getAlphabetFactory();
    }
    else{
      factory = AlphabetFactory.buildFactory();
      templets = new TempletGroup();
      templets.load(templateFile);
    }

    //类别集合
    LabelAlphabet labels = factory.DefaultLabelAlphabet();
View Full Code Here


    String train = "./example-data/sequence/train.txt";
    String testfile = "./example-data/sequence/test.txt";
    String templateFile="./example-data/sequence/template";
    AlphabetFactory factory;
    Pipe featurePipe;
    TempletGroup templets;

    templets = new TempletGroup();
    templets.load(templateFile);
    factory = AlphabetFactory.buildFactory();

    /**
     * 标签字典。转为0、1、2、...
     */
 
View Full Code Here

  public void optimizeTag(String file) throws IOException,
  ClassNotFoundException {
    ModelIO.loadFrom(file);
    Linear cl=ModelIO.cl;
    TempletGroup templates=ModelIO.templets;   
    ModelIO.saveTo(file+".bak", templates, cl);
    removeZero(cl);
    ModelIO.saveTo(file,templates,cl);
    System.out.print("Done");
  }
View Full Code Here

    if(cl!=null){
      factory = cl.getAlphabetFactory();
    }else{
      factory = AlphabetFactory.buildFactory();
      templets = new TempletGroup();
      templets.load(templateFile);
      for(Templet templet:templets){
        ((BaseTemplet) templet).minLen = 0;
      }
      //Dictionary d = new Dictionary();
View Full Code Here

public class POSTrain extends AbstractTagger {

 
  public Pipe createProcessor() throws Exception {

    templets = new TempletGroup();
    templets.load(templateFile);
    for(Templet templet:templets){
      ((BaseTemplet) templet).minLen = 5;
    }
    // Dictionary d = new Dictionary();
View Full Code Here

  /**
   * @throws Exception
   */
  public Pipe createProcessor(boolean flag) throws Exception {
    if (!flag) {
      templets = new TempletGroup();
      templets.load(templateFile);

      // Dictionary d = new Dictionary();
      // d.loadWithWeigth("D:/xpqiu/项目/自选/CLP2010/CWS/av-b-lut.txt",
      // "AV");
View Full Code Here

TOP

Related Classes of org.fnlp.nlp.pipe.seq.templet.TempletGroup

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.