CoolFace
Modelpublic

robinGiri2024/nepse-sentiment-analyzer

sourceHugging Facemitupdated 1y agoView on Hugging Face
0likes11downloads
Model Card

NEPSE Sentiment Analyzer 📈

A BiLSTM-CNN hybrid neural network for sentiment analysis of Nepali financial text, specifically designed for Nepal Stock Exchange (NEPSE) related content.

Model Description

This model performs 5-class sentiment classification on Nepali text:

  • —Very Negative (0): बहुत नकारात्मक
  • —Negative (1): नकारात्मक
  • —Neutral (2): तटस्थ
  • —Positive (3): सकारात्मक
  • —Very Positive (4): बहुत सकारात्मक

Architecture

  • —Model Type: BiLSTM-CNN Hybrid
  • —Parameters: 126,333 trainable parameters
  • —Framework: TensorFlow/Keras
  • —Input: Nepali text (max 100 tokens)
  • —Output: 5-class probability distribution

Architecture Details:

Input Layer (100 tokens) 
    ↓
Embedding Layer (100 dims)
    ↓
BiLSTM Layer (64 units)
    ↓
CNN Layer (128 filters, kernel=3)
    ↓
Global Max Pooling
    ↓
Dense Layer (32 units, ReLU)
    ↓
Output Layer (5 units, Softmax)

Training Data

  • —Dataset Size: 2,986 samples
  • —Language: Nepali (Devanagari script)
  • —Domain: Financial/Stock Market
  • —Distribution: Balanced across 5 sentiment classes
  • —Augmentation: Synonym replacement and paraphrasing

Performance

MetricScore
Training Accuracy97.66%
Validation Accuracy~95%
Parameters126,333
Model Size1.5 MB

Usage

python
import tensorflow as tf
from tensorflow.keras.models import load_model
import numpy as np

# Load the model
model = load_model('best_model.keras')

# Prepare text (example)
def preprocess_text(text):
    # Add your preprocessing logic here
    # Tokenization, padding, etc.
    return processed_text

# Predict sentiment
text = "शेयर बजारमा राम्रो वृद्धि भएको छ"
processed = preprocess_text(text)
prediction = model.predict(processed)
sentiment_class = np.argmax(prediction)

# Classes: 0=Very Negative, 1=Negative, 2=Neutral, 3=Positive, 4=Very Positive

Applications

  • —📊 Stock Market Analysis: Analyze sentiment of NEPSE-related news
  • —📱 Social Media Monitoring: Track public sentiment about stocks
  • —🤖 Trading Bots: Incorporate sentiment signals
  • —📰 News Analysis: Classify financial news sentiment
  • —📈 Investment Research: Gauge market sentiment

Limitations

  • —Trained specifically on financial/stock market terminology
  • —Performance may vary on general Nepali text
  • —Requires preprocessing for optimal results
  • —Best suited for short to medium-length texts

Training Process

  1. 1.Data Collection: 500+ samples per sentiment class
  2. 2.Augmentation: Expanded to 2,986 total samples
  3. 3.Architecture: BiLSTM for sequence + CNN for n-grams
  4. 4.Optimization: Adam optimizer with early stopping
  5. 5.Validation: Stratified k-fold cross-validation

Citation

bibtex
@misc{nepse-sentiment-2025,
  title={NEPSE Sentiment Analyzer: BiLSTM-CNN for Nepali Financial Text},
  author={Your Name},
  year={2025},
  publisher={Hugging Face},
  url={https://huggingface.co/your-username/nepse-sentiment-analyzer}
}

License

MIT License - Feel free to use for research and commercial applications.

Contact

For questions or collaboration opportunities, please reach out via GitHub or Hugging Face discussions.


Built with ❤️ for the Nepali ML community

robinGiri2024/nepse-sentiment-analyzer · CoolFace