XLM-RoBERTa is a scaled cross-lingual sentence encoder. It is trained on 2.5T of data across 100 languages data filtered from Common Crawl. XLM-R achieves state-of-the-arts results on multiple cross-lingual benchmarks.
The XLM-RoBERTa model was proposed in Unsupervised Cross-lingual Representation Learning at Scale by Alexis Conneau, Kartikay Khandelwal, Naman Goyal, Vishrav Chaudhary, Guillaume Wenzek, Francisco GuzmÃ¡n, Edouard Grave, Myle Ott, Luke Zettlemoyer, and Veselin Stoyanov.
It is based on Facebook’s RoBERTa model released in 2019. It is a large multi-lingual language model, trained on 2.5TB of filtered CommonCrawl data.
How to use
embeddings = XlmRoBertaEmbeddings.pretrained("xlm_roberta_large", "xx") \ .setInputCols("sentence", "token") \ .setOutputCol("embeddings")
val embeddings = XlmRoBertaEmbeddings.pretrained("xlm_roberta_large", "xx") .setInputCols("sentence", "token") .setOutputCol("embeddings") val pipeline = new Pipeline().setStages(Array(document_assembler, sentence_detector, tokenizer, embeddings))
|Compatibility:||Spark NLP 3.3.0+|
|Input Labels:||[token, sentence]|