![JAR search and dependency download from the Maven repository](/logo.png)
edu.berkeley.nlp.classify.BasicLabeledFeatureVector Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of berkeleyparser Show documentation
Show all versions of berkeleyparser Show documentation
The Berkeley parser analyzes the grammatical structure of natural language using probabilistic context-free grammars (PCFGs).
The newest version!
package edu.berkeley.nlp.classify;
import edu.berkeley.nlp.classify.LabeledFeatureVector;
import edu.berkeley.nlp.util.Counter;
import java.util.List;
/**
* A minimal implementation of a labeled datum, wrapping a list of features and
* a label.
*
* @author Dan Klein
*/
public class BasicLabeledFeatureVector implements LabeledFeatureVector {
L label;
Counter features;
public L getLabel() {
return label;
}
public Counter getFeatures() {
return features;
}
public String toString() {
return "<" + getLabel() + " : " + getFeatures().toString() + ">";
}
public BasicLabeledFeatureVector(L label, Counter features) {
this.label = label;
this.features = features;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy