A powerful news analytics platform that fetches, analyzes, and visualizes news articles in real-time using sentiment analysis and topic modeling.
- Real-time News Fetching: Retrieve latest news articles from various sources using NewsAPI
- Sentiment Analysis: Analyze the emotional tone of news articles (Positive, Neutral, Negative)
- Topic Modeling: Automatically categorize articles into relevant topics
- Interactive Visualizations:
- Sentiment distribution charts
- Topic distribution pie charts
- Sentiment trends over time
- Topic-specific word clouds
- Customizable Filters: Filter articles by sentiment, source, and topic
- Auto-update: Configurable automatic refresh of news data
-
Set your NewsAPI key as an environment variable:
export NEWS_API_KEY="your_api_key_here"
-
Install required packages:
pip install matplotlib nltk pandas plotly scikit-learn streamlit trafilatura wordcloud
-
Run the application:
streamlit run app.py
- Frontend: Streamlit
- Data Processing: Pandas, NumPy
- Natural Language Processing: NLTK, Scikit-learn
- Visualization: Plotly, Matplotlib, WordCloud
- News Data: NewsAPI
app.py: Main application and UI logicnews_fetcher.py: Handles news article retrievalsentiment_analyzer.py: Performs sentiment analysistopic_modeler.py: Implements topic modelingdata_visualizer.py: Creates interactive visualizationsutils.py: Utility functions for data processing
- Customize search parameters in the sidebar
- Adjust update frequency (15-120 minutes)
- Filter results by sentiment, source, and topic
- Configure auto-update functionality
- Sentiment Distribution: Bar chart showing positive, neutral, and negative article counts
- Sentiment Trends: Line chart tracking sentiment changes over time
- Topic Distribution: Pie chart displaying article distribution across topics
- Word Clouds: Visual representation of key terms in each topic