edu.illinois.cs.cogcomp.lbjava.classify.Feature.getStringValue()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(8.6k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中edu.illinois.cs.cogcomp.lbjava.classify.Feature.getStringValue()方法的一些代码示例,展示了Feature.getStringValue()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Feature.getStringValue()方法的具体详情如下:
包路径:edu.illinois.cs.cogcomp.lbjava.classify.Feature
类名称:Feature
方法名:getStringValue

Feature.getStringValue介绍

[英]Gives a string representation of the value of this feature.
[中]提供此功能值的字符串表示形式。

代码示例

代码示例来源:origin: CogComp/cogcomp-nlp

public String discreteValue(Object __example) {
  if (!(__example instanceof Token)) {
    String type = __example == null ? "null" : __example.getClass().getName();
    System.err
        .println("Classifier 'labelOneAfterU(Token)' defined on line 83 of POSUnknown.lbj received '"
            + type + "' as input.");
    new Exception().printStackTrace();
    System.exit(1);
  }
  return cachedFeatureValue(__example).getStringValue();
}

代码示例来源:origin: edu.illinois.cs.cogcomp/LBJava

/**
 * The evaluate method returns the class label which yields the highest score for this example.
 *
 * @param exampleFeatures The example's array of feature indices
 * @param exampleValues The example's array of feature values
 * @return The computed feature (in a vector).
 **/
public String discreteValue(int[] exampleFeatures, double[] exampleValues) {
  return featureValue(exampleFeatures, exampleValues).getStringValue();
}

代码示例来源:origin: edu.illinois.cs.cogcomp/LBJava

/**
 * Prediction value counts and feature counts given a particular prediction value are used to
 * select the most likely prediction value.
 *
 * @param exampleFeatures The example's array of feature indices.
 * @param exampleValues The example's array of feature values.
 * @return The most likely discrete value.
 **/
public String discreteValue(int[] exampleFeatures, double[] exampleValues) {
  return featureValue(exampleFeatures, exampleValues).getStringValue();
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-pos

public String discreteValue(Object __example) {
  if (!(__example instanceof Token)) {
    String type = __example == null ? "null" : __example.getClass().getName();
    System.err
        .println("Classifier 'labelTwoAfterU(Token)' defined on line 95 of POSUnknown.lbj received '"
            + type + "' as input.");
    new Exception().printStackTrace();
    System.exit(1);
  }
  return cachedFeatureValue(__example).getStringValue();
}

代码示例来源:origin: edu.illinois.cs.cogcomp/LBJava

/**
 * This implementation uses a winner-take-all comparison of the outputs from the individual
 * linear threshold units' score methods.
 *
 * @param exampleFeatures The example's array of feature indices.
 * @param exampleValues The example's array of feature values.
 * @return A single value with the winning linear threshold unit's associated value.
 **/
public String discreteValue(int[] exampleFeatures, double[] exampleValues) {
  return featureValue(exampleFeatures, exampleValues).getStringValue();
}

代码示例来源:origin: edu.illinois.cs.cogcomp/LBJava

/**
 * Returns the value of the discrete feature that would be returned by this classifier.
 *
 * @param exampleFeatures The example's array of feature indices.
 * @param exampleValues The example's array of feature values.
 * @return A single value with the winning linear threshold unit's associated value.
 **/
public String discreteValue(int[] exampleFeatures, double[] exampleValues) {
  return featureValue(exampleFeatures, exampleValues).getStringValue();
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-pos

public String discreteValue(Object __example) {
  if (!(__example instanceof Token)) {
    String type = __example == null ? "null" : __example.getClass().getName();
    System.err
        .println("Classifier 'labelOneAfterU(Token)' defined on line 83 of POSUnknown.lbj received '"
            + type + "' as input.");
    new Exception().printStackTrace();
    System.exit(1);
  }
  return cachedFeatureValue(__example).getStringValue();
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-pos

public String discreteValue(Object __example) {
  if (!(__example instanceof Token)) {
    String type = __example == null ? "null" : __example.getClass().getName();
    System.err
        .println("Classifier 'labelOneAfter(Token)' defined on line 108 of POSKnown.lbj received '"
            + type + "' as input.");
    new Exception().printStackTrace();
    System.exit(1);
  }
  return cachedFeatureValue(__example).getStringValue();
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-pos

public String discreteValue(Object __example) {
  if (!(__example instanceof Token)) {
    String type = __example == null ? "null" : __example.getClass().getName();
    System.err
        .println("Classifier 'labelTwoBeforeU(Token)' defined on line 48 of POSUnknown.lbj received '"
            + type + "' as input.");
    new Exception().printStackTrace();
    System.exit(1);
  }
  return cachedFeatureValue(__example).getStringValue();
}

代码示例来源:origin: CogComp/cogcomp-nlp

public String discreteValue(Object __example) {
  if (!(__example instanceof Token)) {
    String type = __example == null ? "null" : __example.getClass().getName();
    System.err
        .println("Classifier 'labelOneAfter(Token)' defined on line 108 of POSKnown.lbj received '"
            + type + "' as input.");
    new Exception().printStackTrace();
    System.exit(1);
  }
  return cachedFeatureValue(__example).getStringValue();
}

代码示例来源:origin: CogComp/cogcomp-nlp

public String discreteValue(Object __example) {
  if (!(__example instanceof Token)) {
    String type = __example == null ? "null" : __example.getClass().getName();
    System.err
        .println("Classifier 'labelTwoAfterU(Token)' defined on line 95 of POSUnknown.lbj received '"
            + type + "' as input.");
    new Exception().printStackTrace();
    System.exit(1);
  }
  return cachedFeatureValue(__example).getStringValue();
}

代码示例来源:origin: CogComp/cogcomp-nlp

public String discreteValue(Object __example) {
  if (!(__example instanceof Token)) {
    String type = __example == null ? "null" : __example.getClass().getName();
    System.err
        .println("Classifier 'labelTwoAfter(Token)' defined on line 120 of POSKnown.lbj received '"
            + type + "' as input.");
    new Exception().printStackTrace();
    System.exit(1);
  }
  return cachedFeatureValue(__example).getStringValue();
}

代码示例来源:origin: CogComp/cogcomp-nlp

public Set<String> getTagValues() {
  Lexicon labelLexicon = taggerKnown.getLabelLexicon();
  Set<String> tagSet = new HashSet();
  for (int i =0; i < labelLexicon.size(); ++i) {
    tagSet.add(labelLexicon.lookupKey(i).getStringValue());
  }
  return tagSet;
}

代码示例来源:origin: CogComp/cogcomp-nlp

public String discreteValue(Object __example) {
  if (__example instanceof Object[]) {
    Object[] a = (Object[]) __example;
    if (a[0] instanceof int[])
      return super.discreteValue((int[]) a[0], (double[]) a[1]);
  }
  return cachedFeatureValue(__example).getStringValue();
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-pos

public Set<String> getTagValues() {
  Lexicon labelLexicon = taggerKnown.getLabelLexicon();
  Set<String> tagSet = new HashSet();
  for (int i =0; i < labelLexicon.size(); ++i) {
    tagSet.add(labelLexicon.lookupKey(i).getStringValue());
  }
  return tagSet;
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-chunker

public String discreteValue(Object __example) {
  if (__example instanceof Object[]) {
    Object[] a = (Object[]) __example;
    if (a[0] instanceof int[])
      return super.discreteValue((int[]) a[0], (double[]) a[1]);
  }
  return cachedFeatureValue(__example).getStringValue();
}

代码示例来源:origin: CogComp/cogcomp-nlp

private Feature cachedFeatureValue(Object __example) {
  Token w = (Token) __example;
  String __cachedValue = w.partOfSpeech;
  if (__cachedValue != null) {
    return new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue,
        valueIndexOf(__cachedValue), (short) allowableValues().length);
  }
  Feature __result;
  __result = valueOf(w, __MikheevTable.allowableTags(w));
  w.partOfSpeech = __result.getStringValue();
  return __result;
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-pos

private Feature cachedFeatureValue(Object __example) {
  Token w = (Token) __example;
  String __cachedValue = w.partOfSpeech;
  if (__cachedValue != null) {
    return new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue,
        valueIndexOf(__cachedValue), (short) allowableValues().length);
  }
  Feature __result;
  __result = valueOf(w, __MikheevTable.allowableTags(w));
  w.partOfSpeech = __result.getStringValue();
  return __result;
}

代码示例来源:origin: edu.illinois.cs.cogcomp/illinois-pos

private Feature cachedFeatureValue(Object __example) {
  Token w = (Token) __example;
  String __cachedValue = w.partOfSpeech;
  if (__cachedValue != null) {
    return new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue,
        valueIndexOf(__cachedValue), (short) allowableValues().length);
  }
  Feature __result;
  __result = valueOf(w, baselineTarget.allowableTags(wordForm.discreteValue(w)));
  w.partOfSpeech = __result.getStringValue();
  return __result;
}

代码示例来源:origin: CogComp/cogcomp-nlp

private Feature cachedFeatureValue(Object __example) {
  Token w = (Token) __example;
  String __cachedValue = w.partOfSpeech;
  if (__cachedValue != null) {
    return new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue,
        valueIndexOf(__cachedValue), (short) allowableValues().length);
  }
  Feature __result;
  __result = valueOf(w, baselineTarget.allowableTags(wordForm.discreteValue(w)));
  w.partOfSpeech = __result.getStringValue();
  return __result;
}

相关文章