Upload folder using huggingface_hub
Browse files- README.md +52 -0
- config.json +56 -0
- model.safetensors +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +57 -0
- training_args.bin +3 -0
- vocab.txt +0 -0
README.md
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
---
|
2 |
+
license: apache-2.0
|
3 |
+
tags:
|
4 |
+
- bert
|
5 |
+
- kcbert
|
6 |
+
- unsmile
|
7 |
+
---
|
8 |
+
|
9 |
+
# SJ-Donald/kcbert-large-unsmile
|
10 |
+
|
11 |
+
SJ-Donald/kcbert-large-unsmile is pretrained model using follow:
|
12 |
+
|
13 |
+
## Models
|
14 |
+
|
15 |
+
* [beomi/kcbert-large](https://huggingface.co/beomi/kcbert-large)
|
16 |
+
|
17 |
+
## Datasets
|
18 |
+
|
19 |
+
* [smilegate-ai/kor_unsmile](smilegate-ai/kor_unsmile)
|
20 |
+
|
21 |
+
## How to use
|
22 |
+
|
23 |
+
```Python
|
24 |
+
from transformers import TextClassificationPipeline, BertForSequenceClassification, AutoTokenizer+
|
25 |
+
|
26 |
+
model_name = 'SJ-Donald/kcbert-large-unsmile'
|
27 |
+
model = BertForSequenceClassification.from_pretrained(model_name)
|
28 |
+
|
29 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
30 |
+
|
31 |
+
pipe = TextClassificationPipeline(
|
32 |
+
model = model,
|
33 |
+
tokenizer = tokenizer,
|
34 |
+
device = 0, # cpu: -1, gpu: gpu number
|
35 |
+
return_all_scores = True,
|
36 |
+
function_to_apply = 'sigmoid'
|
37 |
+
)
|
38 |
+
|
39 |
+
for result in pipe("이래서 여자는 게임을 하면 안된다")[0]:
|
40 |
+
print(result)
|
41 |
+
|
42 |
+
{'label': '여성/가족', 'score': 0.9793611168861389}
|
43 |
+
{'label': '남성', 'score': 0.006330598145723343}
|
44 |
+
{'label': '성소수자', 'score': 0.007870828732848167}
|
45 |
+
{'label': '인종/국적', 'score': 0.010810344479978085}
|
46 |
+
{'label': '연령', 'score': 0.020540334284305573}
|
47 |
+
{'label': '지역', 'score': 0.015790466219186783}
|
48 |
+
{'label': '종교', 'score': 0.014563685283064842}
|
49 |
+
{'label': '기타 혐오', 'score': 0.04097242280840874}
|
50 |
+
{'label': '악플/욕설', 'score': 0.019168635830283165}
|
51 |
+
{'label': 'clean', 'score': 0.014866289682686329}
|
52 |
+
```
|
config.json
ADDED
@@ -0,0 +1,56 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"_name_or_path": "beomi/kcbert-large",
|
3 |
+
"architectures": [
|
4 |
+
"BertForSequenceClassification"
|
5 |
+
],
|
6 |
+
"attention_probs_dropout_prob": 0.1,
|
7 |
+
"classifier_dropout": null,
|
8 |
+
"directionality": "bidi",
|
9 |
+
"hidden_act": "gelu",
|
10 |
+
"hidden_dropout_prob": 0.1,
|
11 |
+
"hidden_size": 1024,
|
12 |
+
"id2label": {
|
13 |
+
"0": "\uc5ec\uc131/\uac00\uc871",
|
14 |
+
"1": "\ub0a8\uc131",
|
15 |
+
"2": "\uc131\uc18c\uc218\uc790",
|
16 |
+
"3": "\uc778\uc885/\uad6d\uc801",
|
17 |
+
"4": "\uc5f0\ub839",
|
18 |
+
"5": "\uc9c0\uc5ed",
|
19 |
+
"6": "\uc885\uad50",
|
20 |
+
"7": "\uae30\ud0c0 \ud610\uc624",
|
21 |
+
"8": "\uc545\ud50c/\uc695\uc124",
|
22 |
+
"9": "clean"
|
23 |
+
},
|
24 |
+
"initializer_range": 0.02,
|
25 |
+
"intermediate_size": 4096,
|
26 |
+
"label2id": {
|
27 |
+
"clean": 9,
|
28 |
+
"\uae30\ud0c0 \ud610\uc624": 7,
|
29 |
+
"\ub0a8\uc131": 1,
|
30 |
+
"\uc131\uc18c\uc218\uc790": 2,
|
31 |
+
"\uc545\ud50c/\uc695\uc124": 8,
|
32 |
+
"\uc5ec\uc131/\uac00\uc871": 0,
|
33 |
+
"\uc5f0\ub839": 4,
|
34 |
+
"\uc778\uc885/\uad6d\uc801": 3,
|
35 |
+
"\uc885\uad50": 6,
|
36 |
+
"\uc9c0\uc5ed": 5
|
37 |
+
},
|
38 |
+
"layer_norm_eps": 1e-12,
|
39 |
+
"max_position_embeddings": 300,
|
40 |
+
"model_type": "bert",
|
41 |
+
"num_attention_heads": 16,
|
42 |
+
"num_hidden_layers": 24,
|
43 |
+
"pad_token_id": 0,
|
44 |
+
"pooler_fc_size": 768,
|
45 |
+
"pooler_num_attention_heads": 12,
|
46 |
+
"pooler_num_fc_layers": 3,
|
47 |
+
"pooler_size_per_head": 128,
|
48 |
+
"pooler_type": "first_token_transform",
|
49 |
+
"position_embedding_type": "absolute",
|
50 |
+
"problem_type": "multi_label_classification",
|
51 |
+
"torch_dtype": "float32",
|
52 |
+
"transformers_version": "4.35.2",
|
53 |
+
"type_vocab_size": 2,
|
54 |
+
"use_cache": true,
|
55 |
+
"vocab_size": 30000
|
56 |
+
}
|
model.safetensors
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:4d3cef41ebb62cb11229c8daa3ac71055a4a823c260498ab2c97e3fe703edfaa
|
3 |
+
size 1337649096
|
special_tokens_map.json
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cls_token": "[CLS]",
|
3 |
+
"mask_token": "[MASK]",
|
4 |
+
"pad_token": "[PAD]",
|
5 |
+
"sep_token": "[SEP]",
|
6 |
+
"unk_token": "[UNK]"
|
7 |
+
}
|
tokenizer.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
tokenizer_config.json
ADDED
@@ -0,0 +1,57 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"added_tokens_decoder": {
|
3 |
+
"0": {
|
4 |
+
"content": "[PAD]",
|
5 |
+
"lstrip": false,
|
6 |
+
"normalized": false,
|
7 |
+
"rstrip": false,
|
8 |
+
"single_word": false,
|
9 |
+
"special": true
|
10 |
+
},
|
11 |
+
"1": {
|
12 |
+
"content": "[UNK]",
|
13 |
+
"lstrip": false,
|
14 |
+
"normalized": false,
|
15 |
+
"rstrip": false,
|
16 |
+
"single_word": false,
|
17 |
+
"special": true
|
18 |
+
},
|
19 |
+
"2": {
|
20 |
+
"content": "[CLS]",
|
21 |
+
"lstrip": false,
|
22 |
+
"normalized": false,
|
23 |
+
"rstrip": false,
|
24 |
+
"single_word": false,
|
25 |
+
"special": true
|
26 |
+
},
|
27 |
+
"3": {
|
28 |
+
"content": "[SEP]",
|
29 |
+
"lstrip": false,
|
30 |
+
"normalized": false,
|
31 |
+
"rstrip": false,
|
32 |
+
"single_word": false,
|
33 |
+
"special": true
|
34 |
+
},
|
35 |
+
"4": {
|
36 |
+
"content": "[MASK]",
|
37 |
+
"lstrip": false,
|
38 |
+
"normalized": false,
|
39 |
+
"rstrip": false,
|
40 |
+
"single_word": false,
|
41 |
+
"special": true
|
42 |
+
}
|
43 |
+
},
|
44 |
+
"clean_up_tokenization_spaces": true,
|
45 |
+
"cls_token": "[CLS]",
|
46 |
+
"do_basic_tokenize": true,
|
47 |
+
"do_lower_case": false,
|
48 |
+
"mask_token": "[MASK]",
|
49 |
+
"model_max_length": 300,
|
50 |
+
"never_split": null,
|
51 |
+
"pad_token": "[PAD]",
|
52 |
+
"sep_token": "[SEP]",
|
53 |
+
"strip_accents": null,
|
54 |
+
"tokenize_chinese_chars": true,
|
55 |
+
"tokenizer_class": "BertTokenizer",
|
56 |
+
"unk_token": "[UNK]"
|
57 |
+
}
|
training_args.bin
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:3f2aecbc050c591477fb82059d7fd0f2620d3975c89fd14a78c34e6318bf6720
|
3 |
+
size 4600
|
vocab.txt
ADDED
The diff for this file is too large to render.
See raw diff
|
|