public class BasicRelationFeatureFactory extends RelationFeatureFactory implements Serializable
RelationFeatureFactory.DEPENDENCY_TYPE| Modifier and Type | Field and Description |
|---|---|
protected static List<String> |
dependencyFeatures |
protected List<String> |
featureList |
dependencyType, doNotLexicalizeFirstArg| Constructor and Description |
|---|
BasicRelationFeatureFactory(String... featureList) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addDependencyPathFeatures(Counter<String> features,
RelationMention rel,
EntityMention arg0,
EntityMention arg1,
List<String> types,
List<String> checklist,
Logger logger) |
boolean |
addFeatures(Counter<String> features,
RelationMention rel,
List<String> types) |
boolean |
addFeatures(Counter<String> features,
RelationMention rel,
List<String> types,
Logger logger)
Creates all features for the datum corresponding to this relation mention
Note: this assumes binary relations where both arguments are EntityMention
|
Datum<String,String> |
createDatum(RelationMention rel) |
Datum<String,String> |
createDatum(RelationMention rel,
Logger logger) |
Datum<String,String> |
createDatum(RelationMention rel,
String positiveLabel) |
Datum<String,String> |
createTestDatum(RelationMention rel,
Logger logger) |
static String |
dependencyPath(List<SemanticGraphEdge> edgePath,
IndexedWord node) |
static List<String> |
dependencyPathAsList(List<SemanticGraphEdge> edgePath,
IndexedWord node,
boolean generalize) |
static String |
generalizedDependencyPath(List<SemanticGraphEdge> edgePath,
IndexedWord node) |
protected static GrammaticalRelation |
generalizeRelation(GrammaticalRelation gr) |
String |
getFeature(RelationMention rel,
String featureType) |
Set<String> |
getFeatures(RelationMention rel,
String featureType) |
protected static boolean |
usingFeature(List<String> types,
List<String> checklist,
String type)
Helper method that checks if a feature type "type" is present in the list of features "types"
and removes it from "checklist"
|
setDoNotLexicalizeFirstArgumentpublic BasicRelationFeatureFactory(String... featureList)
public Datum<String,String> createDatum(RelationMention rel)
createDatum in class RelationFeatureFactorypublic Datum<String,String> createDatum(RelationMention rel, Logger logger)
public Datum<String,String> createTestDatum(RelationMention rel, Logger logger)
createTestDatum in class RelationFeatureFactorypublic Datum<String,String> createDatum(RelationMention rel, String positiveLabel)
createDatum in class RelationFeatureFactorypublic boolean addFeatures(Counter<String> features, RelationMention rel, List<String> types)
public boolean addFeatures(Counter<String> features, RelationMention rel, List<String> types, Logger logger)
features - Stores all featuresrel - The mentiontypes - Comma separated list of feature classes to useprotected void addDependencyPathFeatures(Counter<String> features, RelationMention rel, EntityMention arg0, EntityMention arg1, List<String> types, List<String> checklist, Logger logger)
protected static boolean usingFeature(List<String> types, List<String> checklist, String type)
types - checklist - type - protected static GrammaticalRelation generalizeRelation(GrammaticalRelation gr)
public static List<String> dependencyPathAsList(List<SemanticGraphEdge> edgePath, IndexedWord node, boolean generalize)
public static String dependencyPath(List<SemanticGraphEdge> edgePath, IndexedWord node)
public static String generalizedDependencyPath(List<SemanticGraphEdge> edgePath, IndexedWord node)
public Set<String> getFeatures(RelationMention rel, String featureType)
getFeatures in class RelationFeatureFactorypublic String getFeature(RelationMention rel, String featureType)
getFeature in class RelationFeatureFactory