Downloads · 30 days
0
madhav112/hindi-sentiment-analysis
hindi-sentiment-analysis is a machine learning model from madhav112. 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 apache-2.0.
This repository contains a Hindi sentiment analysis model that can classify text into three categories: negative (neg), neutral (neu), and positive (pos). The model has been trained and evaluated using various BERT-ba…
Downloads · 30 days
0
Access
Public
Updated Feb 24, 2025
Repo size
1.1 GB
Likes
0
Public
Click a slice to open those files.
.pt1.1 GB · 100%
From the Hugging Face model README
This repository contains a Hindi sentiment analysis model that can classify text into three categories: negative (neg), neutral (neu), and positive (pos). The model has been trained and evaluated using various BERT-based architectures, with XLM-RoBERTa showing the best performance.

Our extensive evaluation shows:

The confusion matrices show the prediction performance for each model:

The detailed per-class metrics show:
Precision:
Recall:
F1-Score:

The training graphs show:
from transformers import AutoModelForSequenceClassification, AutoTokenizer
# Load the model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("madhav112/hindi-sentiment-analysis")
model = AutoModelForSequenceClassification.from_pretrained("madhav112/hindi-sentiment-analysis")
# Example usage
text = "यह फिल्म बहुत अच्छी है"
inputs = tokenizer(text, return_tensors="pt", padding=True, truncation=True)
outputs = model(**inputs)
predictions = outputs.logits.argmax(-1)
The repository contains experiments with multiple BERT-based architectures:
XLM-RoBERTa (Best performing)
mBERT
Custom-BERT-Attention
IndicBERT
The model was trained on a Hindi sentiment analysis dataset with three classes:
The confusion matrices show balanced class distribution and strong performance across categories.
The model was trained for 7 epochs with the following characteristics:
If you use this model in your research, please cite:
@misc{madhav2024hindisentiment,
author = {Madhav},
title = {Hindi Sentiment Analysis Model},
year = {2024},
publisher = {HuggingFace},
howpublished = {\url{https://huggingface.co/madhav112/hindi-sentiment-analysis}}
}
Madhav
This project is licensed under the MIT License - see the LICENSE file for details.
Special thanks to the HuggingFace team and the open-source community for providing the tools and frameworks that made this model possible.
language: hi tags: