Computes a feature as the current observation ignoring case
Computes a feature as the current observation ignoring case
Segment length
SourceSequence of ObsSource[Obs]
objects
Current position within the sequence
A FeatureReturn
with the observation feature
Computes a feature with value ":E:"
Computes a feature with value ":E:"
Segment length
SourceSequence of ObsSource[Obs]
objects
Current position within the sequence
A FeatureReturn
with the unknown word feature :E: as an edge feature
Computes a feature with value ":E::x" where x is the size of the current segment
Computes a feature with value ":E::x" where x is the size of the current segment
Segment length
SourceSequence of ObsSource[Obs]
objects
Current position within the sequence
A FeatureReturn
with the unknown word feature :E: as an edge feature
Add lexicon features, but only if it matches an allowed set of named lexicons Useful for displacing features or other more advanced uses of lexicons
Computes a feature with value ":U:"
Computes a feature with value ":U:"
Segment length
SourceSequence of ObsSource[Obs]
objects
Current position within the sequence
A FeatureReturn
with the unknown word feature :U:
Computes a feature with value ":U::x" where x is the size of the current segment
Computes a feature with value ":U::x" where x is the size of the current segment
Segment length
SourceSequence of ObsSource[Obs]
objects
Current position within the sequence
A FeatureReturn
with the unknown word feature :U:
Computes a feature as the hashed conjunction of ALL labels produced from pre-models
Computes a feature as the hashed conjunction of ALL labels produced from pre-models
Segment length
SourceSequence of ObsSource[Obs]
objects
Current position within the sequence
A FeatureReturn
with the pre-model labels hash-conjoined
Computes a FeatureReturn
with a single feature value fname
if the observation at the current position matches the specified regular expression.
Computes a FeatureReturn
with a single feature value fname
if the observation at the current position matches the specified regular expression.
The name of the feature
A regular expression applied to the observation
Segment length
SourceSequence of ObsSource[Obs]
objects
Current position within the sequence
Single feature if regexp matches current observation
Computes a feature as the current observation
Computes a feature as the current observation
Segment length
SourceSequence of ObsSource[Obs]
objects
Current position within the sequence
A FeatureReturn
with the observation feature as a hashcode
Value for _wdFn _
Value for _wdFn _
#_wdFn(Int,SourceSequence[Obs],Int)
A
FeatureManager
defines includes a set of common feature function definitions. It also holds a list of actual feature function objects that are applied to a sequence of observations. Sequence labeling applications will need to create a concrete subclass ofFeatureManager
that specifies exactly which feature functions will be applied. This class defines a simple DSL (Domain-Specific Language) that allows the set of feature functions for a particular application to be clearly specified.There are also higher-order feature functions that take other feature functions as arguments to easily and compactly specify more complicated feature extraction functionality. The FeatureManager is type-parameterized by
Obs
which represents the observation type andInfo
which denotes the type of the auxilliary information (if any) associated with each observation.An application-specific FeatureManager should subclass this class and specify, within the body of the class definition a set of feature functions, where each function is described as a single expression that returns an instance of
FeatureReturn
. Below is an example:Each top-level function consists as a
String
followed by the keyword method name "as" which is then followed by a feature function. That feature function may be either 1) a simple feature function such aswdFn
or 2) a complex feature function created by composing other feature functions. For example, the feature function named "wdNgrm1" creates an n-gram consisting of the concatenation of the features that result from applying the wdFn feature function at the positions -2,-1 and 0 relative to the current position. The "cross1" feature function is a more complicated instance that takes the ngram computed from the words at -1 and 0 and conjoins that feature with all the features that result from applying the regular expression function that returns the feature name "EndIn-ed" (when its pattern is matched) over the relative positions -2,-1,0,1,2.