Indonesian RoBERTa Embeddings (from w11wo)


Pretrained RoBERTa Embeddings model, uploaded to Hugging Face, adapted and imported into Spark NLP. indo-roberta-small is a Indonesian model orginally trained by w11wo.

Download Copy S3 URI

How to use

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

tokenizer = Tokenizer() \
.setInputCols("document") \

embeddings = RoBertaEmbeddings.pretrained("roberta_embeddings_indo_roberta_small","id") \
.setInputCols(["document", "token"]) \

pipeline = Pipeline(stages=[documentAssembler, tokenizer, embeddings])

data = spark.createDataFrame([["Saya suka percikan NLP"]]).toDF("text")

result =
val documentAssembler = new DocumentAssembler() 

val tokenizer = new Tokenizer() 

val embeddings = RoBertaEmbeddings.pretrained("roberta_embeddings_indo_roberta_small","id") 
.setInputCols(Array("document", "token")) 

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

val data = Seq("Saya suka percikan NLP").toDF("text")

val result =
import nlu
nlu.load("id.embed.indo_roberta_small").predict("""Saya suka percikan NLP""")

Model Information

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