Package com.clearnlp.classification.prediction

Examples of com.clearnlp.classification.prediction.StringPrediction


 
  /** Called by {@link AbstractPOSTagger#getLabel()}. */
  private String getAutoLabel(StringFeatureVector vector, POSState state)
  {
    Pair<StringPrediction,StringPrediction> ps = s_models[0].predictTwo(vector);
    StringPrediction fst = ps.o1;
    StringPrediction snd = ps.o2;
   
    if (fst.score - snd.score < 1)
      state.add2ndLabel(snd.label);
   
    return fst.label;
View Full Code Here


  }
 
  /** Called by {@link AbstractRolesetClassifier#getLabel()}. */
  private String getAutoLabel(StringFeatureVector vector, int modelId)
  {
    StringPrediction p = s_models[modelId].predictBest(vector);
    return p.label;
  }
View Full Code Here

    return predictTwo(getPredictions(x));
  }
 
  public Pair<StringPrediction,StringPrediction> predictTwo(List<StringPrediction> list)
  {
    StringPrediction fst = list.get(0), snd = list.get(1), p;
    int i, size = list.size();
   
    if (fst.score < snd.score)
    {
      fst = snd;
View Full Code Here

    List<StringPrediction> list = new ArrayList<StringPrediction>(n_labels);
    double[] scores = getScores(x);
    int i;
   
    for (i=0; i<n_labels; i++)
      list.add(new StringPrediction(a_labels[i], scores[i]));
   
    return list;   
  }
View Full Code Here

  }
 
  static public void normalize(List<StringPrediction> ps)
  {
    int i, size = ps.size();
    StringPrediction p;
    double d, sum = 0;
   
    for (i=0; i<size; i++)
    {
      p = ps.get(i);
View Full Code Here

  }
 
  /** @return the first and second best predictions given the list of string predictions. */
  public Pair<StringPrediction,StringPrediction> predictTop2(List<StringPrediction> list)
  {
    StringPrediction fst = list.get(0), snd = list.get(1), p;
    int i, size = list.size();
   
    if (fst.score < snd.score)
    {
      fst = snd;
View Full Code Here

    List<StringPrediction> list = Lists.newArrayList();
    double[] scores = getScores(x);
    int i;
   
    for (i=0; i<n_labels; i++)
      list.add(new StringPrediction(a_labels.get(i), scores[i]));
   
    return list;   
  }
View Full Code Here

   
    in.close();
   
    boolean hasWeight = AbstractTrainSpace.hasWeight(vectorType, testFile);
    int correct = 0, total = 0;
    StringPrediction r = null;
    String line, label = null;
   
    System.out.print("Predicting");
   
    while ((line = fin.readLine()) != null)
View Full Code Here

TOP

Related Classes of com.clearnlp.classification.prediction.StringPrediction

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.