--- 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) ---