- 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.check_flag Method
This method is used to check the value of a Boolean flag.
Argument
The table below explains its argument −
NAME | TYPE | DESCRIPTION |
---|---|---|
flag_id | Int | It represents the attribute ID of the flag which is to be checked. |
Example 1
An example of Token.check_flag method is given below −
import spacy nlp_model = spacy.load("en_core_web_sm") from spacy.attrs import IS_TITLE doc = nlp_model("This is TutorialsPoint.com.") token = doc[0] token.check_flag(IS_TITLE)
Output
The output is mentioned below −
True
Example 2
An another example of Token.check_flag method is given below −
token = doc[1] token.check_flag(IS_TITLE)
Output
False
spacy_container_token_class.htm
Advertisements
To Continue Learning Please Login
Login with Google