spaCy
Last updated
Last updated
spaCy
is a popular library for advanced Natural Language Processing used widely across industry. spaCy
makes it easy to use and train pipelines for tasks like named entity recognition, text classification, part of speech tagging and more, and lets you build powerful applications to process and analyze large volumes of text.
The official models from spaCy
3.3 are in the spaCy
Organization Page. Anyone in the community can also share their spaCy
models, which you can find by filtering at the left of the models page.
All models on the Hub come up with useful features
An automatically generated model card with label scheme, metrics, components, and more.
An evaluation sections at top right where you can look at the metrics.
Metadata tags that help for discoverability and contain information such as license and language.
An interactive widget you can use to play out with the model directly in the browser
An Inference API that allows to make inference requests.
All spaCy
models from the Hub can be directly installed using pip install.
Copied
To find the link of interest, you can go to a repository with a spaCy
model. When you open the repository, you can click Use in spaCy
and you will be given a working snippet that you can use to install and load the model!
Once installed, you can load the model as any spaCy pipeline.
Copied
The spacy-huggingface-hub
library extends spaCy
native CLI so people can easily push their packaged models to the Hub.
You can install spacy-huggingface-hub from pip:
Copied
You can then check if the command has been registered successfully
Copied
To push with the CLI, you can use the huggingface-hub push
command as seen below.
Copied
--org
, -o
str
Optional name of organization to which the pipeline should be uploaded.
--msg
, -m
str
Commit message to use for update. Defaults to "Update spaCy pipeline"
.
--local-repo
, -l
str / Path
Local path to the model repository (will be created if it doesnβt exist). Defaults to hub
in the current working directory.
--verbose
, -V
bool
Output additional info for debugging, e.g. the full generated hub metadata.
You can then upload any pipeline packaged with spacy package
. Make sure to set --build wheel
to output a binary .whl file. The uploader will read all metadata from the pipeline package, including the auto-generated pretty README.md
and the model details available in the meta.json
.
Copied
In just a minute, you can get your packaged model in the Hub, try it out directly in the browser, and share it with the rest of the community. All the required metadata will be uploaded for you and you even get a cool model card.
The command will output two things:
Where to find your repo in the Hub! For example, https://huggingface.co/spacy/en_core_web_sm
And how to install the pipeline directly from the Hub!
You can use the push
function from Python. It returns a dictionary containing the "url"
and βwhl_url
β of the published model and the wheel file, which you can later install with pip install
.
Copied
spacy-huggingface-hub library.
Launch blog post
spaCy v 3.1 Announcement
spaCy documentation