Spaces:
Sleeping
Sleeping
| 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/<symbol>` | 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 | |