SJ-Donald commited on
Commit
59644f7
1 Parent(s): f265ef2

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ tags:
4
+ - bert
5
+ - kcbert
6
+ - kor-hate-sentence
7
+ - sentimental-analysis
8
+ ---
9
+
10
+ # SJ-Donald/kor-hate-sentence
11
+
12
+ SJ-Donald/kor-hate-sentence is pretrained model using follow:
13
+
14
+ ## Models
15
+
16
+ * [beomi/kcbert-large](https://huggingface.co/beomi/kcbert-large)
17
+
18
+ ## Datasets
19
+
20
+ * [SJ-Donald/kor-hate-sentence](https://huggingface.co/datasets/SJ-Donald/kor-hate-sentence)
21
+
22
+ ## How to use
23
+
24
+ ```Python
25
+ from transformers import TextClassificationPipeline, BertForSequenceClassification, AutoTokenizer+
26
+
27
+ model_name = 'SJ-Donald/kor-hate-sentence-large'
28
+ model = BertForSequenceClassification.from_pretrained(model_name)
29
+
30
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
31
+
32
+ pipe = TextClassificationPipeline(
33
+ model = model,
34
+ tokenizer = tokenizer,
35
+ device = 0, # cpu: -1, gpu: gpu number
36
+ return_all_scores = True,
37
+ function_to_apply = 'sigmoid'
38
+ )
39
+
40
+ for result in pipe("이딴 게임할 거면 방송 그만해라 어휴")[0]:
41
+ print(result)
42
+
43
+ {'label': 'hate', 'score': 0.016597675159573555}
44
+ {'label': 'clean', 'score': 0.9842987060546875}
45
+ ```
config.json ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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": "hate",
14
+ "1": "clean"
15
+ },
16
+ "initializer_range": 0.02,
17
+ "intermediate_size": 4096,
18
+ "label2id": {
19
+ "clean": 1,
20
+ "hate": 0
21
+ },
22
+ "layer_norm_eps": 1e-12,
23
+ "max_position_embeddings": 300,
24
+ "model_type": "bert",
25
+ "num_attention_heads": 16,
26
+ "num_hidden_layers": 24,
27
+ "pad_token_id": 0,
28
+ "pooler_fc_size": 768,
29
+ "pooler_num_attention_heads": 12,
30
+ "pooler_num_fc_layers": 3,
31
+ "pooler_size_per_head": 128,
32
+ "pooler_type": "first_token_transform",
33
+ "position_embedding_type": "absolute",
34
+ "problem_type": "multi_label_classification",
35
+ "torch_dtype": "float32",
36
+ "transformers_version": "4.35.2",
37
+ "type_vocab_size": 2,
38
+ "use_cache": true,
39
+ "vocab_size": 30000
40
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:254c49e80b045593739e0a1bd38f051b62dae738ff73b79bbfd6bc3cd99d6ca2
3
+ size 1337616296
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:bf886eddc1d43f2f0efdee75b2595756368c96bc5f79257d8ba9c3bc152d5577
3
+ size 4600
vocab.txt ADDED
The diff for this file is too large to render. See raw diff