Download and load spaCy models on-the-fly.
Project description
Download and load spaCy models on-the-fly
A tiny drop-in replacement for spacy.load()
that automatically downloads a model when it is not currently installed.
pip install spacy_download
Usage is identical to spacy.load()
, meaning that you can also exclude
or disable pipeline components. Example:
from spacy_download import load_spacy
# Will download the model if it isn't installed yet
nlp = load_spacy("en_core_web_sm", exclude=["parser", "tagger"])
Under the hood, the package makes use of spaCy's capability to import models as modules, rather than using spaCy's
built-in loader. This allows us to first download a model with pip
and then load it as a module.
Note: if you are using transformer models, you still need to install spacy-transformers
yourself!
WARNING: loading models on the fly can be useful, but it is not an officially supported feature. It should work fine with the official models at the time of writing, but I cannot guarantee that this will always be the case. Use at your own risk.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file spacy_download-1.1.0.tar.gz
.
File metadata
- Download URL: spacy_download-1.1.0.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3f87a6a5dad7b6dcdb9ae2e37a05f4aa9275a99db8ce019ce4af5661d4278d2d |
|
MD5 | 42f177c75b8db129a5327108f9f3c498 |
|
BLAKE2b-256 | 643f86e45af63cbde24ff05bb08d39e787da49a21828cb2518605b661a4d8ca6 |
File details
Details for the file spacy_download-1.1.0-py3-none-any.whl
.
File metadata
- Download URL: spacy_download-1.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9981af7d59449faec1ca762b8c2fbb4227f978f6bf4cd8151fc698247dea7dad |
|
MD5 | e07b0ed84c36713e052b0f770f50f193 |
|
BLAKE2b-256 | 2ef0fd7478790171274fdb697a9d306981b59c9781d96aee3bb41368eeecd4db |