Skip to main content

Industrial-strength Natural Language Processing (NLP) in Python

Project description

spaCy: Industrial-strength NLP

spaCy is a library for advanced Natural Language Processing in Python and Cython. It's built on the very latest research, and was designed from day one to be used in real products.

spaCy comes with pretrained pipelines and currently supports tokenization and training for 60+ languages. It features state-of-the-art speed and neural network models for tagging, parsing, named entity recognition, text classification and more, multi-task learning with pretrained transformers like BERT, as well as a production-ready training system and easy model packaging, deployment and workflow management. spaCy is commercial open-source software, released under the MIT license.

💫 Version 3.2 out now! Check out the release notes here.

Azure Pipelines Current Release Version pypi Version conda Version Python wheels Code style: black
PyPi downloads Conda downloads spaCy on Twitter

📖 Documentation

Documentation
⭐️ spaCy 101 New to spaCy? Here's everything you need to know!
📚 Usage Guides How to use spaCy and its features.
🚀 New in v3.0 New features, backwards incompatibilities and migration guide.
🪐 Project Templates End-to-end workflows you can clone, modify and run.
🎛 API Reference The detailed reference for spaCy's API.
📦 Models Download trained pipelines for spaCy.
🌌 Universe Plugins, extensions, demos and books from the spaCy ecosystem.
👩‍🏫 Online Course Learn spaCy in this free and interactive online course.
📺 Videos Our YouTube channel with video tutorials, talks and more.
🛠 Changelog Changes and version history.
💝 Contribute How to contribute to the spaCy project and code base.
spaCy Tailored Pipelines Get a custom spaCy pipeline, tailor-made for your NLP problem by spaCy's core developers. Streamlined, production-ready, predictable and maintainable. Start by completing our 5-minute questionnaire to tell us what you need and we'll be in touch! Learn more →

💬 Where to ask questions

The spaCy project is maintained by the spaCy team. Please understand that we won't be able to provide individual support via email. We also believe that help is much more valuable if it's shared publicly, so that more people can benefit from it.

Type Platforms
🚨 Bug Reports GitHub Issue Tracker
🎁 Feature Requests & Ideas GitHub Discussions
👩‍💻 Usage Questions GitHub Discussions · Stack Overflow
🗯 General Discussion GitHub Discussions

Features

  • Support for 60+ languages
  • Trained pipelines for different languages and tasks
  • Multi-task learning with pretrained transformers like BERT
  • Support for pretrained word vectors and embeddings
  • State-of-the-art speed
  • Production-ready training system
  • Linguistically-motivated tokenization
  • Components for named entity recognition, part-of-speech-tagging, dependency parsing, sentence segmentation, text classification, lemmatization, morphological analysis, entity linking and more
  • Easily extensible with custom components and attributes
  • Support for custom models in PyTorch, TensorFlow and other frameworks
  • Built in visualizers for syntax and NER
  • Easy model packaging, deployment and workflow management
  • Robust, rigorously evaluated accuracy

📖 For more details, see the facts, figures and benchmarks.

⏳ Install spaCy

For detailed installation instructions, see the documentation.

  • Operating system: macOS / OS X · Linux · Windows (Cygwin, MinGW, Visual Studio)
  • Python version: Python 3.6+ (only 64 bit)
  • Package managers: pip · conda (via conda-forge)

pip

Using pip, spaCy releases are available as source packages and binary wheels. Before you install spaCy and its dependencies, make sure that your pip, setuptools and wheel are up to date.

pip install -U pip setuptools wheel
pip install spacy

To install additional data tables for lemmatization and normalization you can run pip install spacy[lookups] or install spacy-lookups-data separately. The lookups package is needed to create blank models with lemmatization data, and to lemmatize in languages that don't yet come with pretrained models and aren't powered by third-party libraries.

When using pip it is generally recommended to install packages in a virtual environment to avoid modifying system state:

python -m venv .env
source .env/bin/activate
pip install -U pip setuptools wheel
pip install spacy

conda

You can also install spaCy from conda via the conda-forge channel. For the feedstock including the build recipe and configuration, check out this repository.

conda install -c conda-forge spacy

Updating spaCy

Some updates to spaCy may require downloading new statistical models. If you're running spaCy v2.0 or higher, you can use the validate command to check if your installed models are compatible and if not, print details on how to update them:

pip install -U spacy
python -m spacy validate

If you've trained your own models, keep in mind that your training and runtime inputs must match. After updating spaCy, we recommend retraining your models with the new version.

📖 For details on upgrading from spaCy 2.x to spaCy 3.x, see the migration guide.

📦 Download model packages

Trained pipelines for spaCy can be installed as Python packages. This means that they're a component of your application, just like any other module. Models can be installed using spaCy's download command, or manually by pointing pip to a path or URL.

Documentation
Available Pipelines Detailed pipeline descriptions, accuracy figures and benchmarks.
Models Documentation Detailed usage and installation instructions.
Training How to train your own pipelines on your data.
# Download best-matching version of specific model for your spaCy installation
python -m spacy download en_core_web_sm

# pip install .tar.gz archive or .whl from path or URL
pip install /Users/you/en_core_web_sm-3.0.0.tar.gz
pip install /Users/you/en_core_web_sm-3.0.0-py3-none-any.whl
pip install https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.0.0/en_core_web_sm-3.0.0.tar.gz

Loading and using models

To load a model, use spacy.load() with the model name or a path to the model data directory.

import spacy
nlp = spacy.load("en_core_web_sm")
doc = nlp("This is a sentence.")

You can also import a model directly via its full name and then call its load() method with no arguments.

import spacy
import en_core_web_sm

nlp = en_core_web_sm.load()
doc = nlp("This is a sentence.")

📖 For more info and examples, check out the models documentation.

⚒ Compile from source

The other way to install spaCy is to clone its GitHub repository and build it from source. That is the common way if you want to make changes to the code base. You'll need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, virtualenv and git installed. The compiler part is the trickiest. How to do that depends on your system.

Platform
Ubuntu Install system-level dependencies via apt-get: sudo apt-get install build-essential python-dev git .
Mac Install a recent version of XCode, including the so-called "Command Line Tools". macOS and OS X ship with Python and git preinstalled.
Windows Install a version of the Visual C++ Build Tools or Visual Studio Express that matches the version that was used to compile your Python interpreter.

For more details and instructions, see the documentation on compiling spaCy from source and the quickstart widget to get the right commands for your platform and Python version.

git clone https://github.com/explosion/spaCy
cd spaCy

python -m venv .env
source .env/bin/activate

# make sure you are using the latest pip
python -m pip install -U pip setuptools wheel

pip install -r requirements.txt
pip install --no-build-isolation --editable .

To install with extras:

pip install --no-build-isolation --editable .[lookups,cuda102]

🚦 Run tests

spaCy comes with an extensive test suite. In order to run the tests, you'll usually want to clone the repository and build spaCy from source. This will also install the required development dependencies and test utilities defined in the requirements.txt.

Alternatively, you can run pytest on the tests from within the installed spacy package. Don't forget to also install the test utilities via spaCy's requirements.txt:

pip install -r requirements.txt
python -m pytest --pyargs spacy

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

spacy-3.3.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

spacy-3.3.0-cp310-cp310-win_amd64.whl (11.7 MB view details)

Uploaded CPython 3.10Windows x86-64

spacy-3.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

spacy-3.3.0-cp310-cp310-macosx_11_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

spacy-3.3.0-cp310-cp310-macosx_10_9_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

spacy-3.3.0-cp39-cp39-win_amd64.whl (11.6 MB view details)

Uploaded CPython 3.9Windows x86-64

spacy-3.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

spacy-3.3.0-cp39-cp39-macosx_11_0_arm64.whl (6.3 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

spacy-3.3.0-cp39-cp39-macosx_10_9_x86_64.whl (6.5 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

spacy-3.3.0-cp38-cp38-win_amd64.whl (12.0 MB view details)

Uploaded CPython 3.8Windows x86-64

spacy-3.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

spacy-3.3.0-cp38-cp38-macosx_11_0_arm64.whl (6.2 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

spacy-3.3.0-cp38-cp38-macosx_10_9_x86_64.whl (6.4 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

spacy-3.3.0-cp37-cp37m-win_amd64.whl (11.9 MB view details)

Uploaded CPython 3.7mWindows x86-64

spacy-3.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

spacy-3.3.0-cp37-cp37m-macosx_10_9_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

spacy-3.3.0-cp36-cp36m-win_amd64.whl (12.4 MB view details)

Uploaded CPython 3.6mWindows x86-64

spacy-3.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.2 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

spacy-3.3.0-cp36-cp36m-macosx_10_9_x86_64.whl (6.3 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file spacy-3.3.0.tar.gz.

File metadata

  • Download URL: spacy-3.3.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.9

File hashes

Hashes for spacy-3.3.0.tar.gz
Algorithm Hash digest
SHA256 c49d50fbe3715adc5741419367b39a468d2556648422f10b6fc4edf38eae2cb3
MD5 ca24c6b2477e2570e4ddff8f5a6d9a88
BLAKE2b-256 1991423c456618dab93adfa53ccf19f6d59057226984c19bb7b196d9234cb0c2

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: spacy-3.3.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 11.7 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.9

File hashes

Hashes for spacy-3.3.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ea9cabc081a7732e755dd44fbd818185ac829fcb431273a994af33d65e709281
MD5 c15a04635cc3122c2a379b03f2f63e4d
BLAKE2b-256 0f6c34f438d7ece16859b0ba2a9aee72a1f8d645690d519314f57ffd800b98d5

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7dd213224a9429cc190698294607fae0b9b94d06995e155f72c551fec66c39f4
MD5 c33a942d33db73f7b02a5f4d9647edf5
BLAKE2b-256 66b03434d51c5c25b22b3cf8a2c8167b09d46ebd4811d237eb24a0b405ad2edd

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be8bd1d5805aa974453edbcf387289ebb47c881ba3a347e03359d16bcacf1866
MD5 fd1fd85b37085630741ae04cb7483a5a
BLAKE2b-256 a60a3ff086f9fafc865271140b23b751980c72dc91992c309a2ad0ae88c56a34

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 521df508803a924df0ea489f286e3a17d5e6eb58a22ea643ddaa544fe5a02226
MD5 e8ab7c68ee91965a6cff4446efc89ccd
BLAKE2b-256 55de28fb794c4b8c021525a9c1585a44245d9a677cb0bee9d3748b805c4b83b0

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: spacy-3.3.0-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 11.6 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.9

File hashes

Hashes for spacy-3.3.0-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1f1c5b86daee2b1b4e60ce7c9f7a953ea60dbfe6c9c4acf3bc3c0b5a4332d475
MD5 adc46e6829521d5e703e36c902dd6561
BLAKE2b-256 753c42fbb5a1d5ccdeefc95ced404be99b372dbafeabfa496be768795b226770

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ebdb29392c7c6d9137127b2a4fee293c8b12e7e69277362bf744f20f3dba7a89
MD5 2ff4b851a72988e88c7622bcf8e55f73
BLAKE2b-256 278468d3a3713edb4adee30aace3b770302f458624de20b5123faa3a13a80fe0

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3e5da14df6f1e9bf490962fd2390cc3a7271994a0cec2c8f1936f177617d1d52
MD5 a450ca79521f3a3bda0698226fc62c3a
BLAKE2b-256 84a51bf5c3afbc7d3ede0f1e796e7a9242a7a20bd9523cb3f4c15b7f53e7d1e1

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b3bdbafaf2f084cadffab95df70bc4c99441c13de9c3364078dbd99888736931
MD5 b5b585c738f71cb79f48a6d6a85a8763
BLAKE2b-256 5c64789f2f1443b7d883933009586b6fe6102698f63c18c00b63d069c38c3288

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: spacy-3.3.0-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 12.0 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.9

File hashes

Hashes for spacy-3.3.0-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2070074032a1f008751cd298d32785fbcc07ec09916fa94e962f81c2a76e4976
MD5 2d3b94ce3b9254028fe5b5c3514e242a
BLAKE2b-256 03707dc0a24d538c3b526fc796cfeb8ecb1d2e4c35e0ed264069cab76ab23569

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 df252e1b1d55068600eab4ef3e602eb32487f08704e44a85f82478e56aed9838
MD5 1cb1c86ef62cbf78c483ede2e2e643b6
BLAKE2b-256 241b2bd2154dd633d00261bffffef8813f9925214569625290a7d75aebc94f11

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 818aa0fde582f4c839831b40704622c4b7e4e59bdffa68eda328e6f6bd2855b0
MD5 72574f9371bf7dfa4b0d04dff0a48f6d
BLAKE2b-256 661d17ed4ee350e132b42b4db7c2b1707d61407589a3406783a9dd0ee301951f

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3639e0381b70e27841c0ce5e96bd83d7173c8356bcae69163598964b12db2646
MD5 2473d6f1d9ddc3d9a6f646bf51686ee5
BLAKE2b-256 147c547d83e0e608f56235967554a2e3c47ec48270095b333b46f79dd25a51aa

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: spacy-3.3.0-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 11.9 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.9

File hashes

Hashes for spacy-3.3.0-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 6ed92892c3d5829ed79fea188f134a9c99ff7bfa60354d023f64a77bacabd761
MD5 9cdc9fae954431b17ddb03c12aaaf0e0
BLAKE2b-256 43a7fefe389eaa92a7a9179423afd5e45cc16c30e2cb77bda0d77b304fef8fef

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cae5187f1fdb4f3478ebdb3f299d1f6c7c7f9c4b3cdd3ba9e74a7a3e566ecd7f
MD5 c6c7c850b4ee9db8ab4cd9f940bfa884
BLAKE2b-256 1116d8f37652757667e2bdf1d22d20f024ee2b705e9c2abda8700ba637a7d7b4

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 00e99c1c4c655283e1165fdb49a234034af09050d2c68b87fe1fb9d49fbb7aa4
MD5 e3e763d106eef146d0573352076898a6
BLAKE2b-256 29039a57f811f96f464902cb2c64138d01091f76ffb4ef9b711e69ce2c56e075

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: spacy-3.3.0-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 12.4 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.7.9

File hashes

Hashes for spacy-3.3.0-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 a2fb91e326c7f6682751a194447f6708b957fcad7589f97546986973c70774a7
MD5 cc480f6f6039f2f68bb9f20b44b679e5
BLAKE2b-256 36a5974a77d5a2c6b1f6878c623825b2e13adce955c3c291f62567327cb2566e

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 899c857cb6b193783a483fbc46c2ed39cc02f97252489ee6029944e6ca140046
MD5 f74e80398fa20bd3cee477f9819c4a1c
BLAKE2b-256 e4f83b9aae4a2fde2b3c03e265042ab983f240079b842bbaacb568e99116821d

See more details on using hashes here.

File details

Details for the file spacy-3.3.0-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for spacy-3.3.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 054f6596c0ac52fbdd1690ccdab37d8b286706bfa698abf6c7db3194f0c8dc59
MD5 f608a08583f47ee1505ae7166bb5bda8
BLAKE2b-256 b9202cae65fd27221434c4608597b89e945d88cbd236aae8c7fdc34a22b1558a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page