An AI-powered platform for real-time news bias detection and sentiment analysis with live data from multiple sources.
- 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
- 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
- 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
- Node.js 18+ and npm
- Python 3.11+
- API keys for news sources (optional but recommended)
git clone <your-repo-url>
cd perspect-platformnpm install
npm run devFrontend will be available at: http://localhost:5173
cd backend
pip install -r requirements.txt
python main_live_news.pyBackend will be available at: http://localhost:8001
For enhanced functionality, add your API keys to backend/.env:
NEWS_API_KEY=your_newsapi_key
NEWSDATA_API_KEY=your_newsdata_key- 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
- Keyword-based filtering (politics, AI, technology, etc.)
- Sentiment distribution with real percentages
- Source comparison with bias scores
- Trend analysis with live data
- 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)
- 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)
- Source-specific classification with 20+ categories
- Sentiment-adjusted bias scoring
- Randomness for variety in results
- Conservative/Liberal/Center classification
GET /api/v1/articles- Get live articlesGET /api/v1/sentiment-trends- Sentiment analysisGET /api/v1/source-bias-comparison- Bias comparisonPOST /api/v1/fetch-live-news- Trigger news fetchingGET /api/v1/live-news-status- Fetching status
- β 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)
- Async processing for news fetching
- Background tasks for non-blocking operations
- Smart caching of processed results
- Efficient filtering for meaningful data
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
# Terminal 1 - Frontend
npm run dev
# Terminal 2 - Backend
cd backend && python main_live_news.py- Frontend: Build with
npm run build - Backend: Deploy with Docker or direct Python
- Environment: Set API keys in production
- Machine learning models for better sentiment analysis
- Historical trend analysis
- User authentication and saved searches
- Mobile app development
- Advanced visualization dashboards
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.
Perspect Platform - Making news analysis intelligent and accessible.