A machine learning-powered stock prediction platform that analyzes news sentiment to provide BUY/SELL recommendations with AI-powered explanations.
- 🤖 Machine Learning Model: Random Forest trained on historical news sentiment vs stock performance
- 📰 Real-time News Analysis: Alpha Vantage API integration for live news sentiment
- 🧠 AI Explanations: OpenAI GPT-3.5-turbo powered explanations for each recommendation
- 📊 Top 5 BUY Recommendations: Auto-generated list of highest confidence stocks
- 🎨 Professional UI: Clean, modern financial platform design
- ⚡ Live Predictions: Real-time analysis for any stock ticker
- Backend: Flask (Python)
- ML Model: Random Forest (scikit-learn)
- AI: OpenAI GPT-3.5-turbo
- Data: Alpha Vantage API
- Frontend: HTML/CSS/JavaScript
- Styling: Professional white/blue theme
git clone <your-repo-url>
cd sentiswingpython -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the root directory:
# OpenAI API Configuration
OPENAI_API_KEY=your_openai_api_key_here
# Flask Configuration
FLASK_ENV=development
FLASK_DEBUG=True- OpenAI API Key: Get from https://platform.openai.com/api-keys
- Alpha Vantage API Key: Get from https://www.alphavantage.co/support/#api-key
source venv/bin/activate
python app.pyVisit http://localhost:5000 to use the application.
- Search for any stock (e.g., AAPL, NFLX, TSLA)
- View ML prediction with confidence score
- Click "Get AI Explanation" for detailed analysis
- Browse Top 5 BUY recommendations on the homepage
sentiswing/
├── app.py # Flask backend
├── sentiswing_trainer.py # ML model training
├── sentiswing_predictor.py # Prediction logic
├── templates/
│ └── index.html # Frontend dashboard
├── .env # Environment variables (not in git)
├── .gitignore # Git ignore rules
├── requirements.txt # Python dependencies
└── data files...
- "Let me search NFLX..." → Shows BUY 98.9% confidence
- "Here's why our AI recommends this..." → Click AI Explanation button
- "The AI explains the reasoning based on sentiment analysis" → Shows professional explanation
Perfect for hacker track competitions with:
- Real ML model implementation
- Multiple API integrations
- Professional presentation
- Live demo capabilities
MIT License - feel free to use for hackathons and projects!