public static class RelationTriple.WithTree extends RelationTriple
RelationTriple
, but with the tree saved as well.RelationTriple.WithLink, RelationTriple.WithTree
Modifier and Type | Field and Description |
---|---|
SemanticGraph |
sourceTree |
canonicalObject, canonicalSubject, confidence, object, relation, subject
Constructor and Description |
---|
WithTree(java.util.List<CoreLabel> subject,
java.util.List<CoreLabel> canonicalSubject,
java.util.List<CoreLabel> relation,
java.util.List<CoreLabel> object,
java.util.List<CoreLabel> canonicalObject,
double confidence,
SemanticGraph tree)
Create a new triple with known values for the subject, relation, and object,
along with their canonical spans (i.e., resolving coreference)
For example, "(cats, play with, yarn)"
|
WithTree(java.util.List<CoreLabel> subject,
java.util.List<CoreLabel> relation,
java.util.List<CoreLabel> object,
SemanticGraph tree,
double confidence)
Create a new triple with known values for the subject, relation, and object.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<SemanticGraph> |
asDependencyTree()
An optional method, returning the dependency tree this triple was extracted from
|
CoreLabel |
objectHead()
The head of the object of this relation triple.
|
CoreLabel |
relationHead()
The head of the relation of this relation triple.
|
CoreLabel |
subjectHead()
The head of the subject of this relation triple.
|
allTokens, asSentence, compareTo, confidenceGloss, equals, hashCode, isPrefixBe, isPrefixBe, isSuffixBe, isSuffixBe, isSuffixOf, isSuffixOf, istmod, istmod, iterator, objectGloss, objectLemmaGloss, objectLink, objectTokenSpan, relationGloss, relationLemmaGloss, relationTokenSpan, subjectGloss, subjectLemmaGloss, subjectLink, subjectTokenSpan, toQaSrlString, toReverbString, toString
public final SemanticGraph sourceTree
public WithTree(java.util.List<CoreLabel> subject, java.util.List<CoreLabel> relation, java.util.List<CoreLabel> object, SemanticGraph tree, double confidence)
subject
- The subject of this triple; e.g., "cats".relation
- The relation of this triple; e.g., "play with".object
- The object of this triple; e.g., "yarn".tree
- The tree this extraction was created from; we create a deep copy of the tree.public WithTree(java.util.List<CoreLabel> subject, java.util.List<CoreLabel> canonicalSubject, java.util.List<CoreLabel> relation, java.util.List<CoreLabel> object, java.util.List<CoreLabel> canonicalObject, double confidence, SemanticGraph tree)
public CoreLabel subjectHead()
subjectHead
in class RelationTriple
public CoreLabel objectHead()
objectHead
in class RelationTriple
public CoreLabel relationHead()
relationHead
in class RelationTriple
public java.util.Optional<SemanticGraph> asDependencyTree()
asDependencyTree
in class RelationTriple