- 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.noun_chunks Property
This doc property is used to iterate over the base noun phrases in a particular document. If the document has been syntactically parsed, then this property will yield base noun-phrase Span objects.
Example 1
An example of Doc.noun_chunks property is as follows −
import spacy nlp_model = spacy.load("en_core_web_sm") doc = nlp_model("The website is Tutorialspoint.com.") chunks = list(doc.noun_chunks) chunks[0].text
Output
The output is mentioned below −
'The website'
Example 2
Here is an example of Doc.noun_chunks property −
chunks[1].text
Output
'Tutorialspoint.com'
spacy_doc_class_contextmanager_and_property.htm
Advertisements