OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Spacy Transformers

Spacy Transformers is a Python library of spaCy components and architectures for using Hugging Face transformer models in spaCy pipelines.

Independent OpenViST project profile, based on linked sources.

Spacy Transformers — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use it when a spaCy pipeline needs transformer-derived features, shared-transformer multi-task training, or serialization and packaging of transformer-enabled pipelines.

Who it is for

  • Python developers building spaCy NLP pipelines with pretrained transformer models.
  • Teams training multiple spaCy components around a shared transformer.

Documented uses

  • Use pretrained BERT, RoBERTa, XLNet or GPT-2 models as features in spaCy pipelines.
  • Align transformer outputs with spaCy tokenization.
  • Train spaCy components with shared transformer representations.
  • Customize transformer data saved in spaCy Doc objects and package serialized pipelines.
Before you choose

Requirements & limits

The README provides a pip installation command and states requirements of Python 3.6+, PyTorch 1.5+, and spaCy 3.0+. The repository lists an MIT license.

  • This release targets spaCy 3; the README directs users of the earlier spaCy 2-era implementation to the 0.6.x branch.
  • Task-specific classification heads are not exposed by the transformer component; for predictions from existing Hugging Face text or token classification models, the README points to spacy-huggingface-pipelines.
  • GPU installation instructions depend on the CUDA version.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install spaCy with transformer support

Install the spaCy transformer package and its dependencies before installing transformer models.

Before you start

  • Python 3.6 or later
  • PyTorch 1.5 or later
  • spaCy 3.0 or later
  • For GPU installation, identify the CUDA version with nvcc --version.

Steps

  1. Install the package with the command below.

    Documented command
    pip install 'spacy[transformers]'
  2. If installing for a GPU, identify the CUDA version and use the corresponding bracketed CUDA variant, such as spacy[transformers,cuda92] for CUDA 9.2 or spacy[transformers,cuda100] for CUDA 10.0.

  3. Install transformer models only after installing this package.

Expected outcome

The package and its dependencies, including PyTorch and spaCy, are installed for use with spaCy transformer pipelines.

Guide limitations

  • The instructions specify minimum versions, not a complete compatibility matrix.
  • GPU installation requires choosing the CUDA variant that matches the installed CUDA version.
  • This release requires spaCy v3; the v0.6.x branch is identified for the previous library version.
Source-based practical guide

Add a transformer component to a spaCy pipeline

Add the installed transformer component to a spaCy pipeline so it can provide transformer outputs to documents and downstream components.

Before you start

  • The spacy-transformers package is installed.
  • A spaCy language pipeline is available.

Steps

  1. Add the component using nlp.add_pipe("transformer"), or configure factory = "transformer" in a training config.

  2. Process documents through the pipeline; the component writes transformer data to Doc._.trf_data and aligns word-piece tokens with spaCy tokens.

  3. Connect subsequent spaCy components to the shared transformer using a TransformerListener layer when they need its outputs as features.

Expected outcome

The pipeline includes a transformer component that exposes transformer outputs on processed documents for downstream use.

Guide limitations

  • The transformer component does not provide task-specific text- or token-classification heads for training or inference; it can instead provide features to spaCy components such as ner or textcat.
  • The documented component and configuration APIs are for the spaCy v3-era package.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
14 October 2026
Original website title
explosion/spacy-transformers · Official homepage title · retained in its source language

Related options

spacy-huggingface-pipelines — The README identifies it as an alternative for incorporating existing Hugging Face text or token classification predictions into spaCy pipelines.