Articles → NLP → Span In Spacy
Span In Spacy
Purpose
Syntax
Span(doc, start_index, end_index)
Example
import spacy
from spacy.tokens import Span
nlp = spacy.load("en_core_web_sm")
doc = nlp("Apple is looking at buying a U.K. startup")
span = Span(doc, 0, 1)
print(span.text)
Output
| Posted By - | Karan Gupta |
| |
| Posted On - | Monday, December 29, 2025 |