Downloads · 30 days
10
36% of all-time downloads
AznurOde21/indo-sentimen-tokopedia
indo-sentimen-tokopedia is a machine learning model from AznurOde21. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as mit.
Model ini dilatih menggunakan IndoBERT (indobenchmark/indobert-base-p1) untuk klasifikasi sentimen komentar pelanggan Tokopedia (positif / negatif).
Downloads · 30 days
10
36% of all-time downloads
All-time downloads
28
Public
Parameters
124M
498 MB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors498 MB · 100%
From the Hugging Face model README
Model ini dilatih menggunakan IndoBERT (indobenchmark/indobert-base-p1) untuk klasifikasi sentimen komentar pelanggan Tokopedia (positif / negatif).
Dataset berupa komentar dari Tokopedia dengan label berdasarkan rating (≥4 = positif, ≤3 = negatif).
from transformers import BertTokenizer, BertForSequenceClassification
import torch
tokenizer = BertTokenizer.from_pretrained("username/indo-sentimen-tokopedia")
model = BertForSequenceClassification.from_pretrained("username/indo-sentimen-tokopedia")
text = "Barang sangat buruk dan tidak sesuai"
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
logits = model(**inputs).logits
probs = torch.nn.functional.softmax(logits, dim=1)
pred = torch.argmax(probs)
print("Sentimen:", "Positif" if pred.item() == 1 else "Negatif")