Articles → SPACY → Dependency In Spacy
Dependency In Spacy
Dependency
- Love → ROOT
- I → Subject Of Love
- AI → Object Of Love
Example
import spacy
# Load English model (make sure it's installed: python -m spacy download en_core_web_sm)
nlp = spacy.load("en_core_web_sm")
# Input text
text = "The cats are running fast."
# Process the text
doc = nlp(text)
# Print token, POS, detailed tag, and dependency relation
print("Dependency")
print("-" * 10)
for token in doc:
print(f"{token.dep_}")
Output
| Posted By - | Karan Gupta |
| |
| Posted On - | Friday, November 28, 2025 |