Marathi Bert Embeddings (from monsoon-nlp)

Description

Pretrained Bert Embeddings model, uploaded to Hugging Face, adapted and imported into Spark NLP. muril-adapted-local is a Marathi model orginally trained by monsoon-nlp.

Download Copy S3 URICopied!

How to use

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

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

embeddings = BertEmbeddings.pretrained("bert_embeddings_muril_adapted_local","mr") \
.setInputCols(["document", "token"]) \
.setOutputCol("embeddings")

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

data = spark.createDataFrame([["मला स्पार्क एनएलपी आवडते"]]).toDF("text")

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

Model Information

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

References

  • https://huggingface.co/monsoon-nlp/muril-adapted-local
  • https://tfhub.dev/google/MuRIL/1