Downloads · 30 days
20
5% of all-time downloads
seongyeon1/klue-base-finetuned-nsmc
klue-base-finetuned-nsmc is a text classification model from seongyeon1. Use it when you need a label for a piece of text. It is set up for transformers.
- Finetuned from model klue/bert : (https://huggingface.co/klue/bert-base) - i got testaccuracy: 0.9041
Downloads · 30 days
20
5% of all-time downloads
All-time downloads
438
Public
Repo size
885 MB
Likes
1
Public
Click a slice to open those files.
.bin443 MB · 100%
From the Hugging Face model README
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("seongyeon1/klue-base-finetuned-nsmc")
model = AutoModelForSequenceClassification.from_pretrained("seongyeon1/klue-base-finetuned-nsmc")
from transformers import pipeline
pipe = pipeline("text-classification", model="seongyeon1/klue-base-finetuned-nsmc")
pipe("진짜 별로더라") # [{'label': 'LABEL_0', 'score': 0.999700665473938}]
pipe("굿굿") # [{'label': 'LABEL_1', 'score': 0.9875587224960327}]
from datasets import load_dataset
dataset = load_dataset('nsmc')

def tokenize_function_with_max(examples, maxlen=maxlen):
encodings = tokenizer(examples['document'],max_length=maxlen, truncation=True, padding='max_length')
return encodings

{'eval_loss': 0.2575262784957886, 'eval_accuracy': 0.9041, 'eval_runtime': 163.2129, 'eval_samples_per_second': 306.348, 'eval_steps_per_second': 9.576, 'epoch': 2.0}