edu.stanford.nlp.sequences
Class FeatureFactory<IN>
java.lang.Object
edu.stanford.nlp.sequences.FeatureFactory<IN>
- Type Parameters:
IN
- The type of the items in the PaddedList from which features
are extracted
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- NERFeatureFactory
public abstract class FeatureFactory<IN>
- extends Object
- implements Serializable
This is the abstract class that all feature factories must
subclass. It also defines most of the basic Clique
s
that you would want to make features over. It contains a
convenient method, getCliques(maxLeft, maxRight) which will give
you all the cliques within the specified limits.
- Author:
- Jenny Finkel
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
flags
protected SeqClassifierFlags flags
cliqueC
public static final Clique cliqueC
cliqueCpC
public static final Clique cliqueCpC
cliqueCp2C
public static final Clique cliqueCp2C
cliqueCp3C
public static final Clique cliqueCp3C
cliqueCp4C
public static final Clique cliqueCp4C
cliqueCp5C
public static final Clique cliqueCp5C
cliqueCpCp2C
public static final Clique cliqueCpCp2C
cliqueCpCp2Cp3C
public static final Clique cliqueCpCp2Cp3C
cliqueCpCp2Cp3Cp4C
public static final Clique cliqueCpCp2Cp3Cp4C
cliqueCpCp2Cp3Cp4Cp5C
public static final Clique cliqueCpCp2Cp3Cp4Cp5C
cliqueCnC
public static final Clique cliqueCnC
cliqueCpCnC
public static final Clique cliqueCpCnC
knownCliques
public static final List<Clique> knownCliques
FeatureFactory
public FeatureFactory()
init
public void init(SeqClassifierFlags flags)
getCliques
public List<Clique> getCliques()
getCliques
public static List<Clique> getCliques(int maxLeft,
int maxRight)
getCliqueFeatures
public abstract Collection<String> getCliqueFeatures(PaddedList<IN> info,
int position,
Clique clique)
- This method returns a
Collection
of the features
calculated for the word at the specified position in info (the list of
words) for the specified Clique
.
It should return the actual features, NOT wrapped in a
Features
object, as the wrapping
will be done automatically.
Because it takes a PaddedList
you don't
need to worry about indices which are outside of the list.
- Parameters:
info
- A PaddedList of the feature-value pairsposition
- The current position to extract features atclique
- The particular clique for which to extract features. It
should be a member of the knownCliques list.
- Returns:
- A
Collection
of the features
calculated for the word at the specified position in info.
addAllInterningAndSuffixing
protected void addAllInterningAndSuffixing(Collection<String> accumulator,
Collection<String> addend,
String suffix)
- Makes more complete feature names out of partial feature names, by
adding a suffix to the String feature name, adding results to an
accumulator
- Parameters:
accumulator
- The output features are added hereaddend
- The base set of featuressuffix
- The suffix added to each feature in the addend set
getWord
protected String getWord(CoreLabel label)
- Convenience methods for subclasses which use CoreLabel. Gets the
word after applying any wordFunction present in the
SeqClassifierFlags.
Stanford NLP Group