A GPT-based YouTube bot that leaves lovely comments with summaries of key points from YouTube videos.
demo.mp4
Create the environment:
conda env create -f environment.yaml
conda activate yt-summariser
Set environment variables (replace zshrc
with bash_profile
if that's what you use):
echo "export OPENAI_KEY="imyouropenaikey"" >> ~/.zshrc
echo "export POSTGRES_PASSWORD="imyourpostreskey"" >> ~/.zshrc
source ~/.zshrc
Create the database:
python create_db.py
-
Add
secrets
folder tobot
. This is where Google API authentication will be stored. -
You need to create an account at Google Developers.
-
Go to
Google Cloud
>Console
.- create a new project (top of the page)
-
Go to
API & Services
(left menu) >Enable APIs and Services
> search forYouTube API
.- make sure you are at the right project, then
Enable the API
- go to
Credentials
>Create Credentials
>OAuth client ID
- make sure you are at the right project, then
-
This should prompt you to
Configure consent screen
do it, keep clicking next and fill up the application name (any name). -
Now you can get
OAuth client ID
.make sure to choose Desktop
, otherwise the authentification process is a bit more complicated- download the secrest file, that's your
secrets/client_secret_desktop.json
-
Make sure to enable the bot's (or your own) gmail address as one of users permitted to use the app (you can add up around 100 emails there).
-
The API gives you 10 000 credits a day for free, which should equal to around 100 published comments or so.
I noticed a tendency from YouTube creators to make videos that consists of a few key points ("5 tips on xyz"). My intuition there is that this leads to more engagment from videos as people keep waiting to hear about the next point instead of switching tabs. People then usually comment on these videos where they summarise key points and get a lot of upvotes for it.
I tried to tackle this problem on one of my past university assignments with making slight changes to BertSum architecture. Long-story short - lack of available data on the problem leads to inability to properly fine-tune the model and we had to bias it towards certain keywords. It certainly worked better, but it was far from ideal.
Generative text models (like GPT) don't have these problems. I revisited the problem, and it I must conclude the hype is surely real. Here's a generative text bot take on the task.
Turing test was passed!
I don't want to spam README.md too much, see /imgs
for more examples.