rmsdud commited on
Commit
b529e28
·
verified ·
1 Parent(s): 3567f60

KoBERT 텍스트 분류 모델 업로드

Browse files
Files changed (6) hide show
  1. README.md +26 -0
  2. config.json +59 -0
  3. model.safetensors +3 -0
  4. special_tokens_map.json +7 -0
  5. tokenizer_config.json +58 -0
  6. vocab.txt +0 -0
README.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # KoBERT 분류 모델
2
+
3
+ 이 모델은 KoBERT를 기반으로 텍스트 분류를 위해 파인튜닝된 모델입니다.
4
+
5
+ ## 모델 정보
6
+ - 기본 모델: beomi/kcbert-base
7
+ - 클래스 수: 12
8
+ - 사용 방법: 아래 코드를 참조하세요
9
+
10
+ ## 사용 예시
11
+ ```python
12
+ from transformers import BertForSequenceClassification, BertTokenizer
13
+
14
+ # 모델과 토크나이저 로드
15
+ model_name = "rmsdud/kobert-classifier"
16
+ tokenizer = BertTokenizer.from_pretrained(model_name)
17
+ model = BertForSequenceClassification.from_pretrained(model_name)
18
+
19
+ # 추론
20
+ text = "분류할 텍스트를 입력하세요."
21
+ inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True, max_length=128)
22
+ outputs = model(**inputs)
23
+ logits = outputs.logits
24
+ predicted_class = logits.argmax(-1).item()
25
+ print(f"예측 클래스: predicted_class")
26
+ ```
config.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "_name_or_path": "beomi/kcbert-base",
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": 768,
12
+ "id2label": {
13
+ "0": "LABEL_0",
14
+ "1": "LABEL_1",
15
+ "2": "LABEL_2",
16
+ "3": "LABEL_3",
17
+ "4": "LABEL_4",
18
+ "5": "LABEL_5",
19
+ "6": "LABEL_6",
20
+ "7": "LABEL_7",
21
+ "8": "LABEL_8",
22
+ "9": "LABEL_9",
23
+ "10": "LABEL_10",
24
+ "11": "LABEL_11"
25
+ },
26
+ "initializer_range": 0.02,
27
+ "intermediate_size": 3072,
28
+ "label2id": {
29
+ "LABEL_0": 0,
30
+ "LABEL_1": 1,
31
+ "LABEL_10": 10,
32
+ "LABEL_11": 11,
33
+ "LABEL_2": 2,
34
+ "LABEL_3": 3,
35
+ "LABEL_4": 4,
36
+ "LABEL_5": 5,
37
+ "LABEL_6": 6,
38
+ "LABEL_7": 7,
39
+ "LABEL_8": 8,
40
+ "LABEL_9": 9
41
+ },
42
+ "layer_norm_eps": 1e-12,
43
+ "max_position_embeddings": 300,
44
+ "model_type": "bert",
45
+ "num_attention_heads": 12,
46
+ "num_hidden_layers": 12,
47
+ "pad_token_id": 0,
48
+ "pooler_fc_size": 768,
49
+ "pooler_num_attention_heads": 12,
50
+ "pooler_num_fc_layers": 3,
51
+ "pooler_size_per_head": 128,
52
+ "pooler_type": "first_token_transform",
53
+ "position_embedding_type": "absolute",
54
+ "torch_dtype": "float32",
55
+ "transformers_version": "4.48.3",
56
+ "type_vocab_size": 2,
57
+ "use_cache": true,
58
+ "vocab_size": 30000
59
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f475dcaf89475be4cf5d1dcfb5bd3d2e32683b07271282a81aa40ae743e222d4
3
+ size 435734552
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_config.json ADDED
@@ -0,0 +1,58 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ "extra_special_tokens": {},
49
+ "mask_token": "[MASK]",
50
+ "model_max_length": 300,
51
+ "never_split": null,
52
+ "pad_token": "[PAD]",
53
+ "sep_token": "[SEP]",
54
+ "strip_accents": null,
55
+ "tokenize_chinese_chars": true,
56
+ "tokenizer_class": "BertTokenizer",
57
+ "unk_token": "[UNK]"
58
+ }
vocab.txt ADDED
The diff for this file is too large to render. See raw diff