Indonesian RoBERTa Embeddings (from cahya)

Description

Pretrained RoBERTa Embeddings model, uploaded to Hugging Face, adapted and imported into Spark NLP. roberta-base-indonesian-522M is a Indonesian model orginally trained by cahya.

Download Copy S3 URICopied!

How to use

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

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

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

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

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

result = pipeline.fit(data).transform(data)

Model Information

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

References

  • https://huggingface.co/cahya/roberta-base-indonesian-522M
  • https://github.com/cahya-wirawan/indonesian-language-models/tree/master/Transformers