Stock-Market-Sentiment-Analysis-with-Historical-Stocks-Data-Combined-for-Predicting-Stock-Price-Tool
MarketMind is a comprehensive web application that combines stock market sentiment analysis with historical data to predict stock prices for the Indian market. It leverages machine learning models including LSTM for price prediction and a fine-tuned FinBERT model for news sentiment analysis, providing users with data-driven insights for investment decisions.
Click the image above to watch the full demo or view it directly here.
- User authentication and dashboard navigation
- Real-time market movers tracking
- Comprehensive fundamental analysis
- News sentiment analysis with FinBERT
- Stock price prediction using LSTM
- Interactive charts and visualizations
- Firebase Authentication: Secure login/registration system
- User Profiles: Personalized dashboards and preferences
- Session Management: Secure session handling with Firebase
- Market Movers: Track top gainers, losers, and most active stocks
- Stock Bookmarking: Save and manage favorite stocks
- Real-time Data: Live stock prices and market updates
- Historical Analysis: Comprehensive historical data visualization
- Financial Ratios: P/E, P/B, ROE, ROA, and more
- Peer Comparison: Compare stocks within the same sector
- Trend Analysis: Historical performance and growth metrics
- Interactive Charts: Plotly-powered visualizations
- FinBERT Integration: Fine-tuned model for Indian financial news
- Sentiment Scoring: Positive, negative, and neutral sentiment classification
- News Aggregation: Latest market news from multiple sources
- Impact Analysis: Correlation between news sentiment and stock movements
- LSTM Models: Deep learning for time series forecasting
- Multi-factor Analysis: Combines technical indicators with sentiment
- Prediction Confidence: Model accuracy and confidence intervals
- Backtesting: Historical prediction performance evaluation
- Dark/Light Mode: Toggle between themes
- Responsive Design: Mobile-first approach
- Interactive Elements: Smooth animations and transitions
- Three.js Integration: 3D visualizations and effects
π¦ MarketMind/
βββ π app.py # Main Flask application
βββ π requirements.txt # Python dependencies
βββ π Dockerfile # Docker configuration
βββ π README.md # Project documentation
βββ π static/
β βββ π css/
β β βββ π style.css # Main stylesheet
β β βββ π fundamentals.css
β β βββ π movers.css
β β βββ π news.css
β β βββ π predict.css
β βββ π js/
β β βββ π firebase-config.js # Firebase configuration
β β βββ π auth.js # Authentication logic
β β βββ π fundamentals.js # Fundamental analysis
β β βββ π movers.js # Market movers functionality
β β βββ π news.js # News and sentiment
β β βββ π predict.js # Price prediction
β β βββ π main.js # Core functionality
β βββ π models/
β β βββ π finbert_sentiment089/ # FinBERT model files
β βββ π pipelines/ # ML pipeline scripts
β βββ π video/ # Demo videos
βββ π templates/
β βββ π base.html # Base template
β βββ π home.html # Homepage
β βββ π login.html # Authentication
β βββ π movers.html # Market movers
β βββ π fundamentals.html # Fundamental analysis
β βββ π news.html # News sentiment
β βββ π predict.html # Price prediction
β βββ π privacy.html # Privacy policy
β βββ π terms.html # Terms of service
β βββ π disclaimer.html # Legal disclaimer
β βββ π 404.html # Error page
- Flask: Web framework
- Python 3.12+: Core language
- Firebase Admin SDK: Backend authentication
- Pandas & NumPy: Data manipulation
- Scikit-learn: Machine learning utilities
- TensorFlow/Keras: Deep learning models
- MongoDB: NoSQL database for news and sentiment data
- Plotly: Data visualization
- Docker: Containerization for deployment
- Gunicorn: WSGI server for production
- HTML5/CSS3: Modern web standards
- JavaScript ES6+: Interactive functionality
- Firebase SDK: Client-side authentication
- Plotly.js: Interactive charts
- Three.js: 3D visualizations
- Bootstrap: Responsive design
- LSTM Networks: Stock price prediction
- FinBERT: Financial sentiment analysis
- Technical Indicators: RSI, MACD, Bollinger Bands
- Feature Engineering: Combined sentiment-price features
- Firebase Firestore: NoSQL database
- Firebase Storage: File storage
- Local Storage: Browser caching
- Python 3.12 or higher
- Flask 2.0+ for web framework
- Firebase Project with Authentication and Firestore enabled
- Git for version control
- 16GB+ RAM recommended for ML models
git clone https://github.com/AryanMithbawkar/Stock-Market-Sentiment-Analysis-with-Historical-Stocks-Data-Combined-for-Predicting-Stock-Price-Tool.git
cd Stock-Market-Sentiment-Analysis-with-Historical-Stocks-Data-Combined-for-Predicting-Stock-Price-Toolpython -m venv venv
# Windows
venv\Scripts\activate
# macOS/Linux
source venv/bin/activatepip install -r requirements.txt- Create a new Firebase project at Firebase Console
- Enable Authentication (Email/Password)
- Create a Firestore database
- Get your Firebase config and update firebase-config.js:
const firebaseConfig = {
apiKey: "your-api-key",
authDomain: "your-project.firebaseapp.com",
projectId: "your-project-id",
storageBucket: "your-project.appspot.com",
messagingSenderId: "123456789",
appId: "your-app-id",
};- Visit Kaggle FinBERT Model
- Download the model files
- Extract to finbert_sentiment089
python app.pyVisit https://huggingface.co/spaces/AronWolverine/MarketMindPto access the application.
# Build the image
docker build -t marketmind .
# Run the container
docker run -p 5000:5000 marketmindversion: "3.8"
services:
marketmind:
build: .
ports:
- "5000:5000"
environment:
- FLASK_ENV=production- Register a new account or login with existing credentials
- Email verification may be required
- View top gainers, losers, and most active stocks
- Bookmark stocks for quick access
- Click on any stock for detailed analysis
- Search for any Indian stock by symbol
- View comprehensive financial ratios
- Compare with industry peers
- Analyze historical trends
- Read latest market news
- View sentiment scores for each article
- Understand market mood and its impact
- Select a stock and prediction timeframe
- View LSTM model predictions
- Analyze prediction confidence
- Download prediction reports
- Subscribe to weekly market insights
- Receive personalized stock recommendations
- Get notified of major market events
- Architecture: 3-layer LSTM with dropout
- Features: OHLCV data, technical indicators, sentiment scores
- Training: 80/20 train-test split
- Evaluation: MAE, RMSE, MAPE metrics
- Base Model: BERT-base-uncased
- Fine-tuning: Indian financial news dataset
- Classes: Positive, Negative, Neutral
- Accuracy: 89% on test set
POST /auth/login- User loginPOST /auth/register- User registrationPOST /auth/logout- User logout
GET /api/movers- Market movers dataGET /api/fundamentals/<symbol>- Stock fundamentalsGET /api/news- Latest news with sentimentPOST /api/predict- Stock price prediction
GET /api/bookmarks- User bookmarksPOST /api/bookmark- Add bookmarkDELETE /api/bookmark/<symbol>- Remove bookmark
python -m pytest tests/python -m pytest --cov=app tests/python -m pytest tests/integration/- Model quantization for faster inference
- Batch processing for multiple predictions
- Caching for frequently accessed data
- Lazy loading for charts and images
- Code splitting for JavaScript modules
- Service worker for offline functionality
- Redis caching for API responses
- Database indexing for faster queries
- Connection pooling for database
- Authentication: Firebase security rules
- Input Validation: Server-side validation for all inputs
- Rate Limiting: API rate limiting to prevent abuse
- HTTPS: SSL/TLS encryption in production
- CORS: Proper CORS configuration
- Firebase Analytics for user behavior
- Error tracking with Sentry
- Performance monitoring with Firebase Performance
- Prediction accuracy tracking
- Model drift detection
- A/B testing for model improvements
- Follow PEP 8 style guide
- Write unit tests for new features
- Update documentation for API changes
- Use meaningful commit messages
This project is licensed under the MIT License - see the LICENSE file for details.
This application is for educational and informational purposes only. It does not constitute financial advice, and users should conduct their own research before making investment decisions. The predictions and analysis provided should not be the sole basis for investment choices.
- Authors: Aryan Mithbawkar & Ritesh Salunkhe
- Email: [email protected] & [email protected]
- Issues: GitHub Issues
- Documentation: Wiki
- FinBERT Model: Hugging Face Transformers
- Stock Data: Yahoo Finance API
- News Data: Various financial news APIs
- UI Components: Bootstrap, Plotly, Three.js
- Hosting: Firebase Hosting
- Portfolio management features
- Real-time alerts and notifications
- Advanced charting tools
- Social trading features
- Mobile app (React Native)
- Advanced ML models (Transformer-based)
- Options and derivatives analysis
- Backtesting engine
- Multi-market support (US, UK markets)
- Cryptocurrency analysis
- AI-powered investment advisor
- Enterprise features
Built with β€οΈ by Aryan Mithbawkar & Ritesh Salunkhe
Β© 2025 MarketMind. All rights reserved.