spaCy pipelines for pre-trained BERT and other transformers
Actively maintained. Last release 4 weeks ago. A safe choice.
pip install spacy-transformersspacy-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.xbranch.
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
Docobject. - 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 you install the models. Also note that this package requires , and .