An AI-powered stock price prediction app built using Streamlit, LSTM neural networks, and sentiment analysis from news, Twitter, and Google Trends data.
This tool predicts the next day's stock price using: - Historical price data (via Yahoo Finance) - News sentiment (via FinBERT) - Twitter sentiment (via VADER) - Google Trends data
The model is trained in Google Colab and integrated into the Streamlit app for live inference.
stock_tool/
├── app.py # Streamlit frontend + backend integration
├── backend/
│ ├── stock_data.py # Fetch stock data from Yahoo Finance
│ ├── sentiment.py # Fetch sentiment data from news, twitter, google trends
│ ├── features.py # Feature engineering for ML model
│ ├── model.py # LSTM model prediction handler
│ ├── train_model.py # Model training (Google Colab)
├── data/
│ ├── stock_list.csv # List of stocks with ticker and sector
├── models/ # Saved trained models and scalers
├── .env # API keys and secrets (NOT uploaded to GitHub)
├── requirements.txt # Dependencies
└── README.md
✅ Predicts next-day stock price using LSTM model
✅ Integrates FinBERT & VADER for sentiment analysis
✅ Uses Google Trends for trend-based features
✅ Sector-wise stock filtering
✅ Provides Buy/Sell/Hold recommendation
✅ Interactive Streamlit dashboard with charts
-
Clone the Repository
git clone https://github.com/Prerna77Arora/Stock_Price_Prediction_Tool.git cd Stock_Price_Prediction_Tool -
Create Virtual Environment
python -m venv venv source venv/bin/activate # macOS/Linux venv\Scripts\activate # Windows
-
Install Requirements
pip install -r requirements.txt
-
Add .env File Create a
.envfile in the project root with your API key:NEWS_API_KEY=your_api_key_here
To retrain models: 1. Open model_training.ipynb or train_model.py in
Google Colab
2. Train the LSTM model for multiple stocks
3. The trained .keras models and scalers will be saved in /models
streamlit run app.pyThen open the URL shown in your terminal (usually
http://localhost:8501).
- Predicted Price: Model's forecast for next trading day\
- Latest Price: Most recent closing price\
- Suggestion: Buy / Sell / Hold decision based on price change threshold
- Streamlit\
- TensorFlow / Keras\
- Scikit-learn\
- yFinance\
- FinBERT (Transformers)\
- VADER Sentiment Analyzer\
- Google Trends API\
- Plotly for visualization
.envfile and model weights are not included for security.\- Some APIs (like NewsAPI) require an API key.
Prerna Arora
B.Tech CSE | Rajiv Gandhi Institute of Petroleum Technology
GitHub: @Prerna77Arora