ONNX Model Zoo

mohit4519/nepali-sentiment

By mohit4519 · ↓ 2 · ♥ 0 · Updated 2025-11-22

What's in this repo

This page lists the files in mohit4519/nepali-sentiment, including model.onnx.

  • 1 ONNX models (.onnx files)
  • 5 files, including 1 .md, 1 .json, 1 .onnx, 1 .safetensors
  • Last updated 2025-11-22

ONNX files

File Size Download
model.onnx — Download

How to use

These ONNX files can be loaded with ONNX Runtime. To inspect a model graph, upload the file to the Netron viewer. Download links point to the original files on Hugging Face.

README

Nepali Sentiment Analysis (ONNX)

This model is a fine-tuned BERT model for Nepali sentiment analysis, exported to ONNX format for optimized inference.

Model Details

  • Base Model: Shushant/nepaliBERT
  • Task: Sentiment Classification (3-class)
  • Labels:
    • 0: Negative
    • 1: Positive
    • 2: Neutral
  • Format: ONNX (optimized for fast inference)

Usage

Installation

pip install transformers optimum[onnxruntime]

Inference

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]}")

Performance on test set

  • Macro F1 Score: 0.73
  • Accuracy: 0.76

Training Data

Trained on Nepali sentiment dataset containing social media text, reviews, and comments.

Limitations

  • Best performance on Nepali text
  • May have reduced accuracy on code-mixed or transliterated text
  • Performance varies across different domains

Model info

onnx safetensors bert sentiment-analysis nepali text-classification ne dataset:custom-nepali-sentiment license:apache-2.0 model-index region:us
↓ 2 ♥ 0

Created: 2025-11-21

Updated: 2025-11-22

View on Hugging Face

Files (5)

.gitattributes
README.md
config.json
model.onnx ONNX
model.safetensors

Related models