hjb commited on
Commit
8dcfa35
1 Parent(s): 3dbf9ab

Initial commit

Browse files
README.md ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: da
3
+ tags:
4
+ - danish
5
+ - bert
6
+ - masked-lm
7
+ - botxo
8
+ license: cc-by-4.0
9
+ datasets:
10
+ - common_crawl
11
+ - wikipedia
12
+ - dindebat.dk
13
+ - hestenettet.dk
14
+ - danish OpenSubtitles
15
+ pipeline_tag: token-classification
16
+ widget:
17
+ - text: "Jens er en konge og er født i Danmark."
18
+ ---
19
+
20
+ # Danish BERT (version 2, uncased) by [BotXO.ai](https://www.botxo.ai/) finetuned for Named Entity Recognition on the [DaNE dataset](https://danlp.alexandra.dk/304bd159d5de/datasets/ddt.zip) (Hvingelby et al., 2020) by Malte Højmark-Bertelsen
21
+
22
+ All credit goes to [BotXO.ai](https://www.botxo.ai/) who developed Danish BERT. For data and training details see their [GitHub repository](https://github.com/botxo/nordic_bert) or [this article](https://www.botxo.ai/en/blog/danish-bert-model/).
23
+
24
+ It is both available in TensorFlow and Pytorch format.
25
+
26
+ The original TensorFlow version can be downloaded using [this link](https://www.dropbox.com/s/19cjaoqvv2jicq9/danish_bert_uncased_v2.zip?dl=1).
27
+
28
+
29
+ Here is an example on how to load Danish BERT in PyTorch using the [🤗Transformers](https://github.com/huggingface/transformers) library:
30
+
31
+
32
+
33
+ ```python
34
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
35
+
36
+ tokenizer = AutoTokenizer.from_pretrained("Maltehb/danish-bert-botxo-ner-dane")
37
+ model = AutoModelForTokenClassification.from_pretrained("Maltehb/danish-bert-botxo-ner-dane")
38
+
39
+ ```
40
+
41
+ ### References
42
+ Danish BERT. (2020). BotXO. https://github.com/botxo/nordic_bert (Original work published 2019)
43
+
44
+ Hvingelby, R., Pauli, A. B., Barrett, M., Rosted, C., Lidegaard, L. M., & Søgaard, A. (2020). DaNE: A Named Entity Resource for Danish. Proceedings of the 12th Language Resources and Evaluation Conference, 4597–4604. https://www.aclweb.org/anthology/2020.lrec-1.565
45
+
46
+ #### Contact
47
+
48
+ For help or further information feel free to connect with the author Malte Højmark-Bertelsen on [hjb@kmd.dk](mailto:hjb@kmd.dk?subject=[GitHub]%20DanishBERTUncasedNER) or any of the following platforms:
49
+
50
+ [<img align="left" alt="MalteHB | Twitter" width="22px" src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/twitter.svg" />][twitter]
51
+ [<img align="left" alt="MalteHB | LinkedIn" width="22px" src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/linkedin.svg" />][linkedin]
52
+ [<img align="left" alt="MalteHB | Instagram" width="22px" src="https://cdn.jsdelivr.net/npm/simple-icons@v3/icons/instagram.svg" />][instagram]
53
+
54
+ <br />
55
+
56
+ </details>
57
+
58
+ [twitter]: https://twitter.com/malteH_B
59
+ [instagram]: https://www.instagram.com/maltemusen/
60
+ [linkedin]: https://www.linkedin.com/in/malte-h%C3%B8jmark-bertelsen-9a618017b/
config.json ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "BertForTokenClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0.1,
6
+ "directionality": "bidi",
7
+ "gradient_checkpointing": false,
8
+ "hidden_act": "gelu",
9
+ "hidden_dropout_prob": 0.1,
10
+ "hidden_size": 768,
11
+ "id2label": {
12
+ "0": "B-PER",
13
+ "1": "I-PER",
14
+ "2": "B-LOC",
15
+ "3": "I-LOC",
16
+ "4": "B-ORG",
17
+ "5": "I-ORG",
18
+ "6": "O",
19
+ "7": "LABEL_7",
20
+ "8": "LABEL_8",
21
+ "9": "LABEL_9"
22
+ },
23
+ "initializer_range": 0.02,
24
+ "intermediate_size": 3072,
25
+ "label2id": {
26
+ "LABEL_0": 0,
27
+ "LABEL_1": 1,
28
+ "LABEL_2": 2,
29
+ "LABEL_3": 3,
30
+ "LABEL_4": 4,
31
+ "LABEL_5": 5,
32
+ "LABEL_6": 6,
33
+ "LABEL_7": 7,
34
+ "LABEL_8": 8,
35
+ "LABEL_9": 9
36
+ },
37
+ "layer_norm_eps": 1e-12,
38
+ "max_position_embeddings": 512,
39
+ "model_type": "bert",
40
+ "num_attention_heads": 12,
41
+ "num_hidden_layers": 12,
42
+ "pad_token_id": 0,
43
+ "pooler_fc_size": 768,
44
+ "pooler_num_attention_heads": 12,
45
+ "pooler_num_fc_layers": 3,
46
+ "pooler_size_per_head": 128,
47
+ "pooler_type": "first_token_transform",
48
+ "type_vocab_size": 2,
49
+ "vocab_size": 32000
50
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:dc35edd66a00d96a8195e805fda4b35008c5a3ae9947bff8b9e9d8cb1fa3767e
3
+ size 440224266
special_tokens_map.json ADDED
@@ -0,0 +1 @@
 
1
+ {"unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]"}
tokenizer_config.json ADDED
@@ -0,0 +1 @@
 
1
+ {"do_lower_case": true, "strip_accents": false}
vocab.txt ADDED
The diff for this file is too large to render. See raw diff