kor-hate-sentence / README.md
SJ-Donald's picture
Upload folder using huggingface_hub
9b7dc2c verified
---
license: apache-2.0
tags:
- bert
- kcbert
- kor-hate-sentence
- sentimental-analysis
---
# SJ-Donald/kor-hate-sentence
SJ-Donald/kor-hate-sentence is pretrained model using follow:
## Models
* [beomi/kcbert-base](https://huggingface.co/beomi/kcbert-base)
## 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'
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.9767946600914001}
{'label': 'clean', 'score': 0.023970650508999825}
```