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

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.6.tar.gz (5.9 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.6-cp39-cp39-win_amd64.whl (9.4 MB view details)

Uploaded CPython 3.9Windows x86-64

spacy-2.3.6-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.6-cp39-cp39-macosx_10_9_x86_64.whl (10.1 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

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

Uploaded CPython 3.8Windows x86-64

spacy-2.3.6-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.6-cp38-cp38-macosx_10_9_x86_64.whl (10.3 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

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

Uploaded CPython 3.7mWindows x86-64

spacy-2.3.6-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.6-cp37-cp37m-macosx_10_9_x86_64.whl (10.2 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

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

Uploaded CPython 3.6mWindows x86-64

spacy-2.3.6-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.6-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.6.tar.gz.

File metadata

  • Download URL: spacy-2.3.6.tar.gz
  • Upload date:
  • Size: 5.9 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.6.tar.gz
Algorithm Hash digest
SHA256 2e305989de6be9ddaeaaad9b7fc9f96ca60fa8797445a710f843cd01c07d8180
MD5 49b849cb92b670b281a74d573ede023a
BLAKE2b-256 66a92f2a6e17529cb1bd3e5f578a37e8bcf1611c40b8b2fe3ce0e826e98c95f5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.6-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.6-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 b698c0e0cddf5cd5a32a5c60183879541a862ff1513240f613aefd09c8c866b9
MD5 3e8f18595e51570597096c211126af31
BLAKE2b-256 ee5c9099040104f6b756204248be287a8ad42a63bf6c31c4fb8082011c2e6388

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.6-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.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ad7d505a204f82c631d439743361c416052b01cdfd441695d611994cde5f248c
MD5 383aa40181ee9f6338754d907fbf16ce
BLAKE2b-256 383d25f1e95b284b946765577518eb10684bbd10c7cbf04d42effd936713bf25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.6-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.6-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5ecdf706bf6f5de353d4ab759d98eb3f77dcb832e99688822825905209a71df2
MD5 b99405a150b100339d427bf702a1f8b9
BLAKE2b-256 648dd48fb2a5dd37c358c381bc886136cbd979dfd205e495a44c63283ee320b2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.6-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.6-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 e02b3277bf1e3ddab804024a72e694942aed616c3ec0cfab3536494d789a4bf0
MD5 fba0ebf02c117048587d6024a770822e
BLAKE2b-256 6b3a30ecb55c53f7d720800addf2940c70f8ef3b6890f9b74de6514fc6b96b79

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.6-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.6-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7821aada1b36696651841da79bffe877f498f065e9da6fae66cf228dfc9d3cd8
MD5 b66efe3dd930dd636645c4efa721da80
BLAKE2b-256 239ecd009a701e9974fee0cd8d84e6e6777e76b688f7e5d52c378d043ecc9c8a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.6-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.6-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 8787fbf72c068668627a779347792de3c1dff95e614ab44a84f68d2aad44ff56
MD5 319041529b8c287f5967d9ead0ee9feb
BLAKE2b-256 8e8e6da1b44ab69673f23b289bfb535e91101855dcfca0124ab9641d22e2b8bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.6-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.6-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 e5eed6ae11893af52acc81dd4957b092403f76b74131d1dc7034ca6d6cd5f1f8
MD5 118f4a0825361b5d1630593a01e117d7
BLAKE2b-256 1e230a8d794aa49aa2cdad0d56da06fc2d94aafd9bb66e871a8eaecf6456cda9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spacy-2.3.6-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 114af6cac5195e18f804bf7ee7228f3beada9d4b6495bcec282bcd1061a97fa2
MD5 0844661589bdd136b5835ad2fa70cc0f
BLAKE2b-256 453bca730628aed6cbbd70b00ecb3f698c8bf03374842998f3b842070b593ee2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.6-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.6-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5a30d37c00cebdddfdbfc0945d63b8ff94f5864e7fc5b5acd975c46f18b1c6d9
MD5 5b449c0e8806d735c810d27b8a8f8d46
BLAKE2b-256 707a567e52173a57171b2bafac4081c9f462c73fd744631f4e99871c107cb156

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.6-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.6-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 c31e305aade30276a6693206a2fe17daa6e4b4e626aacc221c2a3bb1b6b5e6a6
MD5 686fb879144d341474b980ce9de933cf
BLAKE2b-256 5f151d3afb49acb42348788e7a32106ff02bac49ad180ad584cd2199f79c9707

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for spacy-2.3.6-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0c81e8e39129838b631e073c3661d7e498a3e62fb7e77f830ccbe5519512fc1a
MD5 c2d0589a3de0961550d7b03b9d666f02
BLAKE2b-256 6f7218520873ef9686bf822e5bcb560fe129de0dba7f690a174f7dd12f2cc636

See more details on using hashes here.

File details

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

File metadata

  • Download URL: spacy-2.3.6-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.60.0 CPython/3.7.9

File hashes

Hashes for spacy-2.3.6-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3276d9d0bafe48572e24daab36491b93b61ea4efa1f1b6b7ad55fe58f996aabe
MD5 ec4d0549dcfe67f755b66617c6180d73
BLAKE2b-256 295645003212525b2d9a938f88df947df3088d3447f9af0f181758dc9030f28b

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