Description
Pretrained XlmRoBertaSentenceEmbeddings model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.multilingual_e5_small
is a Multilingual model originally trained by intfloat.
How to use
document_assembler = DocumentAssembler() \
.setInputCol("text") \
.setOutputCol("documents")
sentencerDL = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")\
.setInputCols(["document"])\
.setOutputCol("sentence")
embeddings =XlmRoBertaSentenceEmbeddings.pretrained("multilingual_e5_small","xx") \
.setInputCols(["sentence"]) \
.setOutputCol("embeddings")
pipeline = Pipeline().setStages([document_assembler, sentencerDL, embeddings])
pipelineModel = pipeline.fit(data)
pipelineDF = pipelineModel.transform(data)
val document_assembler = new DocumentAssembler()
.setInputCol("text")
.setOutputCol("documents")
val sentencerDL = SentenceDetectorDLModel.pretrained("sentence_detector_dl", "xx")
.setInputCols(["document"])
.setOutputCol("sentence")
val embeddings = XlmRoBertaSentenceEmbeddings
.pretrained("multilingual_e5_small", "xx")
.setInputCols(Array("sentence"))
.setOutputCol("embeddings")
val pipeline = new Pipeline().setStages(Array(document_assembler, sentencerDL, embeddings))
val pipelineModel = pipeline.fit(data)
val pipelineDF = pipelineModel.transform(data)
Model Information
Model Name: | multilingual_e5_small |
Compatibility: | Spark NLP 5.1.2+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [sentence] |
Output Labels: | [embeddings] |
Language: | xx |
Size: | 284.4 MB |
References
https://huggingface.co/intfloat/multilingual-e5-small