Package com.clearnlp.component.evaluation

Examples of com.clearnlp.component.evaluation.POSEval


    {
      s_model.addInstances(insts);
    }
    else if (isEvaluate(flag))
    {
      if (e_eval == null) e_eval = new POSEval();
      Object[] labels = state.getGoldLabels();
      DEPTree tree = state.getTree();
     
      e_eval.countAccuracy(tree, labels);
      tree.setPOSTags((String[])labels);
View Full Code Here


  }
 
  /** Constructs a part-of-speech tagger for developing. */
  public AbstractPOSTagger(JointFtrXml[] xmls, StringModel[] models, Object[] lexica)
  {
    super(xmls, models, lexica, new POSEval());
    initMorphologicalAnalyzer();
  }
View Full Code Here

  }
 
  /** Constructs a part-of-speech tagger for developing. */
  public AbstractPOSTagger(JointFtrXml[] xmls, StringModel[] models, Object[] lexica)
  {
    super(xmls, models, lexica, new POSEval());
    initMorphologicalAnalyzer();
  }
View Full Code Here

    s_model.build(f_xml.getLabelCutoff(0), f_xml.getFeatureCutoff(0));
    s_model.printInfo(log);
   
    int[] indices = UTArray.range(s_model.getInstanceSize());
    Random rand = new Random(randomSeed);
    AbstractEval eval = new POSEval();
    double prevScore, currScore = 0;
    FloatArrayList prevWeights;
    String[] goldLabels;
    int iter = 1;
   
    do
    {
      prevScore   = currScore;
      prevWeights = s_model.cloneWeights();
     
      UTArray.shuffle(rand, indices);
      algorithm.updateWeights(s_model, indices);
     
      for (DEPTree tree : devTrees)
      {
        AbstractState state = process(tree, FLAG_DEVELOP, null);
        goldLabels = (String[])state.getGoldLabels();
        eval.countAccuracy(tree, goldLabels);
        tree.setPOSTags((String[])goldLabels);
      }
     
      System.out.printf("%2d: %s\n", iter++, eval.toString());
      currScore = eval.getAccuracies()[0];
      eval.clear();
    }
    while (prevScore < currScore);
   
    s_model.setWeights(prevWeights);
  }
View Full Code Here

  }
 
  /** Constructs a part-of-speech tagger for developing. */
  public AbstractPOSTagger(JointFtrXml[] xmls, StringModel[] models, Object[] lexica)
  {
    super(xmls, models, lexica, new POSEval());
    initMorphologicalAnalyzer();
  }
View Full Code Here

TOP

Related Classes of com.clearnlp.component.evaluation.POSEval

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.