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 statistical models and word vectors, and currently supports tokenization for 60+ languages. It features state-of-the-art speed, convolutional neural network models for tagging, parsing and named entity recognition and easy deep learning integration. It's commercial open-source software, released under the MIT license.

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

🌙 Version 3.0 (nightly) out now! Check out the release notes here.

Azure Pipelines Travis Build Status Current Release Version pypi Version conda Version Python wheels PyPi downloads Conda downloads Model downloads Code style: black 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 v2.3 New features, backwards incompatibilities and migration guide.
API Reference The detailed reference for spaCy's API.
Models Download statistical language models for spaCy.
Universe Libraries, extensions, demos, books and courses.
Changelog Changes and version history.
Contribute How to contribute to the spaCy project and code base.

💬 Where to ask questions

The spaCy project is maintained by @honnibal and @ines, along with core contributors @svlandeg and @adrianeboyd. 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

  • Non-destructive tokenization
  • Named entity recognition
  • Support for 50+ languages
  • pretrained statistical models and word vectors
  • State-of-the-art speed
  • Easy deep learning integration
  • Part-of-speech tagging
  • Labelled dependency parsing
  • Syntax-driven sentence segmentation
  • Built in visualizers for syntax and NER
  • Convenient string-to-hash mapping
  • Export to numpy data arrays
  • Efficient binary serialization
  • Easy model packaging and deployment
  • 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 2.7, 3.5+ (only 64 bit)
  • Package managers: pip · conda (via conda-forge)

pip

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

pip install -U pip setuptools wheel
pip install spacy

For installation on python 2.7 or 3.5 where binary wheels are not provided for the most recent versions of the dependencies, you can prefer older binary wheels over newer source packages with --prefer-binary:

pip install spacy --prefer-binary

To install additional data tables for lemmatization and normalization in spaCy v2.2+ 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 for v2.2+ plus normalization data for v2.3+, 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

Thanks to our great community, we've finally re-added conda support. You can now install spaCy via conda-forge:

conda install -c conda-forge spacy

For the feedstock including the build recipe and configuration, check out this repository. Improvements and pull requests to the recipe and setup are always appreciated.

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 1.x to spaCy 2.x, see the migration guide.

Download models

As of v1.7.0, models 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 Models Detailed model descriptions, accuracy figures and benchmarks.
Models Documentation Detailed usage instructions.
# download best-matching version of specific model for your spaCy installation
python -m spacy download en_core_web_sm

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

Loading and using models

To load a model, use spacy.load() with the model name, a shortcut link 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. See notes on Ubuntu, OS X and Windows for details.

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 .

To install with extras:

pip install .[lookups,cuda102]

To install all dependencies required for development:

pip install -r requirements.txt

Compared to regular install via pip, requirements.txt additionally installs developer dependencies such as Cython. 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.

Ubuntu

Install system-level dependencies via apt-get:

sudo apt-get install build-essential python-dev git

macOS / OS X

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 official distributions these are VS 2008 (Python 2.7), VS 2010 (Python 3.4) and VS 2015 (Python 3.5).

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

See the documentation for more details and examples.

Project details


Release history Release notifications | RSS feed

This version

2.3.7

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

spacy-2.3.7.tar.gz (5.8 MB view details)

Uploaded Source

Built Distributions

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

spacy-2.3.7-cp39-cp39-win_amd64.whl (9.4 MB view details)

Uploaded CPython 3.9Windows x86-64

spacy-2.3.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

spacy-2.3.7-cp39-cp39-macosx_10_9_x86_64.whl (10.1 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

spacy-2.3.7-cp38-cp38-win_amd64.whl (9.7 MB view details)

Uploaded CPython 3.8Windows x86-64

spacy-2.3.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.5 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

spacy-2.3.7-cp38-cp38-macosx_10_9_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

spacy-2.3.7-cp37-cp37m-win_amd64.whl (9.6 MB view details)

Uploaded CPython 3.7mWindows x86-64

spacy-2.3.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.4 MB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

spacy-2.3.7-cp37-cp37m-macosx_10_9_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

spacy-2.3.7-cp36-cp36m-win_amd64.whl (9.6 MB view details)

Uploaded CPython 3.6mWindows x86-64

spacy-2.3.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.4 MB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.17+ x86-64

spacy-2.3.7-cp36-cp36m-macosx_10_9_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

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

File metadata

  • Download URL: spacy-2.3.7.tar.gz
  • Upload date:
  • Size: 5.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7.tar.gz
Algorithm Hash digest
SHA256 c0f2315fea23497662e28212f89af3a03667f97c867c597b599c37ab84092e22
MD5 df5c8fb09fe716783d4706f34325d6c1
BLAKE2b-256 791c7c5f7541eb883181b564a8c8ba15d21b2d7b8a38ae32f31763575cf8857d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.7-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 9.4 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 abddbf424233a842aec91119bc8c4578890c587809d33f353f334a5383d8f490
MD5 608f5f7cf900c7bea08db129c67404f0
BLAKE2b-256 3a8f805c4edfee60416852bd6f566569b1e6fcac9c041d8b850459f559a13daf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 10.3 MB
  • Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c831bcec3f3c0b425f753248763c838b57f31edfca2dfcafce205f6f2b548d7e
MD5 8bb180af407fb9c4d231eb3b6b381857
BLAKE2b-256 7d4b9bfd1caea58fe5cf810754bedb59ecfda6cc9c81da01afa88896be120f73

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.7-cp39-cp39-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 10.1 MB
  • Tags: CPython 3.9, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 96eaa20d6074158b5686740a40ba78aac4f52759f8acec8af9db4d586bc49f1f
MD5 013945951d4e823a05ae295a12207a9f
BLAKE2b-256 345247e757e2a31853714c857ba626d00fc4bf7970ea0e91ff2d68d8a7c33f48

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.7-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 9.7 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2d454e4d08c8263ab0bb4e63445e9565c5924f588dcf26bcb0add3a4d98a6042
MD5 7d7811c327fd2b953748787abf9688f6
BLAKE2b-256 48f42e7d937bf1bff66d89b0f1c90ec59ea897af377fee4ab1bdfe586ec1fdeb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 10.5 MB
  • Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0416e708c0b672e79400aeade070d2ec91052ca9942cc378ee9f833a3ae9b6ed
MD5 f042f4ebcbf5afa0621bb9d6ddddec1e
BLAKE2b-256 d98933663256e4a9d3f61c9e51d9310728c524c842de5e1325db69bb0e0d2aba

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.7-cp38-cp38-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 10.3 MB
  • Tags: CPython 3.8, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 c774d5cd869c0d086fd092eeacbb72296c8d470dda73bc45ed9f9f9ca5822759
MD5 aa831bde1a43de1cfb875f93fb79a0c9
BLAKE2b-256 bf6220691634945f8b411281e82693584dadcec2100f595e12956e45c2dbad8c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.7-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 9.6 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 34570a7571d8bf08c696003423589b750ac684c0b79f3e3672e3d941a44f2452
MD5 abaff9a59c4bf6a121b83edb81c65044
BLAKE2b-256 329b03d87be5ba617b1dec5c356539b3494aaf200a00fdc5636a15bf0aebb673

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spacy-2.3.7-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b4f1a02d62e861a044b8fbe8a0ce89e49d5a63c3a5bfc5849cb1d4f0247b8ab9
MD5 132ac91648152921b3ea7134adb1f152
BLAKE2b-256 4487c70718b897a9507cf66ec73bbf0b82e049e4e9d35eee5cc3a49bc32a7a90

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.7-cp37-cp37m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 10.2 MB
  • Tags: CPython 3.7m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 4942670ee16e153ddb6d5ae85eb03c39c33a2ef19b9ea0423d28f63536e21d72
MD5 4291db25255f19ae223a555c499d68a0
BLAKE2b-256 c0542af33a79e2fcc2f753ed403bb26b6e64b1fad18d79884cb4ce5dd44a0e8f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.7-cp36-cp36m-win_amd64.whl
  • Upload date:
  • Size: 9.6 MB
  • Tags: CPython 3.6m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 65ecac35b9812f146d99d91610d38f9b8d849a8164fccf0fdcfd4cf7e2826618
MD5 77d2b23907df341bd22c6764405e1192
BLAKE2b-256 f0a0ce83996016f6b1ccd29f0d30188238149a5dc568718bf6355f8f43b1ca56

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spacy-2.3.7-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fc59c5cf8f363d7c1dfd779bae7eafe99dc98a74063267f9f8df4154b65f7a2f
MD5 6b9e57ec511fe8d1b3471c1a195353fc
BLAKE2b-256 612f9f75b1c726543c5b34af490f1f39576beb67630d1511f049c5ba09f8c986

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.7-cp36-cp36m-macosx_10_9_x86_64.whl
  • Upload date:
  • Size: 10.2 MB
  • Tags: CPython 3.6m, macOS 10.9+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.7-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6ebc5a7f7da70a793cc1d2569097bdf80fbce66d7e39e17a157f95c258bec78d
MD5 ea0346f9c411eccb44d5c9ba0bfe1edd
BLAKE2b-256 7c976ef9dd0941acb71be674f1f5e48a255535147bb68efd1fb36d5e44ee2260

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