File size: 2,303 Bytes
aee84c4
9755b57
aee84c4
9755b57
aee84c4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27db509
 
aee84c4
3c233ff
aee84c4
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
---
pipeline_tag: text-classification
language: ko
license: cc-by-4.0
tags:
  - hate-speech
  - binary-classification
  - electra
  - korean
  - transformers
datasets:
  - jeanlee/kmhas_korean_hate_speech
model-index:
  - name: kmhas_electra_binary
    results:
      - task:
          name: Text Classification
          type: text-classification
        dataset:
          name: KMHAS Korean Hate Speech
          type: jeanlee/kmhas_korean_hate_speech
        metrics:
          - name: Accuracy
            type: accuracy
            value: 0.91
          - name: F1
            type: f1
            value: 0.91
          - name: Precision
            type: precision
            value: 0.91
          - name: Recall
            type: recall
            value: 0.91
---

# KMHAS 한국어 혐오 발언 분류기 (이진 분류)

한국어 문장에서 혐오 발언 여부를 분류하는 이진 텍스트 분류 모델.  
기반 모델: [`beomi/KcELECTRA-base-v2022`](https://huggingface.co/beomi/KcELECTRA-base-v2022)
학습에는 [KMHAS 한국어 혐오 표현 데이터셋](https://huggingface.co/datasets/jeanlee/kmhas_korean_hate_speech) 사용

---

## 학습 정보

- **Train Set**: 78,977개
- **Validation Set**: 8,776개
- **Test Set**: 21,939개
- **Base Model**: `beomi/KcELECTRA-base-v2022`
- **Epochs**: 5
- **Batch Size**: 16 (train/eval)
- **Evaluation Strategy**: 매 epoch마다 성능 평가
- **Save Strategy**: 매 epoch마다 저장 (최대 1개 유지)

---

## 성능 평가 (Test Set 기준)

| Metric     | Value |
|------------|-------|
| Accuracy   | 0.91  |
| Precision  | 0.91  |
| Recall     | 0.91  |
| F1-score   | 0.91  |

클래스별 성능:

- **hate**: Precision 0.92 / Recall 0.91 / F1 0.92  
- **non-hate**: Precision 0.90 / Recall 0.91 / F1 0.90

---

## 사용 예시

```python
from transformers import AutoTokenizer, AutoModelForSequenceClassification

model = AutoModelForSequenceClassification.from_pretrained("now100/kmhas_electra_binary")
tokenizer = AutoTokenizer.from_pretrained("now100/kmhas_electra_binary")

text = "개새끼들이 나라를 망치고 있다."
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)

label = outputs.logits.argmax(dim=1).item()
print("예측 결과:", "non-hate" if label == 1 else "hate")
```