- 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 - Doc.get_extension Classmethod
As the name implies, this class method will look up for a previously extension by name. It was also introduced in version 2.0 and will return a 4-tuple (default, method, getter, setter) value.
Example
An example of Doc.get_extension classmethod is given below −
import spacy nlp_model = spacy.load("en_core_web_sm") from spacy.tokens import Doc Doc.set_extension('has_city', default=False, force = True) extension = Doc.get_extension('has_city') extension
Output
(False, None, None, None)
spacy_containers.htm
Advertisements