Spanish RoBERTa Embeddings (from mrm8488)


Pretrained RoBERTa Embeddings model, uploaded to Hugging Face, adapted and imported into Spark NLP. RuPERTa-base is a Spanish model orginally trained by mrm8488.


How to use

documentAssembler = DocumentAssembler() \
    .setInputCol("text") \

tokenizer = Tokenizer() \
    .setInputCols("document") \
embeddings = RoBertaEmbeddings.pretrained("roberta_embeddings_RuPERTa_base","es") \
    .setInputCols(["document", "token"]) \
pipeline = Pipeline(stages=[documentAssembler, tokenizer, embeddings])

data = spark.createDataFrame([["Me encanta chispa nlp"]]).toDF("text")

result =
val documentAssembler = new DocumentAssembler() 
val tokenizer = new Tokenizer() 

val embeddings = RoBertaEmbeddings.pretrained("roberta_embeddings_RuPERTa_base","es") 
    .setInputCols(Array("document", "token")) 

val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, embeddings))

val data = Seq("Me encanta chispa nlp").toDF("text")

val result =
import nlu
nlu.load("es.embed.RuPERTa_base").predict("""Me encanta chispa nlp""")

Model Information

Model Name: roberta_embeddings_RuPERTa_base
Compatibility: Spark NLP 3.4.2+
License: Open Source
Edition: Official
Input Labels: [sentence, token]
Output Labels: [bert]
Language: es
Size: 472.9 MB
Case sensitive: true