- 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 - Util.load_model
It is introduced in version 2.0 and is like spacy.load() function. As the name implies, this utility function will load a model via the following −
Its shortcut links.
The name of the installed model package
A Unicode paths.
Path-like object.
If a model is loaded from a shortcut link or package name, spaCy will assume it as a Python package and call the model’s own load() method.
On the other hand, if a model is loaded from a path, spacy will assume it is a data directory and hence initialize the Language class.
Arguments
The table below explains its arguments −
NAME | TYPE | DESCRIPTION |
---|---|---|
name | unicode / Path | It is the shortcut link, package name or path of the model to load. |
disable | List | It represents the names of pipeline components to disable. |
Example
An example for util.load_model() utility function is stated below −
import spacy
Following is an example of util.load_model utility function by using the shortcut link −
nlp_model = spacy.util.load_model("en")
Following is an example of util.load_model utility function by using the package −
nlp_model = spacy.util.load_model("en_core_web_sm")
Following is an example of util.load_model utility function by using the Unicode path −
nlp_model = spacy.util.load_model ("/path/to/data")
To Continue Learning Please Login
Login with Google