Articles → SPACY → Dependency In Spacy

Dependency In Spacy






Dependency






  1. Love → ROOT
  2. I → Subject Of Love
  3. 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


Picture showing the output of dependency in spacy



Posted By  -  Karan Gupta
 
Posted On  -  Friday, November 28, 2025

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250