use of edu.illinois.cs.cogcomp.sl.util.SparseFeatureVector in project cogcomp-nlp by CogComp.
the class LabeledDepFeatureGenerator method featureVectorBufferFromFeature.
private FeatureVectorBuffer featureVectorBufferFromFeature(Set<Feature> features) {
Map<String, Float> featureMap = new HashMap<>();
for (Feature f : features) {
if (lm.containFeature(f.getName()))
featureMap.put(f.getName(), f.getValue());
}
SparseFeatureVector sfv = (SparseFeatureVector) lm.convertToFeatureVector(featureMap);
return new FeatureVectorBuffer(sfv);
}
Aggregations