A model fine-tuned for sentiment analysis based on VietAI/vit5-base.

Labels:

  • NEG: Negative
  • POS: Positive
  • NEU: Neutral

Dataset: Comments on Shoppe (https://shopee.vn/)

Usage

import torch
from transformers import AutoTokenizer, AutoModelForSequenceClassification

tokenizer = AutoTokenizer.from_pretrained("lamsytan/sentiment-analysis-product-comment")
model = AutoModelForSequenceClassification.from_pretrained("lamsytan/sentiment-analysis-product-comment")

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]]
    #         ^                         ^                  ^
    #        NEG                       POS                NEU
Downloads last month
12
Inference Providers NEW
This model is not currently available via any of the supported Inference Providers.
The model cannot be deployed to the HF Inference API: The model has no library tag.

Model tree for lamsytan/sentiment-analysis-product-comment

Base model

VietAI/vit5-base
Finetuned
(51)
this model