The Problem:
spaCy dependency symbols 'compound' and 'case' error out as 'undefined' whereas 'nsubj' is recognized even though all three dependency symbols are shown active in the graphical output. Should not the 'from spacy.symbols import *' define all symbols as it does for 'nsubj' and others?
spaCy Documentation
https://spacy.io/api/annotation#dependency-parsing Shows 'case' and 'compound' defined in both the English and Universal label dependency sets.
Environment
Windows 10; python 3.7.1; spaCy 2.3.1; using Anaconda3 environment; installed packages using conda; Running code in Jupyter. All packages installed are listed after the code below.
Code Example
import spacy
from spacy import displacy
from spacy.symbols import *
nlp = spacy.load("en_core_web_sm") # loaded the small model but also fails with the large model
doc = nlp("Autonomous family cars and people's drones are the future.")
displacy.render(doc, style='dep') # draw a graph; shows dependencies assigned including 'compound' and 'case'
for t in doc:
if t.dep == nsubj: # dependency 'nsubj' IS recognized
print(f"Found nsub token")
if t.dep == compound: # dependency 'compound' is NOT recognized
print(f"Found compound token")
if t.dep == case: # dependency 'case' is NOT recognized
print(f"Found case token")