English all_mpnet_lr5e_8_margin_1_ep_5_bosnian_32 MPNetEmbeddings from luiz-and-robert-thesis

Description

Pretrained MPNetEmbeddings model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP.all_mpnet_lr5e_8_margin_1_ep_5_bosnian_32 is a English model originally trained by luiz-and-robert-thesis.

Download Copy S3 URI

How to use

 
documentAssembler = DocumentAssembler() \
      .setInputCol("text") \
      .setOutputCol("document")
    
embeddings = MPNetEmbeddings.pretrained("all_mpnet_lr5e_8_margin_1_ep_5_bosnian_32","en") \
      .setInputCols(["document"]) \
      .setOutputCol("embeddings")       
        
pipeline = Pipeline().setStages([documentAssembler, embeddings])
data = spark.createDataFrame([["I love spark-nlp"]]).toDF("text")
pipelineModel = pipeline.fit(data)
pipelineDF = pipelineModel.transform(data)


val documentAssembler = new DocumentAssembler() 
    .setInputCol("text") 
    .setOutputCol("document")
    
val embeddings = MPNetEmbeddings.pretrained("all_mpnet_lr5e_8_margin_1_ep_5_bosnian_32","en") 
    .setInputCols(Array("document")) 
    .setOutputCol("embeddings")

val pipeline = new Pipeline().setStages(Array(documentAssembler, embeddings))
val data = Seq("I love spark-nlp").toDF("text")
val pipelineModel = pipeline.fit(data)
val pipelineDF = pipelineModel.transform(data)

Model Information

Model Name: all_mpnet_lr5e_8_margin_1_ep_5_bosnian_32
Compatibility: Spark NLP 5.5.0+
License: Open Source
Edition: Official
Input Labels: [document]
Output Labels: [mpnet]
Language: en
Size: 406.9 MB

References

https://huggingface.co/luiz-and-robert-thesis/all-mpnet-lr5e-8-margin-1-ep-5-bs-32