Search in sources :

Example 1 with Feature

use of edu.illinois.cs.cogcomp.lbjava.classify.Feature in project cogcomp-nlp by CogComp.

the class POSTaggerUnknown method cachedFeatureValue.

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;
}
Also used : DiscretePrimitiveStringFeature(edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature) Token(edu.illinois.cs.cogcomp.lbjava.nlp.seg.Token) Feature(edu.illinois.cs.cogcomp.lbjava.classify.Feature) DiscretePrimitiveStringFeature(edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature)

Example 2 with Feature

use of edu.illinois.cs.cogcomp.lbjava.classify.Feature in project cogcomp-nlp by CogComp.

the class labelOneBefore method cachedFeatureValue.

private Feature cachedFeatureValue(Object __example) {
    if (__example == __exampleCache.get())
        return (Feature) __cache.get();
    __exampleCache.set(__example);
    String __cachedValue = _discreteValue(__example);
    Feature __result = new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue, valueIndexOf(__cachedValue), (short) allowableValues().length);
    __cache.set(__result);
    return __result;
}
Also used : DiscretePrimitiveStringFeature(edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature) Feature(edu.illinois.cs.cogcomp.lbjava.classify.Feature) DiscretePrimitiveStringFeature(edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature)

Example 3 with Feature

use of edu.illinois.cs.cogcomp.lbjava.classify.Feature in project cogcomp-nlp by CogComp.

the class labelOneBeforeU method cachedFeatureValue.

private Feature cachedFeatureValue(Object __example) {
    if (__example == __exampleCache.get())
        return (Feature) __cache.get();
    __exampleCache.set(__example);
    String __cachedValue = _discreteValue(__example);
    Feature __result = new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue, valueIndexOf(__cachedValue), (short) allowableValues().length);
    __cache.set(__result);
    return __result;
}
Also used : DiscretePrimitiveStringFeature(edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature) Feature(edu.illinois.cs.cogcomp.lbjava.classify.Feature) DiscretePrimitiveStringFeature(edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature)

Example 4 with Feature

use of edu.illinois.cs.cogcomp.lbjava.classify.Feature in project cogcomp-nlp by CogComp.

the class labelOrBaselineU method cachedFeatureValue.

private Feature cachedFeatureValue(Object __example) {
    if (__example == __exampleCache.get())
        return (Feature) __cache.get();
    __exampleCache.set(__example);
    String __cachedValue = _discreteValue(__example);
    Feature __result = new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue, valueIndexOf(__cachedValue), (short) allowableValues().length);
    __cache.set(__result);
    return __result;
}
Also used : DiscretePrimitiveStringFeature(edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature) Feature(edu.illinois.cs.cogcomp.lbjava.classify.Feature) DiscretePrimitiveStringFeature(edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature)

Example 5 with Feature

use of edu.illinois.cs.cogcomp.lbjava.classify.Feature in project cogcomp-nlp by CogComp.

the class labelTwoBefore method cachedFeatureValue.

private Feature cachedFeatureValue(Object __example) {
    if (__example == __exampleCache.get())
        return (Feature) __cache.get();
    __exampleCache.set(__example);
    String __cachedValue = _discreteValue(__example);
    Feature __result = new DiscretePrimitiveStringFeature(containingPackage, name, "", __cachedValue, valueIndexOf(__cachedValue), (short) allowableValues().length);
    __cache.set(__result);
    return __result;
}
Also used : DiscretePrimitiveStringFeature(edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature) Feature(edu.illinois.cs.cogcomp.lbjava.classify.Feature) DiscretePrimitiveStringFeature(edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature)

Aggregations

DiscretePrimitiveStringFeature (edu.illinois.cs.cogcomp.lbjava.classify.DiscretePrimitiveStringFeature)9 Feature (edu.illinois.cs.cogcomp.lbjava.classify.Feature)9 Token (edu.illinois.cs.cogcomp.lbjava.nlp.seg.Token)3