You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since version 3.1.0, Spark NLP 🚀 has supported importing pretrained models from Hugging Face 🤗 and TensorFlow Hub into equivalent Spark NLP annotators.
This means you can bring your favorite Transformer architectures such as BERT, RoBERTa, DistilBERT, DeBERTa, XLM-RoBERTa, Longformer, CamemBERT, XLNet, and many others directly into Spark NLP pipelines for tasks like:
👉 Explore runnable end-to-end examples in our Notebook Gallery Repository. You’ll find Colab/Jupyter notebooks for each annotator and runtime (TensorFlow, ONNX, OpenVINO, Llama.cpp).
Compatibility Matrix
✅ Fully supported
❎ Under development
❌ Not supported
Text Embeddings
Annotator
TensorFlow
ONNX
OpenVINO
AlbertEmbeddings
✅
✅
✅
BGEEmbeddings
✅
✅
✅
BertEmbeddings
✅
✅
✅
BertSentenceEmbeddings
✅
✅
✅
CamemBertEmbeddings
✅
✅
✅
DeBertaEmbeddings
✅
✅
✅
DistilBertEmbeddings
✅
✅
✅
ElmoEmbeddings
✅
❌
❌
E5Embeddings
✅
✅
✅
E5VEmbeddings
❌
❌
✅
InstructorEmbeddings
✅
✅
✅
LongformerEmbeddings
✅
❌
❌
MiniLMEmbeddings
❌
✅
✅
MPNetEmbeddings
✅
✅
✅
MxbaiEmbeddings
✅
✅
❌
NomicEmbeddings
❌
✅
✅
RoBertaEmbeddings
✅
✅
✅
RoBertaSentenceEmbeddings
✅
✅
✅
SnowFlakeEmbeddings
✅
✅
✅
UAEEmbeddings
✅
✅
✅
UniversalSentenceEncoder
✅
❌
❌
XlnetEmbeddings
✅
❌
❌
XlmRoBertaEmbeddings
✅
✅
✅
XlmRoBertaSentenceEmbeddings
✅
✅
✅
Sequence Classification
Annotator
TensorFlow
ONNX
OpenVINO
AlbertForSequenceClassification
✅
✅
✅
BartForZeroShotClassification
✅
✅
✅
BertForSequenceClassification
✅
✅
✅
BertForZeroShotClassification
✅
✅
✅
CamemBertForSequenceClassification
✅
✅
✅
DeBertaForSequenceClassification
✅
✅
✅
DeBertaForZeroShotClassification
✅
✅
✅
DistilBertForSequenceClassification
✅
✅
✅
DistilBertForZeroShotClassification
✅
✅
✅
LongformerForSequenceClassification
✅
❌
❌
MPNetForSequenceClassification
❌
✅
✅
RoBertaForSequenceClassification
✅
✅
✅
RoBertaForZeroShotClassification
✅
✅
✅
XlnetForSequenceClassification
✅
❌
❌
XlmRoBertaForSequenceClassification
✅
✅
✅
XlmRoBertaForZeroShotClassification
✅
✅
✅
Token Classification
Annotator
TensorFlow
ONNX
OpenVINO
AlbertForTokenClassification
✅
✅
✅
BertForTokenClassification
✅
✅
❌
CamemBertForTokenClassification
✅
✅
✅
DeBertaForTokenClassification
✅
✅
✅
DistilBertForTokenClassification
✅
✅
✅
LongformerForTokenClassification
✅
❌
❌
MPNetForTokenClassification
❌
✅
✅
RoBertaForTokenClassification
✅
✅
✅
XlnetForTokenClassification
✅
❌
❌
XlmRoBertaForTokenClassification
✅
✅
✅
Question Answering
Annotator
TensorFlow
ONNX
OpenVINO
AlbertForQuestionAnswering
✅
✅
✅
BertForQuestionAnswering
✅
✅
✅
CamemBertForQuestionAnswering
✅
✅
✅
DeBertaForQuestionAnswering
✅
✅
✅
DistilBertForQuestionAnswering
✅
✅
✅
LongformerForQuestionAnswering
✅
❌
❌
MPNetForQuestionAnswering
❌
✅
✅
RoBertaForQuestionAnswering
✅
✅
✅
TapasForQuestionAnswering
✅
❌
❌
XlmRoBertaForQuestionAnswering
✅
✅
✅
Text Generation
Annotator
TensorFlow
ONNX
OpenVINO
BartTransformer
✅
✅
✅
CoHereTransformer
❌
✅
✅
CPMTransformer
❌
✅
✅
MarianTransformer
✅
✅
❌
M2M100Transformer
❌
✅
✅
NLLBTransformer
❌
✅
✅
T5Transformer
✅
✅
✅
Computer Vision
Annotator
TensorFlow
ONNX
OpenVINO
BLIPForQuestionAnswering
✅
❌
❌
CLIPForZeroShotClassification
❌
✅
✅
ConvNextForImageClassification
✅
✅
✅
Florence2Transformer
❌
❌
✅
SwinForImageClassification
✅
✅
✅
ViTForImageClassification
✅
✅
✅
VisionEncoderDecoderForImageCaptioning
✅
✅
✅
Speech Processing
Annotator
TensorFlow
ONNX
OpenVINO
HubertForCTC
✅
✅
✅
Wav2Vec2ForCTC
✅
✅
✅
WhisperForCTC
✅
✅
✅
Large Language Models
Annotator
TensorFlow
ONNX
OpenVINO
llamacpp (GGUF)
GPT2Transformer
✅
✅
✅
❎
LLAMA2Transformer
❌
✅
✅
✅
LLAMA3Transformer
❌
✅
✅
✅
MistralTransformer
❌
✅
✅
✅
OLMoTransformer
❌
❌
✅
✅
Phi2Transformer
❌
✅
✅
✅
Phi3Transformer
❌
✅
✅
✅
Phi4Transformer
❌
✅
✅
✅
QwenTransformer
❌
✅
✅
✅
StarCoderTransformer
❌
✅
✅
✅
Vision-Language Models
Annotator
TensorFlow
ONNX
OpenVINO
llamacpp (GGUF)
Gemma3ForMultiModal
❌
❌
✅
✅
InternVLForMultiModal
❌
❌
✅
✅
JanusForMultiModal
❌
❌
✅
✅
LLAVAForMultiModal
❌
❌
✅
✅
MLLamaForMultimodal
❌
❌
✅
✅
PaliGemmaForMultiModal
❌
❌
✅
✅
Phi3Vision
❌
❌
✅
✅
Qwen2VLTransformer
❌
❌
✅
✅
SmolVLMTransformer
❌
❌
✅
✅
Importing Pretrained Models to Spark NLP
We provide a comprehensive collection of end-to-end notebooks for importing and converting pretrained models into Spark NLP. These resources cover all major annotators and runtimes:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Import Models into Spark NLP
Table of Contents
Overview
Since version 3.1.0, Spark NLP 🚀 has supported importing pretrained models from Hugging Face 🤗 and TensorFlow Hub into equivalent Spark NLP annotators.
This means you can bring your favorite Transformer architectures such as BERT, RoBERTa, DistilBERT, DeBERTa, XLM-RoBERTa, Longformer, CamemBERT, XLNet, and many others directly into Spark NLP pipelines for tasks like:
With every release, we extend this compatibility to cover more architectures and runtimes.
Quick Start
Basic Model Import
👉 Explore runnable end-to-end examples in our Notebook Gallery Repository. You’ll find Colab/Jupyter notebooks for each annotator and runtime (TensorFlow, ONNX, OpenVINO, Llama.cpp).
Compatibility Matrix
Text Embeddings
Sequence Classification
Token Classification
Question Answering
Text Generation
Computer Vision
Speech Processing
Large Language Models
Vision-Language Models
Importing Pretrained Models to Spark NLP
We provide a comprehensive collection of end-to-end notebooks for importing and converting pretrained models into Spark NLP. These resources cover all major annotators and runtimes:
HuggingFace to Spark NLP (TensorFlow)
HuggingFace to Spark NLP (ONNX)
HuggingFace to Spark NLP (OpenVINO)
HuggingFace to Spark NLP (Llama.cpp)
Beta Was this translation helpful? Give feedback.
All reactions