Skip to content

Diptesh2006/NewsTimeWarp

Repository files navigation

Perspect Platform - Real-Time News Analysis

An AI-powered platform for real-time news bias detection and sentiment analysis with live data from multiple sources.

πŸš€ Features

Real-Time News Analysis

  • Live News Fetching from NewsAPI, The Guardian, and NewsData.io
  • AI-Powered Sentiment Analysis with custom word-based detection
  • Intelligent Bias Detection with source-specific classification
  • Smart Filtering showing only meaningful sources and results
  • Real-Time Processing with background tasks

Advanced Analytics

  • Sentiment Distribution across topics and sources
  • Source Bias Comparison with filtered results
  • Keyword Trend Analysis with real-time data
  • Multi-Source Aggregation from 66+ news sources

Technical Stack

  • Frontend: React 18, TypeScript, Tailwind CSS, Vite
  • Backend: FastAPI, Python 3.11+, Custom Sentiment Analysis
  • Data Sources: NewsAPI.org, The Guardian, NewsData.io
  • Real-Time: Async processing, background tasks

🎯 Quick Start

Prerequisites

  • Node.js 18+ and npm
  • Python 3.11+
  • API keys for news sources (optional but recommended)

1. Clone and Setup

git clone <your-repo-url>
cd perspect-platform

2. Frontend Setup

npm install
npm run dev

Frontend will be available at: http://localhost:5173

3. Backend Setup

cd backend
pip install -r requirements.txt
python main_live_news.py

Backend will be available at: http://localhost:8001

4. API Keys (Optional)

For enhanced functionality, add your API keys to backend/.env:

NEWS_API_KEY=your_newsapi_key
NEWSDATA_API_KEY=your_newsdata_key

πŸ“Š Demo Features

Live News Analysis

  • Real-time fetching from multiple news sources
  • Smart sentiment detection with political and tech keywords
  • Source bias classification (Fox News: 69.8, CNN: 30.1, etc.)
  • Filtered results showing only meaningful sources

Interactive Analysis

  • Keyword-based filtering (politics, AI, technology, etc.)
  • Sentiment distribution with real percentages
  • Source comparison with bias scores
  • Trend analysis with live data

Sample Results

  • Politics: 8% negative, 92% neutral sentiment
  • Source Bias: Fox News (69.8), CNN (30.1), The Guardian (35.6)
  • Filtered Sources: 15 most meaningful sources (down from 66)

πŸ”§ Technical Details

Sentiment Analysis

  • Custom word-based analyzer (no external dependencies)
  • Political and tech keywords for better detection
  • Intensifier support (very, extremely, etc.)
  • VADER-like compound scores (-1.0 to +1.0)

Bias Detection

  • Source-specific classification with 20+ categories
  • Sentiment-adjusted bias scoring
  • Randomness for variety in results
  • Conservative/Liberal/Center classification

API Endpoints

  • GET /api/v1/articles - Get live articles
  • GET /api/v1/sentiment-trends - Sentiment analysis
  • GET /api/v1/source-bias-comparison - Bias comparison
  • POST /api/v1/fetch-live-news - Trigger news fetching
  • GET /api/v1/live-news-status - Fetching status

🌟 Key Improvements

Recent Updates

  • βœ… Real-time news fetching with live sentiment analysis
  • βœ… Intelligent filtering showing only meaningful sources
  • βœ… Enhanced bias detection with source classification
  • βœ… Improved sentiment analysis with political keywords
  • βœ… Background processing for better performance
  • βœ… Smart result filtering (15 sources vs 66)

Performance

  • Async processing for news fetching
  • Background tasks for non-blocking operations
  • Smart caching of processed results
  • Efficient filtering for meaningful data

πŸ“ Project Structure

perspect-platform/
β”œβ”€β”€ src/                    # React frontend
β”‚   β”œβ”€β”€ components/         # UI components
β”‚   └── services/          # API services
β”œβ”€β”€ backend/               # FastAPI backend
β”‚   β”œβ”€β”€ main_live_news.py  # Main API server
β”‚   β”œβ”€β”€ scripts/           # Utility scripts
β”‚   └── services/          # Business logic
β”œβ”€β”€ package.json           # Frontend dependencies
└── requirements.txt       # Backend dependencies

πŸš€ Deployment

Local Development

# Terminal 1 - Frontend
npm run dev

# Terminal 2 - Backend
cd backend && python main_live_news.py

Production

  • Frontend: Build with npm run build
  • Backend: Deploy with Docker or direct Python
  • Environment: Set API keys in production

πŸ“ˆ Future Enhancements

  • Machine learning models for better sentiment analysis
  • Historical trend analysis
  • User authentication and saved searches
  • Mobile app development
  • Advanced visualization dashboards

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

πŸ“„ License

This project is licensed under the MIT License.


Perspect Platform - Making news analysis intelligent and accessible.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors