Spanish RoBERTa Embeddings (Base, Using Sequence Length 512)

Description

Pretrained RoBERTa Embeddings model, uploaded to Hugging Face, adapted and imported into Spark NLP. bertin-base-gaussian-exp-512seqlen is a Spanish model orginally trained by bertin-project.

Download Copy S3 URICopied!

How to use

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

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

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

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

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

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

Model Information

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

References

  • https://huggingface.co/bertin-project/bertin-base-gaussian-exp-512seqlen