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(List<CoreLabel> subject,
List<CoreLabel> canonicalSubject,
List<CoreLabel> relation,
List<CoreLabel> object,
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(List<CoreLabel> subject,
List<CoreLabel> relation,
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 |
---|---|
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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
forEach, spliterator
public final SemanticGraph sourceTree
public WithTree(List<CoreLabel> subject, List<CoreLabel> relation, 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(List<CoreLabel> subject, List<CoreLabel> canonicalSubject, List<CoreLabel> relation, List<CoreLabel> object, 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 Optional<SemanticGraph> asDependencyTree()
asDependencyTree
in class RelationTriple