Description
Pretrained BERT Embedding model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. Italian-Legal-BERT
is a Italian model originally trained by dlicari
.
How to use
documentAssembler = DocumentAssembler() \
.setInputCol("text") \
.setOutputCol("document")
tokenizer = Tokenizer() \
.setInputCols("document") \
.setOutputCol("token")
embeddings = BertEmbeddings.pretrained("bert_embeddings_Italian_Legal_BERT","it") \
.setInputCols(["document", "token"]) \
.setOutputCol("embeddings")
pipeline = Pipeline(stages=[documentAssembler, tokenizer, embeddings])
data = spark.createDataFrame([["Adoro Spark NLP"]]).toDF("text")
result = pipeline.fit(data).transform(data)
Model Information
Model Name: | bert_embeddings_Italian_Legal_BERT |
Compatibility: | Spark NLP 4.2.7+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [sentence] |
Output Labels: | [bert_sentence] |
Language: | it |
Size: | 411.6 MB |
Case sensitive: | true |
Max sentence length: | 128 |
References
- https://huggingface.co/dlicari/Italian-Legal-BERT
- https://colab.research.google.com/drive/1aXOmqr70fjm8lYgIoGJMZDsK0QRIL4Lt?usp=sharing