Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📰 NewsAI - News Analysis Dashboard

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.

Features

  • 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

Technologies Used

  • 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

Installation

  1. Clone the repository
  2. Install dependencies:
    pip install -r requirements.txt
    
  3. Create a .env file in the project root with your Gemini API key:
    GEMINI_API_KEY=your_api_key_here
    

Usage

  1. Start the application:
    streamlit run app.py
    
  2. Open your browser and navigate to the provided URL (typically http://localhost:8501)
  3. Paste a news article URL in the sidebar input field
  4. Explore the dashboard, topic clusters, and bias comparison tabs

Project Structure

├── 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

Requirements

  • Python 3.8+
  • Streamlit 1.33.0+
  • Google Gemini API key

Future Improvements

  • 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

License

MIT

About

NewsAnalyzerAI Advanced news monitoring tool that extracts articles, detects bias/sentiment, and compares coverage across sources. Features: Automated content extraction from news URLs Political bias and sentiment analysis Side-by-side article comparison Topic clustering and trend detection

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages