Persian ALBERT Embeddings (from m3hrdadfi)

Description

Pretrained ALBERT Embeddings model, uploaded to Hugging Face, adapted and imported into Spark NLP. albert-fa-base-v2 is a Persian model orginally trained by m3hrdadfi.

Download Copy S3 URICopied!

How to use

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

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

embeddings = AlbertEmbeddings.pretrained("albert_embeddings_albert_fa_base_v2","fa") \
.setInputCols(["document", "token"]) \
.setOutputCol("embeddings")

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

data = spark.createDataFrame([["من عاشق جرقه NLP هستم"]]).toDF("text")

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

Model Information

Model Name: albert_embeddings_albert_fa_base_v2
Compatibility: Spark NLP 3.4.2+
License: Open Source
Edition: Official
Input Labels: [sentence, token]
Output Labels: [bert]
Language: fa
Size: 69.2 MB
Case sensitive: false

References

  • https://huggingface.co/m3hrdadfi/albert-fa-base-v2
  • https://dumps.wikimedia.org/fawiki/
  • https://github.com/miras-tech/MirasText
  • https://bigbangpage.com/
  • https://www.chetor.com/
  • https://www.eligasht.com/Blog/
  • https://www.digikala.com/mag/
  • https://www.ted.com/talks
  • https://github.com/m3hrdadfi/albert-persian
  • https://github.com/hooshvare/parsbert
  • https://github.com/m3hrdadfi/albert-persian