Description
Pretrained BertEmbeddings model, adapted from Hugging Face and curated to provide scalability and production-readiness using Spark NLP. allnli-GroNLP-bert-base-dutch-cased
is a Dutch model originally trained by textgain
.
How to use
documentAssembler = DocumentAssembler() \
.setInputCols(["text"]) \
.setOutputCols("document")
tokenizer = Tokenizer() \
.setInputCols("document") \
.setOutputCol("token")
bert_loaded = BertEmbeddings.pretrained("bert_embeddings_allnli_gronlp_base_dutch_cased","nl") \
.setInputCols(["document", "token"]) \
.setOutputCol("embeddings") \
.setCaseSensitive(True)
pipeline = Pipeline(stages=[documentAssembler, tokenizer, bert_loaded])
data = spark.createDataFrame([["I love Spark NLP"]]).toDF("text")
result = pipeline.fit(data).transform(data)
val documentAssembler = new DocumentAssembler()
.setInputCols(Array("text"))
.setOutputCols(Array("document"))
val tokenizer = new Tokenizer()
.setInputCols("document")
.setOutputCol("token")
val bert_loaded = BertEmbeddings.pretrained("bert_embeddings_allnli_gronlp_base_dutch_cased","nl")
.setInputCols(Array("document", "token"))
.setOutputCol("embeddings")
.setCaseSensitive(true)
val pipeline = new Pipeline().setStages(Array(documentAssembler, tokenizer, bert_loaded))
val data = Seq("I love Spark NLP").toDS.toDF("text")
val result = pipeline.fit(data).transform(data)
Model Information
Model Name: | bert_embeddings_allnli_gronlp_base_dutch_cased |
Compatibility: | Spark NLP 5.1.0+ |
License: | Open Source |
Edition: | Official |
Input Labels: | [document, token] |
Output Labels: | [bert] |
Language: | nl |
Size: | 406.8 MB |
Case sensitive: | true |
References
- https://huggingface.co/textgain/allnli-GroNLP-bert-base-dutch-cased
- https://www.SBERT.net
- https://www.SBERT.net
- https://www.SBERT.net
- https://seb.sbert.net?model_name=%7BMODEL_NAME%7D