Swedish BERT Sentence Base Cased Embedding


The National Library of Sweden / KBLab releases three pretrained language models based on BERT and ALBERT. The models are trained on aproximately 15-20GB of text (200M sentences, 3000M tokens) from various sources (books, news, government publications, swedish wikipedia and internet forums) aiming to provide a representative BERT model for Swedish text.

Predicted Entities


How to use

sent_embeddings = BertSentenceEmbeddings.pretrained("sent_bert_base_cased", "sv") \
      .setInputCols("sentence") \

nlp_pipeline = Pipeline(stages=[document_assembler, sentence_detector, sent_embeddings ])
val sent_embeddings = BertSentenceEmbeddings.pretrained("sent_bert_base_cased", "sv")

val pipeline = new Pipeline().setStages(Array(document_assembler, sentence_detector, sent_embeddings ))

Model Information

Model Name: sent_bert_base_cased
Compatibility: Spark NLP 3.2.2+
License: Open Source
Edition: Official
Input Labels: [sentence]
Output Labels: [bert_sentence]
Language: sv
Case sensitive: true

Data Source

The model is imported from: https://huggingface.co/KB/bert-base-swedish-cased