Persian Sentiment Analysis for Delivery Complaints

📌 Introduction

This model is fine-tuned HooshvareLab/bert-fa-base-uncased model to classify Persian comments related to delivery complaints. The model predicts whether a comment is about a negative delivery experience or not.

📊 Dataset

The model was fine-tuned using the ** Basalam comments ** dataset from Kaggle: 📂 Basalam Comments Dataset

This dataset contains Persian comments labeled as:

  • 1 (Bad Delivery Complaint): The comment expresses dissatisfaction with delivery service.
  • 0 (Not a Delivery Complaint): The comment is unrelated to delivery issues.

🛠 Training Details

  • Base Model: HooshvareLab/bert-fa-base-uncased
  • Fine-Tuning Dataset: Basalam comments
  • NoteBook
  • Evaluation Metrics:
    • Accuracy: 91%
    • F1-score: 87%

📥 How to Use

You 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_bad_delivery"
    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 "Bad Delivery Complaint" if prediction == 1 else "Not a Complaint"

comment = "بسته من خیلی دیر رسید و اصلا راضی نبودم!"
print(classify_comment(comment))

📌 Next Steps

  • Further fine-tuning with more diverse Persian datasets.
  • Improve model performance by handling edge cases better.
  • Deploy as an API for real-time classification.

📝 Author: [Alireza]
📅 Last Updated: [2/16/2025]
🔗 Dataset: Kaggle Dataset

Downloads last month
38
Safetensors
Model size
163M params
Tensor type
F32
·
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 alireza-2003/bert_fa_bad_delivery

Finetuned
(11)
this model