This repository contains a NEWS summarizer for BBC.com using OpenAI GPT-3.5 with the OpenAI API key. The code takes the latest articles from BBC.com and provides a concise summary of each article using the power of GPT-3.5 language model.
Before running the code, make sure you have the following installed:
- Python (version 3.6 or higher)
- pip (Python package manager)
- Clone this repository to your local machine:
git clone https://github.com/your_username/BBC-Summarizer.git
cd bbc_news_summarizer
- Install the required dependencies using pip:
pip install -r requirements.txt
To use the OpenAI GPT-3.5 language model, you need an API key from OpenAI. Follow these steps to set up your API key:
- Sign up or log in to your OpenAI account at https://platform.openai.com/.
- Generate an API key from your dashboard.
- Replace the
openai_api_key
variable inrun.py
with your actual API key:
# Set your OpenAI API key here
openai_api_key = "YOUR_API_KEY"
To use the NEWS summarizer, follow these steps:
- Make sure you have set up the API key as explained above.
- Open the
run.py
file and find thesummarized
parameter. By default, it is set toFalse
, which means it will provide a summary directly from BBC.com. To use GPT-3.5 for summarization, setsummarized = True
.
# Set summarized to True for GPT-3.5 summarization
summarizer.get_articles(
openai_api_key=openai_api_key, hours=5, body=False, summarized=True
)
- Run the script:
python run.py
The summarizer will fetch the latest articles from BBC.com and either provide summaries using GPT-3.5 or display the original article based on the value of the summarized
parameter.
This project is licensed under the MIT License. Feel free to use, modify, and distribute the code as per the terms of the license.
Please be aware that using the OpenAI API may incur costs, depending on your usage and subscription plan. Make sure to check the OpenAI website for the latest pricing information.
Please also note that this summarizer is designed for educational and personal use only. Respect the terms of service of BBC.com and OpenAI when using this tool.
Happy summarizing!