spaCy extension for transformer models
Top 29.6% on sourcepulse
This package provides spaCy components and architectures to integrate Hugging Face's transformer models (BERT, XLNet, GPT-2, etc.) into spaCy pipelines. It enables users to leverage state-of-the-art NLP models for tasks within the spaCy ecosystem, offering convenient access to powerful pre-trained representations.
How It Works
The package introduces a Transformer
pipeline component that acts as a bridge to Hugging Face's transformers
library. It handles the automatic alignment of transformer outputs to spaCy's tokenization, allowing seamless integration. This approach simplifies using advanced transformer architectures within spaCy's established pipeline structure and configuration system.
Quick Start & Requirements
pip install 'spacy[transformers]'
spacy[transformers,cudaXX]
(e.g., spacy[transformers,cuda110]
).Highlighted Details
Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The Transformer
component itself does not directly support task-specific heads (e.g., for token or text classification). For using pre-trained classification models, the spacy-huggingface-pipelines
package is recommended.
2 months ago
Inactive