Downloads · 30 days
29
1% of all-time downloads
minhtoan/t5-small-vietnamese-news
t5-small-vietnamese-news is a summarization model from minhtoan. Use it when you need a shorter version of a longer text. It is set up for transformers. The card lists the license as mit.
State-of-the-art lightweights pretrained Transformer-based encoder-decoder model for Vietnamese.
Downloads · 30 days
29
1% of all-time downloads
All-time downloads
2.6K
Public
Repo size
3.6 GB
Likes
4
Public
Click a slice to open those files.
.bin1.2 GB · 98%
From the Hugging Face model README
State-of-the-art lightweights pretrained Transformer-based encoder-decoder model for Vietnamese.
Model trained on dataset Vietnamese News with input length = 512, output length = 150
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
# Example test data on VNExpress: https://vnexpress.net/ong-hiep-khung-khong-nhan-toi-trong-vu-chay-gan-benh-vien-nhi-4541483.html
tokenizer = AutoTokenizer.from_pretrained("minhtoan/t5-small-vietnamese-news")
model = AutoModelForSeq2SeqLM.from_pretrained("minhtoan/t5-small-vietnamese-news")
model.cuda()
src = 'VKS cáo buộc ông Nguyễn Thế Hiệp có sai phạm trong vụ cháy gần Bệnh viện Nhi trung ương khiến 2 người chết, thiệt hại 1,9 tỷ đồng song bị cáo khẳng định vô tội. Mức án đề nghị 9-10 năm tù với bị cáo 73 tuổi được đại diện VKSND quận Ba Đình đưa ra chiều 28/11, quy buộc phạm tội Vi phạm quy định về phòng cháy chữa cháy, theo Điều 313 Bộ luật Hình sự. VKS nhận định ông Hiệp có lỗi trong việc vận hành nhà trọ không phép, không đủ điều kiện an toàn phòng cháy chữa cháy, gây thiệt hại về tài sản và khiến hai người chết. Tuy nhiên, bị cáo chưa bồi thường. Bản luận tội nêu, tại phiên tòa hôm nay ông Hiệp "chưa tỏ thái độ ăn năn hối hận, có nhân thân đặc biệt xấu". Từ hàng chục năm trước, ông từng 11 lần bị lập danh chỉ bản về hành vi trộm cắp, năm 1985 lại nhận 18 năm tù về các tội cướp tài sản, hiếp dâm, đưa hối lộ...'
tokenized_text = tokenizer.encode(src, return_tensors="pt").cuda()
model.eval()
summary_ids = model.generate(tokenized_text, max_length=150)
output = tokenizer.decode(summary_ids[0], skip_special_tokens=True)
output
Phan Minh Toan