Any way to import 'ROOT' as a symbol? #9020
danmysak
started this conversation in
Help: Best practices
Replies: 1 comment 1 reply
-
Which labels are in |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
It appears I can check whether a word is the subject of a sentence like this:
However,
returns
False
, even thoughnlp('He knows')[1].dep_
is'ROOT'
. Moreover,nlp('He knows')[1].dep
equals to8206900633647566924
, a magic constant (or is it?) that I can’t find anywhere in the source code of the project, except in one of the tests where it is used as a literal.My question is: is there a way to import the
'ROOT'
(or8206900633647566924
) constant from spaCy, or the only option I have is to spell it out as a literal myself?More generally, what is the reasoning behind asymmetric handling of the relation types such as
nsubj
oramod
(which are included inspacy.symbols
) andROOT
orcompound
(which are not)?Beta Was this translation helpful? Give feedback.
All reactions