larskjeldgaard commited on
Commit
804d1a3
1 Parent(s): 4d0e5ac

first release

Browse files
README.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ language: da
3
+ tags:
4
+ - danish
5
+ - bert
6
+ - sentiment
7
+ - polarity
8
+ license: cc-by-4.0
9
+ widget:
10
+ - text: "Sikke en dejlig dag det er i dag"
11
+ ---
12
+ # Danish BERT fine-tuned for Sentiment Analysis <img src="https://raw.githubusercontent.com/ebanalyse/NERDA/main/logo.png" align="right" height=150/>
13
+
14
+ This model detects polarity ('positive', 'neutral', 'negative') of danish texts.
15
+
16
+ It is trained and tested on Tweets annotated by [Alexandra Institute](https://github.com/alexandrainst). The model is trained with the [`senda`](https://github.com/ebanalyse/senda) package.
17
+
18
+ Here is an example of how to load the model in PyTorch using the [🤗Transformers](https://github.com/huggingface/transformers) library:
19
+
20
+ ```python
21
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification, pipeline
22
+ tokenizer = AutoTokenizer.from_pretrained("pin/senda")
23
+ model = AutoModelForSequenceClassification.from_pretrained("pin/senda")
24
+
25
+ # create 'senda' sentiment analysis pipeline
26
+ senda_pipeline = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
27
+
28
+ text = "Sikke en dejlig dag det er i dag"
29
+ # 'what a lovely day'
30
+ senda_pipeline("Sikke en dejlig dag det er i dag")
31
+ ```
config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "./results/checkpoint-900",
3
+ "architectures": [
4
+ "BertForSequenceClassification"
5
+ ],
6
+ "attention_probs_dropout_prob": 0.1,
7
+ "directionality": "bidi",
8
+ "gradient_checkpointing": false,
9
+ "hidden_act": "gelu",
10
+ "hidden_dropout_prob": 0.1,
11
+ "hidden_size": 768,
12
+ "id2label": {
13
+ "0": "negativ",
14
+ "1": "neutral",
15
+ "2": "positiv"
16
+ },
17
+ "initializer_range": 0.02,
18
+ "intermediate_size": 3072,
19
+ "label2id": {
20
+ "negativ": 0,
21
+ "neutral": 1,
22
+ "positiv": 2
23
+ },
24
+ "layer_norm_eps": 1e-12,
25
+ "max_position_embeddings": 512,
26
+ "model_type": "bert",
27
+ "num_attention_heads": 12,
28
+ "num_hidden_layers": 12,
29
+ "pad_token_id": 0,
30
+ "pooler_fc_size": 768,
31
+ "pooler_num_attention_heads": 12,
32
+ "pooler_num_fc_layers": 3,
33
+ "pooler_size_per_head": 128,
34
+ "pooler_type": "first_token_transform",
35
+ "position_embedding_type": "absolute",
36
+ "transformers_version": "4.5.0",
37
+ "type_vocab_size": 2,
38
+ "use_cache": true,
39
+ "vocab_size": 32000
40
+ }
pytorch_model.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6bf99d3a3c56e417ed3d4fb10d51a4fba9fbc008545b296336dbfe911c981cfc
3
+ size 442566130
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, "unk_token": "[UNK]", "sep_token": "[SEP]", "pad_token": "[PAD]", "cls_token": "[CLS]", "mask_token": "[MASK]", "tokenize_chinese_chars": true, "strip_accents": null, "special_tokens_map_file": null, "name_or_path": "Maltehb/danish-bert-botxo", "do_basic_tokenize": true, "never_split": null}
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:fde9e18bd59ab66453c2401ac48131b3281dc7cfd5aadb705a53803fc702abef
3
+ size 2351
vocab.txt ADDED
The diff for this file is too large to render. See raw diff