spacy-transformers 1.3.9


pip install spacy-transformers

  Latest version

Released: May 26, 2025

Project Links

Meta
Author: Explosion
Requires Python: <3.14,>=3.9

Classifiers

Development Status
  • 5 - Production/Stable

Environment
  • Console

Intended Audience
  • Developers
  • Science/Research

Topic
  • Scientific/Engineering
  • Scientific/Engineering :: Artificial Intelligence

License
  • OSI Approved :: MIT License

Operating System
  • POSIX :: Linux
  • MacOS :: MacOS X
  • Microsoft :: Windows

Programming Language
  • Python :: 3
  • Python :: 3.7
  • Python :: 3.8
  • Python :: 3.9
  • Python :: 3.10
  • Python :: 3.11

spacy-transformers: Use pretrained transformers like BERT, XLNet and GPT-2 in spaCy

This package provides spaCy components and architectures to use transformer models via Hugging Face's transformers in spaCy. The result is convenient access to state-of-the-art transformer architectures, such as BERT, GPT-2, XLNet, etc.

This release requires spaCy v3. For the previous version of this library, see the v0.6.x branch.

tests PyPi GitHub Code style: black

Features

  • Use pretrained transformer models like BERT, RoBERTa and XLNet to power your spaCy pipeline.
  • Easy multi-task learning: backprop to one transformer model from several pipeline components.
  • Train using spaCy v3's powerful and extensible config system.
  • Automatic alignment of transformer output to spaCy's tokenization.
  • Easily customize what transformer data is saved in the Doc object.
  • Easily customize how long documents are processed.
  • Out-of-the-box serialization and model packaging.

๐Ÿš€ Installation

Installing the package from pip will automatically install all dependencies, including PyTorch and spaCy. Make sure you install this package before you install the models. Also note that this package requires Python 3.6+, PyTorch v1.5+ and spaCy v3.0+.

pip install 'spacy[transformers]'

For GPU installation, find your CUDA version using nvcc --version and add the version in brackets, e.g. spacy[transformers,cuda92] for CUDA9.2 or spacy[transformers,cuda100] for CUDA10.0.

If you are having trouble installing PyTorch, follow the instructions on the official website for your specific operating system and requirements.

๐Ÿ“– Documentation

โš ๏ธ Important note: This package has been extensively refactored to take advantage of spaCy v3.0. Previous versions that were built for spaCy v2.x worked considerably differently. Please see previous tagged versions of this README for documentation on prior versions.

Applying pretrained text and token classification models

Note that the transformer component from spacy-transformers does not support task-specific heads like token or text classification. A task-specific transformer model can be used as a source of features to train spaCy components like ner or textcat, but the transformer component does not provide access to task-specific heads for training or inference.

Alternatively, if you only want use to the predictions from an existing Hugging Face text or token classification model, you can use the wrappers from spacy-huggingface-pipelines to incorporate task-specific transformer models into your spaCy pipelines.

Bug reports and other issues

Please use spaCy's issue tracker to report a bug, or open a new thread on the discussion board for any other issue.

1.3.9 May 26, 2025
1.3.8 Feb 06, 2025
1.3.7 Feb 03, 2025
1.3.5 Apr 25, 2024
1.3.4 Dec 19, 2023
1.3.3 Nov 08, 2023
1.3.2 Oct 12, 2023
1.3.1 Sep 26, 2023
1.3.0 Aug 01, 2023
1.2.5 Jun 12, 2023
1.2.4 May 22, 2023
1.2.3 Apr 17, 2023
1.2.2 Feb 18, 2023
1.2.1 Jan 26, 2023
1.2.0 Jan 12, 2023
1.2.0.dev0 Jan 11, 2023
1.1.9 Dec 19, 2022
1.1.8 Aug 12, 2022
1.1.7 Jul 05, 2022
1.1.6 Jun 02, 2022
1.1.5 Mar 15, 2022
1.1.4 Jan 14, 2022
1.1.3 Dec 07, 2021
1.1.2 Oct 28, 2021
1.1.1 Oct 19, 2021
1.1.0 Oct 18, 2021
1.1.0.dev4 Oct 14, 2021
1.1.0.dev3 Oct 05, 2021
1.1.0.dev2 Sep 17, 2021
1.1.0.dev1 Sep 10, 2021
1.1.0.dev0 Sep 10, 2021
1.0.6 Sep 02, 2021
1.0.5 Aug 26, 2021
1.0.4 Aug 12, 2021
1.0.3 Jun 14, 2021
1.0.2 Apr 21, 2021
1.0.1 Feb 02, 2021
1.0.1.dev0 Feb 02, 2021
1.0.0 Feb 01, 2021
1.0.0rc4 Jan 29, 2021
1.0.0rc3 Jan 26, 2021
1.0.0rc3.dev4 Jan 26, 2021
1.0.0rc3.dev3 Jan 25, 2021
1.0.0rc3.dev2 Jan 24, 2021
1.0.0rc3.dev1 Jan 24, 2021
1.0.0rc3.dev0 Jan 24, 2021
1.0.0rc2 Jan 19, 2021
1.0.0rc0 Oct 14, 2020
1.0.0a24 Oct 14, 2020
1.0.0a23 Oct 09, 2020
1.0.0a22 Oct 08, 2020
1.0.0a20 Oct 08, 2020
1.0.0a19 Oct 07, 2020
1.0.0a18 Oct 07, 2020
1.0.0a17 Oct 01, 2020
1.0.0a15 Sep 29, 2020
1.0.0a14 Sep 17, 2020
1.0.0a13 Sep 17, 2020
1.0.0a12 Sep 17, 2020
1.0.0a11 Sep 12, 2020
1.0.0a10 Sep 11, 2020
1.0.0a9 Sep 11, 2020
1.0.0a8 Aug 31, 2020
1.0.0a7 Aug 30, 2020
1.0.0a6 Jul 11, 2020
1.0.0a5 Jul 10, 2020
1.0.0a4 Jul 01, 2020
1.0.0a3 Jul 01, 2020
1.0.0a1 Jun 29, 2020
1.0.0a0 Jun 29, 2020
0.6.2 Jun 29, 2020
0.6.1 Jun 18, 2020
0.6.0 May 24, 2020
0.5.3 Jun 18, 2020
0.5.2 May 24, 2020
0.5.1 Oct 28, 2019
0.5.0 Oct 08, 2019
0.5.0.dev1 Oct 08, 2019
0.5.0.dev0 Oct 08, 2019

Wheel compatibility matrix

Platform CPython 3.9 CPython 3.10 CPython 3.11 CPython 3.12 CPython 3.13
macosx_10_13_x86_64
macosx_10_9_x86_64
macosx_11_0_arm64
manylinux2014_aarch64
manylinux2014_x86_64
manylinux_2_17_aarch64
manylinux_2_17_x86_64
musllinux_1_2_aarch64
musllinux_1_2_x86_64
win_amd64

Files in release

spacy_transformers-1.3.9-cp310-cp310-macosx_10_9_x86_64.whl (166.7KiB)
spacy_transformers-1.3.9-cp310-cp310-macosx_11_0_arm64.whl (160.0KiB)
spacy_transformers-1.3.9-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (697.5KiB)
spacy_transformers-1.3.9-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (708.8KiB)
spacy_transformers-1.3.9-cp310-cp310-musllinux_1_2_aarch64.whl (1.5MiB)
spacy_transformers-1.3.9-cp310-cp310-musllinux_1_2_x86_64.whl (1.6MiB)
spacy_transformers-1.3.9-cp310-cp310-win_amd64.whl (334.7KiB)
spacy_transformers-1.3.9-cp311-cp311-macosx_10_9_x86_64.whl (167.3KiB)
spacy_transformers-1.3.9-cp311-cp311-macosx_11_0_arm64.whl (160.4KiB)
spacy_transformers-1.3.9-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (731.9KiB)
spacy_transformers-1.3.9-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (741.0KiB)
spacy_transformers-1.3.9-cp311-cp311-musllinux_1_2_aarch64.whl (1.6MiB)
spacy_transformers-1.3.9-cp311-cp311-musllinux_1_2_x86_64.whl (1.6MiB)
spacy_transformers-1.3.9-cp311-cp311-win_amd64.whl (334.6KiB)
spacy_transformers-1.3.9-cp312-cp312-macosx_10_13_x86_64.whl (167.7KiB)
spacy_transformers-1.3.9-cp312-cp312-macosx_11_0_arm64.whl (160.1KiB)
spacy_transformers-1.3.9-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (768.0KiB)
spacy_transformers-1.3.9-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (777.2KiB)
spacy_transformers-1.3.9-cp312-cp312-musllinux_1_2_aarch64.whl (1.6MiB)
spacy_transformers-1.3.9-cp312-cp312-musllinux_1_2_x86_64.whl (1.6MiB)
spacy_transformers-1.3.9-cp312-cp312-win_amd64.whl (333.5KiB)
spacy_transformers-1.3.9-cp313-cp313-macosx_10_13_x86_64.whl (166.9KiB)
spacy_transformers-1.3.9-cp313-cp313-macosx_11_0_arm64.whl (159.5KiB)
spacy_transformers-1.3.9-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (753.8KiB)
spacy_transformers-1.3.9-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (761.3KiB)
spacy_transformers-1.3.9-cp313-cp313-musllinux_1_2_aarch64.whl (1.6MiB)
spacy_transformers-1.3.9-cp313-cp313-musllinux_1_2_x86_64.whl (1.6MiB)
spacy_transformers-1.3.9-cp313-cp313-win_amd64.whl (333.4KiB)
spacy_transformers-1.3.9-cp39-cp39-macosx_10_9_x86_64.whl (167.3KiB)
spacy_transformers-1.3.9-cp39-cp39-macosx_11_0_arm64.whl (160.5KiB)
spacy_transformers-1.3.9-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (696.7KiB)
spacy_transformers-1.3.9-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (708.2KiB)
spacy_transformers-1.3.9-cp39-cp39-musllinux_1_2_aarch64.whl (1.5MiB)
spacy_transformers-1.3.9-cp39-cp39-musllinux_1_2_x86_64.whl (1.6MiB)
spacy_transformers-1.3.9-cp39-cp39-win_amd64.whl (335.0KiB)
spacy_transformers-1.3.9.tar.gz (48.4KiB)
Extras:
Dependencies:
spacy (<4.1.0,>=3.5.0)
numpy (>=1.15.0)
numpy (>=1.19.0)
transformers (<4.50.0,>=3.4.0)
torch (>=1.8.0)
srsly (<3.0.0,>=2.4.0)
dataclasses (<1.0,>=0.6)
spacy-alignments (<1.0.0,>=0.7.2)