The main purpose of SentenceGraph is to connect the syntactic
dependency parse (a graph where dependencies are edges and tokens are
nodes) to the semantic interactions (which form a graph where
interactions are edges and entities are nodes). Additionally,
SentenceGraph provides several dictionaries that e.g. map element ids to
their corresponding elements.
|
__init__(self,
sentenceElement,
tokenElements,
dependencyElements)
Creates the syntactic graph part of the SentenceGraph. |
source code
|
|
|
|
|
makeEntityGraph(self,
entities,
interactions,
entityToDuplicates=None) |
source code
|
|
|
getInteractions(self,
entity1,
entity2,
merged=False)
Return a list of interaction-elements which represent directed
interactions from entity1 to entity2. |
source code
|
|
|
getOutInteractions(self,
entity,
merged=False) |
source code
|
|
|
mapInteractions(self,
entityElements,
interactionElements,
verbose=False)
Maps the semantic interactions to the syntactic graph. |
source code
|
|
|
mapEntity(self,
entityElement,
verbose=False)
Determine the head token for a named entity or trigger. |
source code
|
|
|
findHeadToken(self,
candidateTokens)
Select the candidate token that is closest to the root of the subtree
of the depencdeny parse to which the candidate tokens belong to. |
source code
|
|
|
|
|
|
|
getTokenText(self,
token)
Returns the text of a token, and masks it if the token is the head
token of a named entity. |
source code
|
|
|
|
|
|