Downloads · 30 days
21
11% of all-time downloads
mohit4519/nepali-sentiment
nepali-sentiment is a text classification model from mohit4519. Use it when you need a label for a piece of text. The card lists the license as apache-2.0.
This model is a fine-tuned BERT model for Nepali sentiment analysis, exported to ONNX format for optimized inference.
Downloads · 30 days
21
11% of all-time downloads
All-time downloads
186
Public
Parameters
109M
876 MB on disk
Likes
0
Public
Click a slice to open those files.
.onnx438 MB · 50%
From the Hugging Face model README
This model is a fine-tuned BERT model for Nepali sentiment analysis, exported to ONNX format for optimized inference.
pip install transformers optimum[onnxruntime]
from transformers import AutoTokenizer
from optimum.onnxruntime import ORTModelForSequenceClassification
import torch
# Load model and tokenizer
model = ORTModelForSequenceClassification.from_pretrained("mohit4519/nepali-sentiment")
tokenizer = AutoTokenizer.from_pretrained("Shushant/nepaliBERT")
# Predict sentiment
text = "यो धेरै राम्रो छ"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
prediction = torch.argmax(outputs.logits, dim=-1).item()
sentiment_map = {0: 'Negative', 1: 'Positive', 2: 'Neutral'}
print(f"Sentiment: {sentiment_map[prediction]}")
Trained on Nepali sentiment dataset containing social media text, reviews, and comments.