Package com.clearnlp.classification.prediction

Examples of com.clearnlp.classification.prediction.StringPrediction


  }
 
  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

    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

 
  /** Called by {@link #processBootstrap(TagState, List)} and {@link #processDecode(TagState)}. */
  private String getAutoLabel(TagState state, StringFeatureVector vector)
  {
    Pair<StringPrediction,StringPrediction> ps = s_model.predictTop2(vector);
    StringPrediction fst = ps.o1;
    StringPrediction snd = ps.o2;
   
    if (fst.score - snd.score < 1)
      state.getInput().addFeat(DEPLib.FEAT_POS2, snd.label);
   
    return fst.label;
View Full Code Here

    DEPNode lambda = state.getLambda();
    DEPNode beta   = state.getBeta();
   
    int i, size = ps.size(), count = 0;
    boolean lChanged, gChanged = false;
    StringPrediction prediction;
    DEPLabel label;
   
    for (i=0; i<size; i++)
    {
      lChanged = false;
View Full Code Here

 
  /** 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 AbstractPredicateIdentifier#getLabel()}. */
  private String getAutoLabel(StringFeatureVector vector)
  {
    StringPrediction p = s_models[0].predictBest(vector);
    return p.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

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.