public class DependencyPathNgrams extends Object implements FeatureExtractor
The dependency tree is read from the view name specified in the constructor. If possible, use the
static objects for the Easy-first dependency tree (which uses ViewNames.DEPENDENCY
) or
the Stanford dependency tree (which uses ViewNames.DEPENDENCY_STANFORD
)
Important note: To be able to specify the two constituents as input, the feature extractor assumes the following convention: The constituent that is specified as a parameter to the getFeatures function has an incoming relation from the first constituent. Furthermore, this incoming relation should be the only such relation.
This convention does not limit the expressivity in any way because the two constituents could be created on the spot before calling the feature extractor.
Modifier and Type | Field and Description |
---|---|
static DependencyPathNgrams |
EASY_FIRST_BIGRAM |
static DependencyPathNgrams |
EASY_FIRST_UNIGRAM |
static DependencyPathNgrams |
STANFORD_BIGRAM |
static DependencyPathNgrams |
STANFORD_UNIGRAM |
Constructor and Description |
---|
DependencyPathNgrams(String dependencyViewName,
int ngramSize)
Extracting ngram features along the dependency path
|
Modifier and Type | Method and Description |
---|---|
Set<Feature> |
getFeatures(Constituent c) |
String |
getName() |
public static DependencyPathNgrams EASY_FIRST_UNIGRAM
public static DependencyPathNgrams STANFORD_UNIGRAM
public static DependencyPathNgrams EASY_FIRST_BIGRAM
public static DependencyPathNgrams STANFORD_BIGRAM
public DependencyPathNgrams(String dependencyViewName, int ngramSize)
public Set<Feature> getFeatures(Constituent c) throws EdisonException
getFeatures
in interface FeatureExtractor
EdisonException
public String getName()
getName
in interface FeatureExtractor
Copyright © 2017. All rights reserved.