- spaCy Tutorial
- spaCy - Home
- spaCy - Introduction
- spaCy - Getting Started
- spaCy - Models and Languages
- spaCy - Architecture
- spaCy - Command Line Helpers
- spaCy - Top-level Functions
- spaCy - Visualization Function
- spaCy - Utility Functions
- spaCy - Compatibility Functions
- spaCy - Containers
- Doc Class ContextManager and Property
- spaCy - Container Token Class
- spaCy - Token Properties
- spaCy - Container Span Class
- spaCy - Span Class Properties
- spaCy - Container Lexeme Class
- Training Neural Network Model
- Updating Neural Network Model
- spaCy Useful Resources
- spaCy - Quick Guide
- spaCy - Useful Resources
- spaCy - Discussion
spaCy - Span._ _len_ _ Method
As name implies, this method of Span class will get the number of tokens in span.
Example
An example of Span._ _len_ _ method is given below −
import spacy nlp_model = spacy.load("en_core_web_sm") doc = nlp_model("This is Tutorialspoint.com.") span = doc[1:4] len(span)
Output
When you run the code, you will see the following output −
3
spacy_container_span_class.htm
Advertisements