Get your free Trial API key from https://cohere.com/ and put it in the file summarizer.py. This trial key is rate limited at 100 calls / minute as per their Official FAQs.
This repository contains a Python Flask web application for fetching and summarizing news articles from RSS feeds.
Table of Contents:
-
RSS Feed Parsing: It fetches news articles from RSS feeds using the
feedparserlibrary. -
Article Content Extraction: It extracts the full content of each article from the web pages using the
requestslibrary. -
Text Summarization: It summarizes the extracted article content using the Cohere API.
-
Database Storage: It stores the article details, including the title, author, publication date, link, full content, and summarized content, in a SQLite database.
-
Web Interface: It offers a web interface using Flask, allowing users to view and interact with the collected news articles. It offers Light and Dark Themes and Custom Themes.
To run this application locally, follow these steps:
Clone this repository to your local machine or download the zip file and extract it to your preferred location.
git clone https://github.com/Quantlight/AI-Powered-News-SummarizerInstall the required Python libraries by running:
pip install -r requirements.txtCreate .env file in root directory of your project folder and add this
API-KEY=YOUR-API-KEY
Obtain a Cohere API key and replace "YOUR-API-KEY" in the code with your actual API key.
Prepare an OPML file (e.g., "news_links.opml") with the RSS feed URLs you want to fetch articles from. Run the Flask application:
python summarizer.pyThe application should now be accessible locally in your web browser.
Start the application as described in the "Getting Started" section.
Access the web interface by navigating to http://localhost:5000/ or http://127.0.0.1:5000 in your web browser.
The application will fetch articles from the RSS feeds specified in the "news_links.opml" file and display them on the web page.
Enjoy your News Summaries.
The project uses the following Python libraries and APIs:
-
feedparserfor parsing RSS feeds. -
requestsfor making HTTP requests to fetch article content. -
coherefor text summarization. -
sqlite3for database management. -
beautifulsoup4for parsing HTML content. -
markdown2for rendering Markdown content. -
Flaskfor the web application.
Make sure to install these dependencies as mentioned in the "Getting Started" section.
If you'd like to contribute to this project, please fork the repository and create a pull request. We welcome improvements, bug fixes, and feature additions.
This project is licensed under the MIT License. See the LICENSE file for more details.



