STOCKBACK / Readme.md
roshcheeku's picture
Create Readme.md
ecc8d04 verified
metadata
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)

pip install -r requirements.txt
export FLASK_SECRET_KEY="your-secret-key"
python app.py