ALBERT Embeddings (XLarge Uncase)


ALBERT is “A Lite” version of BERT, a popular unsupervised language representation learning algorithm. ALBERT uses parameter-reduction techniques that allow for large-scale configurations, overcome previous memory limitations, and achieve better behavior with respect to model degradation. The details are described in the paper “ALBERT: A Lite BERT for Self-supervised Learning of Language Representations.


How to use

embeddings = AlbertEmbeddings.pretrained("albert_xlarge_uncased", "en") \
      .setInputCols("sentence", "token") \
nlp_pipeline = Pipeline(stages=[document_assembler, sentence_detector, tokenizer, embeddings])
pipeline_model =[[""]]).toDF("text"))
result = pipeline_model.transform(spark.createDataFrame(pd.DataFrame({"text": ["I love NLP"]})))
val embeddings = AlbertEmbeddings.pretrained("albert_xlarge_uncased", "en")
      .setInputCols("sentence", "token")
val pipeline = new Pipeline().setStages(Array(document_assembler, sentence_detector, tokenizer, embeddings))
val result =["I love NLP"].toDS.toDF("text")).transform(data)
import nlu

text = ["I love NLP"]
embeddings_df = nlu.load('en.embed.albert.xlarge_uncased').predict(text, output_level='token')


	token	en_embed_albert_xlarge_uncased_embeddings
	I	[-0.4735468626022339, -0.03991951420903206, -1...
	love	[-0.4254034459590912, -0.371383935213089, -0.3...
	NLP	[0.7200506329536438, -0.12543179094791412, -0....

Model Information

Model Name: albert_xlarge_uncased
Type: embeddings
Compatibility: Spark NLP 2.5.0+
License: Open Source
Edition: Official
Input Labels: [sentence, token]
Output Labels: [word_embeddings]
Language: [en]
Dimension: 2048
Case sensitive: false

Data Source

The model is imported from