A powerful news analysis tool that extracts, analyzes, and compares news articles from different media outlets. The application provides sentiment analysis, political bias detection, and topic clustering to help users understand media coverage from different perspectives.
- Article Extraction: Automatically extracts content from news URLs using Goose3 with fallback mechanisms
- Sentiment Analysis: Analyzes the emotional tone of articles using TextBlob
- Bias Detection: Detects political bias using Google's Gemini AI
- Topic Clustering: Groups similar articles by topic using KMeans clustering
- Comparison Tool: Side-by-side comparison of articles on similar topics from different sources
- Interactive Dashboard: Visualizes sentiment distribution and bias breakdown
- Frontend: Streamlit for the web interface
- NLP: TextBlob for sentiment analysis, NLTK for text processing
- AI: Google Gemini for bias detection and theme generation
- Data Storage: SQLAlchemy with SQLite database
- Data Visualization: Plotly for interactive charts
- Web Scraping: Goose3 and BeautifulSoup for content extraction
- Clone the repository
- Install dependencies:
pip install -r requirements.txt - Create a
.envfile in the project root with your Gemini API key:GEMINI_API_KEY=your_api_key_here
- Start the application:
streamlit run app.py - Open your browser and navigate to the provided URL (typically http://localhost:8501)
- Paste a news article URL in the sidebar input field
- Explore the dashboard, topic clusters, and bias comparison tabs
├── app.py # Main Streamlit application
├── database.py # Database models and operations
├── requirements.txt # Project dependencies
├── .env # Environment variables (API keys)
├── news_dashboard.db # SQLite database
├── assets/
│ └── styles.css # Custom CSS styles
└── utils/
├── analyzer.py # Sentiment and bias analysis
├── cluster.py # Topic clustering functionality
├── comparison.py # Article comparison tools
└── loader.py # URL content extraction
- Python 3.8+
- Streamlit 1.33.0+
- Google Gemini API key
- Add support for more languages
- Implement user accounts and saved article collections
- Enhance bias detection with more nuanced categories
- Add historical tracking of media coverage over time
- Implement source credibility scoring
MIT