This project is a web-based dashboard that provides comprehensive stock analysis by combining financial data, news sentiment, and sector comparisons. It uses natural language processing and machine learning techniques to analyze recent news articles and generate insights about a given stock.
giphy.mp4
- Stock Information Retrieval: Accepts both stock tickers and common company names as input
- Price Visualization: Displays a 1-year historical price chart and current closing price
- Fundamental Data Display: Shows key financial metrics (e.g., market cap, P/E ratio, dividend yield)
- News Sentiment Analysis: Analyzes sentiment of recent headlines using a fine-tuned FinBERT model
- AI-Generated Summary: Provides a concise summary of recent news and overall sentiment using BART
- Sector Analysis: Compares the stock's sentiment to the sector average
- User-Friendly Interface: Built with Streamlit for an interactive web application
-
Clone the repository:
git clone https://github.com/m-turnergane/stock-sentiment-dashboard.git cd stock-sentiment-dashboard
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the required packages:
pip install -r requirements.txt
-
Set up environment variables: Create a
.env
file in the project root and add your NewsAPI key:NEWS_API_KEY=your_api_key_here
-
Run the Streamlit app:
streamlit run news_sentiment.py
-
Open your web browser and navigate to the URL provided by Streamlit (usually http://localhost:8501)
-
Enter a stock ticker or company name and click "Analyze" to view the dashboard
stock-sentiment-dashboard/ │ ├── venv/ ├── .env ├── .gitignore ├── news_sentiment.py ├── requirements.txt └── README.md
- streamlit
- yfinance
- plotly
- pandas
- numpy
- requests
- transformers
- python-dotenv
Contributions to improve the dashboard are welcome. Please feel free to submit a Pull Request.
- NewsAPI for providing access to news articles
- yfinance for stock market data
- Hugging Face for access to open-source pre-trained NLP models
- Implement user authentication for personalized experiences
- Add historical sentiment trends over time
- Integrate more data sources for a more comprehensive analysis
- Optimize performance for faster analysis of multiple stocks
- Add export functionality for reports
If you encounter any issues, please check the following:
- Ensure all dependencies are correctly installed
- Verify that your NewsAPI key is valid and correctly set in the .env file
- Check your internet connection, as the app requires access to external APIs
For any persistent problems, please open an issue on the GitHub repository.