Package com.clearnlp.classification.prediction

Examples of com.clearnlp.classification.prediction.StringPrediction


 
  private StringPrediction getLabel(SRLState state)
  {
    StringFeatureVector vector = getFeatureVector(f_xmls[0], state);
    int idx = state.getDirection();
    StringPrediction p = null;
   
    if (isTrain())
    {
      p = new StringPrediction(getGoldLabel(state), 1d);
      s_spaces[idx].addInstance(new StringInstance(p.label, vector));
    }
    else if (isDevelopOrDecode())
    {
      p = getAutoLabel(idx, vector, state);
View Full Code Here


  }

  /** Called by {@link AbstractSRLabeler#getLabel(byte)}. */
  private StringPrediction getAutoLabel(int idx, StringFeatureVector vector, SRLState state)
  {
    StringPrediction p = getBestPrediction(s_models[idx], vector, state);
   
    if (isDecode() && !p.label.equals(LB_NO_ARG))
    {
      String label = getHardLabel(state, p.label);
      if (label != nullp.label = 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

   
    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

    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 #processBootstrap(TagState, List)} and {@link #processDecode(TagState)}. */
  private void setAutoLabels(StringFeatureVector vector, TagState state)
  {
    Pair<StringPrediction,StringPrediction> ps = s_model.predictTop2(vector);
    StringPrediction fst = ps.o1;
    StringPrediction snd = ps.o2;
   
    if (fst.score - snd.score >= 1)
      snd = null;

    DEPNode input = state.getInput();
View Full Code Here

 
  private StringPrediction getLabel(SRLState state)
  {
    StringFeatureVector vector = getFeatureVector(f_xmls[0], state);
    int idx = state.getDirection();
    StringPrediction p = null;
   
    if (isTrain())
    {
      p = new StringPrediction(getGoldLabel(state), 1d);
      s_spaces[idx].addInstance(new StringInstance(p.label, vector));
    }
    else if (isDevelopOrDecode())
    {
      p = getAutoLabel(idx, vector, state);
View Full Code Here

  }

  /** Called by {@link AbstractSRLabeler#getLabel(byte)}. */
  private StringPrediction getAutoLabel(int idx, StringFeatureVector vector, SRLState state)
  {
    StringPrediction p = getBestPrediction(s_models[idx], vector, state);
   
    if (isDecode() && !p.label.equals(LB_NO_ARG))
    {
      String label = getHardLabel(state, p.label);
      if (label != nullp.label = 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

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.