File size: 1,070 Bytes
59644f7
 
 
 
 
 
 
 
 
9818414
59644f7
9818414
59644f7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---
license: apache-2.0
tags:
- bert
- kcbert
- kor-hate-sentence
- sentimental-analysis
---

# SJ-Donald/kor-hate-sentence-large

SJ-Donald/kor-hate-sentence-large is pretrained model using follow:

## Models

* [beomi/kcbert-large](https://huggingface.co/beomi/kcbert-large)

## Datasets

* [SJ-Donald/kor-hate-sentence](https://huggingface.co/datasets/SJ-Donald/kor-hate-sentence)

## How to use

```Python
from transformers import TextClassificationPipeline, BertForSequenceClassification, AutoTokenizer+

model_name = 'SJ-Donald/kor-hate-sentence-large'
model = BertForSequenceClassification.from_pretrained(model_name)

tokenizer = AutoTokenizer.from_pretrained(model_name)

pipe = TextClassificationPipeline(
    model = model,
    tokenizer = tokenizer,
    device = 0,   # cpu: -1, gpu: gpu number
    return_all_scores = True,
    function_to_apply = 'sigmoid'
)

for result in pipe("이딴 게임할 거면 방송 그만해라 어휴")[0]:
    print(result)

{'label': 'hate', 'score': 0.016597675159573555}
{'label': 'clean', 'score': 0.9842987060546875}
```