public class SemEvalDependencyContextExtractor extends DependencyContextExtractor
DependencyContextExtractor
. This extractor
assumes that the instance id is the first line in the document and that each
document only contains the sentences for that instance id. The dependency
tree node for the focus word of each context should match the instance id.
The primary key will be the raw token of the instance id and the secondary
key will be the instance id.extractor, generator, readHeader
Constructor and Description |
---|
SemEvalDependencyContextExtractor(DependencyExtractor extractor,
DependencyContextGenerator generator)
Creates a new
SemEvalDependencyContextExtractor . |
Modifier and Type | Method and Description |
---|---|
protected boolean |
acceptWord(DependencyTreeNode focusNode,
String contextHeader,
Wordsi wordsi)
Returns true if the
focusWord equals the contextHeader . |
protected String |
getSecondaryKey(DependencyTreeNode focusNode,
String contextHeader)
Returns the word of the
focusNode |
getPrimaryKey, getVectorLength, handleContextHeader, processDocument
public SemEvalDependencyContextExtractor(DependencyExtractor extractor, DependencyContextGenerator generator)
SemEvalDependencyContextExtractor
.extractor
- The DependencyExtractor
that parses the document
and returns a valid dependency treebasisMapping
- A mapping from dependency paths to feature indicesweighter
- A weighting function for dependency pathsacceptor
- An accepting function that validates dependency paths
which may serve as featuresprotected boolean acceptWord(DependencyTreeNode focusNode, String contextHeader, Wordsi wordsi)
focusWord
equals the contextHeader
.acceptWord
in class DependencyContextExtractor
protected String getSecondaryKey(DependencyTreeNode focusNode, String contextHeader)
focusNode
getSecondaryKey
in class DependencyContextExtractor
Copyright © 2012. All Rights Reserved.