Bangla twoclass Sentiment Analyzer

ProviderArunavaonly
Categorysentiment-analysis
Licensemit
Downloads459.8K
Stars0

Overview

The Bangla Two-Class Sentiment Analyzer is a specialized NLP model designed for binary sentiment classification of Bengali text. For developers building localized applications in the South Asian market, this model provides a streamlined way to categorize user-generated content into positive or negative polarities. It is particularly useful for automating customer feedback loops, monitoring social media sentiment, or filtering product reviews without the overhead of deploying a massive general-purpose LLM. The model is released under the MIT license, ensuring flexibility for commercial integration and deployment across various cloud environments or edge devices.

Highlights

  • Optimized for binary positive and negative Bengali sentiment classification
  • MIT license allows for flexible commercial and private integration
  • Ideal for automated feedback analysis and social media monitoring
  • Lightweight alternative to general-purpose multilingual LLMs

Usage

Install
# Install Hugging Face transformers
pip install transformers torch
SDK Usage
# Load model with transformers
from transformers import AutoModel, AutoTokenizer

model = AutoModel.from_pretrained("Arunavaonly/Bangla-twoclass-Sentiment-Analyzer")
tokenizer = AutoTokenizer.from_pretrained("Arunavaonly/Bangla-twoclass-Sentiment-Analyzer")

Hugging Face Download

We recommend downloading the model via the Hugging Face CLI or Hub SDK.

Guidance:Before downloading, install huggingface_hub with:

Guidance
pip install -U huggingface_hub

CLI Download

Download the full repository

Download the full repository
huggingface-cli download Arunavaonly/Bangla-twoclass-Sentiment-Analyzer

Download a single file to a local folder (e.g. config.json into ./dir)

Download a single file to a local folder (e.g. config.json into ./dir)
huggingface-cli download Arunavaonly/Bangla-twoclass-Sentiment-Analyzer config.json --local-dir ./dir

See the official docs for more CLI options

SDK Download

SDK Download
# 模型下载
from huggingface_hub import snapshot_download
model_dir = snapshot_download('Arunavaonly/Bangla-twoclass-Sentiment-Analyzer')

Git Download

Make sure git-lfs is installed first

Git Download
git lfs install
git clone https://huggingface.co/Arunavaonly/Bangla-twoclass-Sentiment-Analyzer

To skip LFS large-file downloads, use:

Skip LFS
GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/Arunavaonly/Bangla-twoclass-Sentiment-Analyzer

Model files are hosted on the Hugging Face Hub — download directly via HF CLI / SDK / Git, not through this site.

PyTorch / Transformers Usage

Install Transformers

Install Transformers
pip install -U transformers torch

Load the model and run inference

Load the model and run inference
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained('Arunavaonly/Bangla-twoclass-Sentiment-Analyzer')
tokenizer = AutoTokenizer.from_pretrained('Arunavaonly/Bangla-twoclass-Sentiment-Analyzer')

Full Documentation

来源: HuggingFace

---
license: mit
base_model: xlm-roberta-base
tags:

  • generated_from_trainer

metrics:
  • f1

model-index:
  • name: Bangla-Twoclass-Sentiment-Analyzer

results: []
---

<!-- This model card has been generated automatically according to the information the Trainer had access to. You
should probably proofread and complete it, then remove this comment. -->

Bangla-Twoclass-Sentiment-Analyzer

This model is a fine-tuned version of xlm-roberta-base on the None dataset.
It achieves the following results on the evaluation set:

  • Loss: 2.7755

  • F1: 0.6113

Model description

More information needed

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 3e-05

  • train_batch_size: 16

  • eval_batch_size: 16

  • seed: 42

  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08

  • lr_scheduler_type: linear

  • training_steps: 1800

  • mixed_precision_training: Native AMP

Training results

| Training Loss | Epoch | Step | Validation Loss | F1 |
|:-------------:|:-----:|:----:|:---------------:|:------:|
| No log | 2.53 | 200 | 0.9869 | 0.4635 |
| No log | 5.06 | 400 | 0.8978 | 0.5858 |
| 0.8692 | 7.59 | 600 | 1.1978 | 0.6149 |
| 0.8692 | 10.13 | 800 | 1.5145 | 0.6112 |
| 0.3138 | 12.66 | 1000 | 2.0353 | 0.6041 |
| 0.3138 | 15.19 | 1200 | 2.4316 | 0.6203 |
| 0.3138 | 17.72 | 1400 | 2.6025 | 0.6002 |
| 0.0769 | 20.25 | 1600 | 2.6247 | 0.6082 |
| 0.0769 | 22.78 | 1800 | 2.7755 | 0.6113 |

Framework versions

  • Transformers 4.37.2
  • Pytorch 2.1.0+cu121
  • Datasets 2.17.1
  • Tokenizers 0.15.2
Join our Telegram