Multilingual bge_m3 XlmRoBertaSentenceEmbeddings from BAII

Description

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

Predicted Entities

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("bge_m3","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("bge_m3", "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: bge_m3
Compatibility: Spark NLP 5.2.3+
License: Open Source
Edition: Official
Input Labels: [sentence]
Output Labels: [sentence_embeddings]
Language: xx
Size: 410.8 MB
Max sentence length: 32

References

https://huggingface.co/BAAI/bge-m3