--- title: Stock Sentiment Prediction emoji: ๐Ÿ“ˆ colorFrom: blue colorTo: pink sdk: docker app_file: app.py pinned: false --- # ๐Ÿ“Š Stock Sentiment Analysis and Prediction This Hugging Face Space provides real-time stock price prediction using LSTM models trained on historical stock data and sentiment analysis from Twitter/Reddit. ## ๐Ÿš€ Features - ๐Ÿ“‰ Predict future stock prices (AAPL, AMZN, GOOG, MSFT, TSLA) - ๐Ÿ’ฌ Analyze sentiment of social media text (VADER) - ๐Ÿง  Uses LSTM models trained on historical and sentiment-augmented data - ๐Ÿ“ˆ Real-time stock data via Yahoo Finance ## ๐Ÿง  Tech Stack - Flask (backend) - TensorFlow (LSTM models) - yFinance, PRAW, Tweepy (data collection) - VADER (sentiment analysis) - Matplotlib (charts) - Hugging Face Spaces (deployment via Docker) ## ๐Ÿงช Usage ### Web Interface - Choose a stock ticker and optionally enable sentiment-based prediction. - Enter recent tweets/news/comments. - Get predicted stock price, trend chart, and delta. ### API Endpoints | Endpoint | Method | Description | |-----------------------|--------|--------------------------------------| | `/predict` | POST | Predict stock price (HTML form) | | `/sentiment` | GET/POST | Analyze text sentiment | | `/api/stock/` | GET | Get real-time stock data | | `/api/sentiment` | POST | API to get sentiment label and score| ## โš™๏ธ Setup (Local) ```bash pip install -r requirements.txt export FLASK_SECRET_KEY="your-secret-key" python app.py