Downloads · 30 days
32
36% of all-time downloads
lamsytan/sentiment-analysis-base-phobert
sentiment-analysis-base-phobert is a machine learning model from lamsytan. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A model fine-tuned for sentiment analysis based on VietAI/vit5-base.
Downloads · 30 days
32
36% of all-time downloads
All-time downloads
88
Public
Repo size
1.1 GB
Likes
0
Public
Click a slice to open those files.
.bin540 MB · 100%
From the Hugging Face model README
A model fine-tuned for sentiment analysis based on VietAI/vit5-base.
Labels:
Dataset: Comments on Shoppe (https://shopee.vn/)
import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("lamsytan/sentiment-analysis-base-phobert")
model = AutoModelForSequenceClassification.from_pretrained("lamsytan/sentiment-analysis-base-phobert")
sentence = "Áo đẹp lắm nhá lần sau sẽ ghé tiếp ạ"
inputs = tokenizer(sentence, return_tensors="pt", padding=True, truncation=True)
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
probabilities = torch.softmax(logits, dim=-1)
print(probabilities.tolist())
# Output:
# [[0.010827462188899517, 0.9538241624832153, 0.035348404198884964]]
# ^ ^ ^