In today's fast-paced world, it's essential to stay updated with the latest news and information. However, going through multiple news articles can be time-consuming. To help you save time and get a quick overview of the important points, I developed a News Articles Summarizer application using ChatGPT and LangChain.
The Summarizer also provides summaries in different languages, French being an exemplary case. This showcases the potential of the tool to cater to a diverse, global audience.
Before you start, obtain your OpenAI API
key from the OpenAI website. You need to have an account and be granted access to the API. After logging in, navigate to the API keys section and copy your API key.
You can either run this application locally or in Google Colab (head straight to the notebook). To run it locally, follow these steps:
-
Clone the repository:
git clone https://github.com/WHITELOTUS0/ai-news-article-summarizer.git
-
Create a new environment and activate the virtual environment:
python -m venv venv
-
Install the required dependencies:
pip install -r requirements.txt
-
Set your
OPENAI_API_KEY
as an environment variable. You can do this by creating a.env
file in the root directory of the project and adding the following line:OPENAI_API_KEY=your_openai_api_key
-
Follow the instructions in the notebook to install additional packages:
pip install -qU langchain-openai pip install -qU langchain-community pip install -q newspaper3k python-dotenv pip install -q lxml_html_clean
-
Run the notebook to start summarizing news articles.