Please find my Streamlit app hosted here
Please note that if you face an error, the Open AI API credits on my account might have expired :D
The goal of this model is to provide a summary of comment threads for any given Youtube video.
- In this project, I will be using Youtube API V3 to fetch all comment threads for any given youtube video id.
- I used Streamlit to build this application. It takes a Youtube video url as input. Using the Youtube API, I fetch all the comment threads under that video and provide it to the Tokenizer to break the text into chunks.
- Then I provide each chunk as an input to the Completions API with the prompt - “Provide a summary of the comments below.” followed by the chunk of comments. The model then returns a brief summary of how people are reacting to that video.
-
Create a virtual environment (python3 -m venv venv && source venv/bin/activate)
-
Download all the dependencies by running
make requirements
in your terminal -
Create a project on Google cloud console and enable Youtube API V3 for your project. Follow instructions here.
-
Create a .streamlit folder at the source level and add a secrets.toml file to it.
-
Ensure your Youtube API keys are set as
API_SERVICE_NAME
,API_VERSION
,YOUTUBE_API_KEY
in the secrets.toml file (check the secrets.toml.example file for reference). Please find the details to generate the API key here. -
Ensure your OpenAI API key is set as an environment variable
OPENAI_API_KEY
in the secrets.toml file (check the secrets.toml.example file for reference). (see best practices around API key safety here) -
Run the streamlit app by running
make run
-
Open the app in your browser at
http://localhost:8501