- 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 - Token.get_extension Classmethod
As the name implies, this class method will look up for a previous extension by name. It was also introduced in version 2.0 and will return a 4-tuple(default, method, getter, setter) value.
Argument
The table below explains its argument −
NAME | TYPE | DESCRIPTION |
---|---|---|
Name | Unicode | This argument represents the name of the extension. |
Example
An example of Token.get_extension class method is given below −
import spacy nlp_model = spacy.load("en_core_web_sm") from spacy.tokens import Token Token.set_extension("is_fruit", default=False, force=True) extension_to_check = Token.get_extension("is_fruit") extension_to_check
Output
The output is stated below −
(False, None, None, None)
spacy_container_token_class.htm
Advertisements
To Continue Learning Please Login
Login with Google