mirror of
https://github.com/explosion/spaCy.git
synced 2024-09-23 20:39:20 +03:00
Do not add the root token to the adjacency map
This commit is contained in:
parent
d9c567371f
commit
4ca8a396a2
|
@ -104,6 +104,8 @@ class DependencyTree(Tree):
|
|||
|
||||
for token in doc:
|
||||
self.nodes[token.i] = token
|
||||
|
||||
if token.head.i != token.i:
|
||||
# inverse the dependency to have an actual tree
|
||||
self.adjacency[token.head.i][token.i] = token.dep_
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user