Downloads · 30 days
20
0% of all-time downloads
seongju/klue-tc-bert-base-multilingual-cased
klue-tc-bert-base-multilingual-cased is a text classification model from seongju. Use it when you need a label for a piece of text. It is set up for transformers.
language : Korean fine tuning data : klue-tc (a.k.a. YNAT) License : CC-BY-SA 4.0 Base model : bert-base-multilingual-cased input : news headline output : topic
Downloads · 30 days
20
0% of all-time downloads
All-time downloads
4.2K
Public
Parameters
178M
1.4 GB on disk
Likes
1
Public
Click a slice to open those files.
.bin712 MB · 50%
How the weights are stored.
F32178M · 100%
From the Hugging Face model README
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained (
"seongju/klue-tc-bert-base-multilingual-cased"
)
model = AutoModelForSequenceClassification.from_pretrained (
"seongju/klue-tc-bert-base-multilingual-cased"
)
mapping = {0: 'IT과학', 1: '경제', 2: '사회',
3: '생활문화', 4: '세계', 5: '스포츠', 6: '정치'}
inputs = tokenizer(
"백신 회피 가능성? 남미에서 새로운 변이 바이러스 급속 확산 ",
padding=True, truncation=True, max_length=128, return_tensors="pt"
)
outputs = model(**inputs)
probs = outputs[0].softmax(1)
output = mapping[probs.argmax().item()]