#73 · Primary category: NLP Tools & Text Processing

spacy-transformers

bert google gpt-2 huggingface language-model machine-learning natural-language-processing natural-language-understanding nlp openai pytorch pytorch-model spacy spacy-extension spacy-pipeline transfer-learning xlnet

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

Project last updated:03/27/26

GitHub Stars

1.4K

Forks

181

Contributors

24

License

MIT

Why we included this project

spacy-transformers is Explosion's own bridge between spaCy and Hugging Face's transformers library, so you can keep your existing spaCy pipeline and still benefit from transformer models like BERT, RoBERTa, or XLNet. The hard part it solves is alignment: transformer tokenizers and spaCy's tokenizer do not split text the same way, and this package maps between them automatically instead of leaving that as a manual integration step. It also lets several pipeline components share a single transformer and backprop into it together, which is handy when one encoder serves multiple tasks. Teams that already train with spaCy v3's config files will find it slots into that workflow, and serialization and model packaging are handled out of the box.

Articles for this project

No articles for this project yet.

To suggest a topic or contribute an article, contact us.

Related projects in this category