SelmaNajih001's picture
Update README.md
647e1be verified
---
title: Stock Prediction Explanation
emoji: πŸ’¬
colorFrom: yellow
colorTo: purple
sdk: gradio
sdk_version: 5.42.0
app_file: app.py
pinned: false
hf_oauth: true
hf_oauth_scopes:
- inference-api
license: apache-2.0
short_description: AI that predicts stock moves from news and explains why
---
# Explainable Stock Prediction with GRPO + RAG
---
## About this Space
This demo showcases a **financial NLP model** that predicts stock market reactions to news events while also providing a **natural language explanation**.
Unlike standard classifiers (which only output UP/DOWN/NEUTRAL), this model combines:
- **GRPO (Group Relative Policy Optimization)** β†’ reinforcement learning to refine predictions through self-reflection.
- **RAG (Retrieval-Augmented Generation)** β†’ retrieving past financial events to ground explanations in historical context.
The result: **predictions that are both accurate and interpretable**.
---
## How it works
1. **Input** β†’ A financial news headline or event description.
2. **GRPO loop** β†’ The model generates a prediction and, if wrong, reflect to improve future reasoning.
3. **RAG retrieval** β†’ Relevant historical events are retrieved to enrich the explanation.
4. **Output** β†’
- Chosen Stock
- Price Prediction (UP/DOWN or percentage change)
- Explanation (short and clear, grounded in past events)
---