larskjeldgaard
commited on
Commit
•
df3a675
1
Parent(s):
6e200f5
first release
Browse files- README.md +28 -0
- config.json +40 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +1 -0
- tokenizer_config.json +1 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 (Polarity)
|
13 |
+
This model detects polarity ('positive', 'neutral', 'negative') of danish texts.
|
14 |
+
|
15 |
+
It is trained on Tweets, that have been annotated by [Alexandra Institute](https://github.com/alexandrainst)
|
16 |
+
|
17 |
+
Here is an example on how to load the model in PyTorch using the [🤗Transformers](https://github.com/huggingface/transformers) library:
|
18 |
+
|
19 |
+
```python
|
20 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification, pipeline
|
21 |
+
tokenizer = AutoTokenizer.from_pretrained("larskjeldgaard/senda")
|
22 |
+
model = AutoModelForTokenClassification.from_pretrained("larskjeldgaard/senda")
|
23 |
+
|
24 |
+
# create 'senda' sentiment analysis pipeline
|
25 |
+
senda_pipeline = pipeline('sentiment-analysis', model=model, tokenizer=tokenizer)
|
26 |
+
|
27 |
+
senda_pipeline("Sikke en dejlig dag det er i dag")
|
28 |
+
```
|
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
|
|