This application allows you to generate a news article from a YouTube video's audio transcript. It uses OpenAI's Whisper ASR model to transcribe the audio and OpenAI's text-davinci-003 model to generate the news article based on a given prompt.
-
Clone the repository:
git clone https://github.com/cyberpods/Youtube2NewsArticle.git
-
Install the required Python packages. You can use
pip
to install the dependencies listed in therequirements.txt
file:pip install -r requirements.txt
-
Set up your OpenAI API key. Sign up on the OpenAI website and obtain an API key. Set the
OPENAI_API_KEY
environment variable on your machine to the API key value.
-
Run the application:
streamlit run youtube_to_news.py
-
Access the application in your web browser at
http://localhost:8501
. -
Input the URL of the YouTube video in the provided text field.
-
Optionally, check the "Create TTS Audio" checkbox to generate text-to-speech audio for the generated news article.
-
Optionally, check the "Edit Prompt" checkbox to modify the default prompt for generating the news article. Enter your desired prompt in the text area.
-
Click the "Start" button to begin the process.
-
The application will download and process the audio from the YouTube video. It will then generate the transcript and the news article based on the prompt and transcript.
-
The generated news article will be displayed on the application's interface. If you checked the "Create TTS Audio" checkbox, the text-to-speech audio will also be available for playback.
-
The transcript, article, and audio files will be saved in a ZIP file, which can be downloaded by clicking the "Download ZIP" button.
This application uses the OpenAI API to transcribe the audio and generate the news article. To use the application, you need to sign up on the OpenAI website and obtain an API key. Set the OPENAI_API_KEY
environment variable on your machine to the API key value before running the application.
Make sure you review the OpenAI API documentation for usage limits and pricing details.
Sceenshot https://github.com/cyberpods/Youtube2NewsArticle/blob/main/screenshot.png
This project is licensed under the MIT License.