Package com.clearnlp.classification.vector

Examples of com.clearnlp.classification.vector.StringFeatureVector


  }
 
  /** Called by {@link #parse()}. */
  protected DEPLabel getLabel(List<StringInstance> insts, DEPState state)
  {
    StringFeatureVector vector = getFeatureVector(f_xmls[0], state);
    DEPLabel label = null;
   
    if (isTrain())
    {
      label = state.getGoldLabel();
View Full Code Here


  }
 
  /** Called by {@link #process(DEPTree)}. */
  private String processTrain(TagState state, List<StringInstance> insts)
  {
    StringFeatureVector vector = getFeatureVector(f_xml, state);
    String label = getGoldLabel(state);
    addInstance(state, insts, label, vector);
    return label;
  }
View Full Code Here

  }
 
  /** Called by {@link #process(DEPTree)}. */
  private String processBootstrap(TagState state, List<StringInstance> insts)
  {
    StringFeatureVector vector = getFeatureVector(f_xml, state);
    String label = getAutoLabel(state, vector);
    addInstance(state, insts, getGoldLabel(state), vector);
    return label;
  }
View Full Code Here

  }
 
  /** Called by {@link #process(DEPTree)}. */
  private String processDecode(TagState state)
  {
    StringFeatureVector vector = getFeatureVector(f_xml, state);
    String label = getAutoLabel(state, vector);
    return label;
  }
View Full Code Here

//  ====================================== FEATURE EXTRACTION ======================================
 
  /** @return a feature vector using the specific feature template. */
  protected StringFeatureVector getFeatureVector(JointFtrXml xml, T state)
  {
    StringFeatureVector vector = new StringFeatureVector();
   
    for (FtrTemplate template : xml.getFtrTemplates())
      addFeatures(vector, template, state);
   
    return vector;
View Full Code Here

  }
 
  /** Called by {@link AbstractPOSTagger#tag()}. */
  private String getLabel(List<StringInstance> insts, POSState state)
  {
    StringFeatureVector vector = getFeatureVector(f_xmls[0], state);
    String label = null;
   
    if (isTrain())
    {
      label = state.getGoldLabel();
      if (vector.size() > 0) insts.add(new StringInstance(label, vector));
    }
    else if (isDevelopOrDecode())
    {
      label = getAutoLabel(vector, state);
    }
    else if (isBootstrap())
    {
      label = getAutoLabel(vector, state);
      if (vector.size() > 0) insts.add(new StringInstance(state.getGoldLabel(), vector));
    }
   
    return label;
  }
View Full Code Here

  static public StringInstance toInstance(String line, boolean hasWeight)
  {
    String[] tmp = line.split(DELIM_COL);
    String label = tmp[0];
   
    StringFeatureVector vector = new StringFeatureVector(hasWeight);
    int i, size = tmp.length;
   
    for (i=1; i<size; i++)
      vector.addFeature(tmp[i]);
   
    return new StringInstance(label, vector);
  }
View Full Code Here

  }
 
  /** Called by {@link AbstractPredicateIdentifier#identify()}. */
  protected String getLabel(List<StringInstance> insts, POSState state)
    {
    StringFeatureVector vector = getFeatureVector(f_xmls[0], state);
    String label = null;
   
    if (isTrain())
    {
      label = AbstractModel.getBooleanLabel(state.getGoldLabel() != null);
View Full Code Here

  }
 
  /** Called by {@link AbstractRolesetClassifier#classify()}. */
  protected String getLabel(int modelId, POSState state)
    {
    StringFeatureVector vector = getFeatureVector(f_xmls[0], state);
    String label = null;
   
    if (isTrain())
    {
      label = state.getGoldLabel();
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())
    {
View Full Code Here

TOP

Related Classes of com.clearnlp.classification.vector.StringFeatureVector

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.