- 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.vector_norm Property
This doc property represents the L2 norm of the document’s vector representation.
Example 1
Refer the example of Doc.vector_norm property given below −
import spacy nlp_model = spacy.load("en_core_web_sm") doc1 = nlp_model("The website is Tutorialspoint.com.") doc2 = nlp_model("It is having best technical tutorials.") doc1.vector_norm
Output
11.126218933074995
Example 2
Given below is an example of Doc.vector_norm property −
doc2.vector_norm
Output
9.99526963324649
Example 3
Here is another example of Doc.vector_norm property.
doc1.vector_norm != doc2.vector_norm
Output
True
spacy_doc_class_contextmanager_and_property.htm
Advertisements