Downloads · 30 days
11
7% of all-time downloads
alireza-2003/bert-fa-discrepancy-detection
bert-fa-discrepancy-detection is a text classification model from alireza-2003. Use it when you need a label for a piece of text. The card lists the license as mit.
This project fine-tunes a BERT model to classify Persian comments into two categories: complaints about Product discrepancy (True) and not (False). The model is trained on the Basalam Comments dataset.
Downloads · 30 days
11
7% of all-time downloads
All-time downloads
161
Public
Parameters
163M
651 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors651 MB · 99%
From the Hugging Face model README
This project fine-tunes a BERT model to classify Persian comments into two categories: complaints about Product discrepancy (True) and not (False). The model is trained on the Basalam Comments dataset.
HooshvareLab/bert-fa-base-uncasedYou can load and use the fine-tuned model as follows:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch
def classify_comment(text):
model_name = "alireza-2003/bert-fa-discrepancy-detection"
model = AutoModelForSequenceClassification.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad():
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits).item()
return "Discrepancy Complaint" if prediction == 1 else "Not a Complaint"
comment = "دو تا سفارش داده بودم یدونه ابی و یدونه قرمز ولی هردوتاش قرمز بود"
print(classify_comment(comment))
📝 Author: [Alireza]
📅 Last Updated: [2/16/2025]
🔗 Dataset: Kaggle Dataset