Multilingual multilingual_e5_base XlmRoBertaSentenceEmbeddings from intfloat

Description

Pretrained XlmRoBertaSentenceEmbeddings model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.multilingual_e5_base is a Multilingual model originally trained by intfloat.

Download Copy S3 URI

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_base","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_base", "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_base
Compatibility: Spark NLP 5.1.2+
License: Open Source
Edition: Official
Input Labels: [sentence]
Output Labels: [embeddings]
Language: xx
Size: 667.1 MB

References

https://huggingface.co/intfloat/multilingual-e5-base