Italian Bert Embeddings (from Geotrend)


Pretrained Bert Embeddings model, uploaded to Hugging Face, adapted and imported into Spark NLP. bert-base-it-cased is a Italian model orginally trained by Geotrend.


How to use

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

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

embeddings = BertEmbeddings.pretrained("bert_embeddings_bert_base_it_cased","it") \
.setInputCols(["document", "token"]) \

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

data = spark.createDataFrame([["Adoro Spark NLP"]]).toDF("text")

result =
val documentAssembler = new DocumentAssembler() 

val tokenizer = new Tokenizer() 

val embeddings = BertEmbeddings.pretrained("bert_embeddings_bert_base_it_cased","it") 
.setInputCols(Array("document", "token")) 

val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, embeddings))

val data = Seq("Adoro Spark NLP").toDF("text")

val result =
import nlu
nlu.load("it.embed.bert_it_cased").predict("""Adoro Spark NLP""")

Model Information

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