Downloads · 30 days
18
4% of all-time downloads
kfkas/t5-large-korean-news-title-klue-ynat
t5-large-korean-news-title-klue-ynat is a machine learning model from kfkas. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers.
이 모델은 lcw99 / t5-large-korean-text-summary을 klue-ynat으로 훈련시켜 만든 모델입니다.<br Input = ['IT과학','경제','사회','생활문화','세계','스포츠','정치']<br OUTPUT = 각 label에 맞는 뉴스 기사 제목을 생성합니다.<br 배치단위로 추론하고싶다면 batchencodeplus를 사용하시면 됩니다.<br git…
Downloads · 30 days
18
4% of all-time downloads
All-time downloads
422
Public
Repo size
13.1 GB
Likes
0
Public
Click a slice to open those files.
.pt6.6 GB · 67%
From the Hugging Face model README
이 모델은 lcw99 / t5-large-korean-text-summary을 klue-ynat으로 훈련시켜 만든 모델입니다.<br> Input = ['IT과학','경제','사회','생활문화','세계','스포츠','정치']<br> OUTPUT = 각 label에 맞는 뉴스 기사 제목을 생성합니다.<br> 배치단위로 추론하고싶다면 batch_encode_plus를 사용하시면 됩니다.<br> git : https://github.com/taemin6697<br>
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model_dir = "kfkas/t5-large-korean-news-title-klue-ynat"
tokenizer = AutoTokenizer.from_pretrained(model_dir)
model = AutoModelForSeq2SeqLM.from_pretrained(model_dir)
model.to(device)
label_list = ['IT과학','경제','사회','생활문화','세계','스포츠','정치']
text = "IT과학"
input_ids = tokenizer.encode(text,return_tensors="pt").to(device)
with torch.no_grad():
output = model.generate(
input_ids,
do_sample=True, #샘플링 전략 사용
max_length=128, # 최대 디코딩 길이는 50
top_k=50, # 확률 순위가 50위 밖인 토큰은 샘플링에서 제외
top_p=0.95, # 누적 확률이 95%인 후보집합에서만 생성
)
decoded_output = tokenizer.batch_decode(output, skip_special_tokens=True)[0]
print(decoded_output)#SK텔레콤 스마트 모바일 요금제 시즌1 출시
More information needed
More information needed
The following hyperparameters were used during training: