I made most of the parts I need to get this working
YouTube History
YouTube, in their infinite wisdom, does not expose an api endpoint for your watch history w/o using google takeout (which takes forever)
So I make a quick firefox extention to read my watched videos and time watched and then save it to a json file for later
YouTube Video Info
I am using yt_dlp and youtube_transcript_api to take a YT video’s ID and then retrieve the following info:
- title
- description
- duration
- categories
- tags
- was_live
- transcript
Embedding Model
I’ve downloaded and tested the BAAI/bge-small-en-v1.5 text transformer to generate text embeddings for any text I want. The goal is that users have an embedding for things they like, and each video has an embedding based on it’s title, description, category, tags, and the transcript.
To recomend videos I can see how similar a video’s embedding is to the user’s embedding, and then rank them. I can then give them choices based on that ranking.
Watching and liking videos will nudge the user’s embedding towards that video’s embedding, while leaving early or disliking nudges it away.
Database
I’m using a Lightning Memory-Mapped Database (LMDB) w/ 2 tables, one for all the user’s embeddings, and the other for all the video’s embeddings.
I am going to try and use FAISS for the similary search from the user embedding to all the videos
Whats next?
I need to do a few things, mostly just connecting each of these systems.
First of all I need to go through my entire watch history and get the info for them, then embed them, and then store it in my database. Also repeating this process with any other video I can find on YouTube
I also need to connect the system to take my user embedding, and get the most similar videos and then return those.
I would also like to make a custom UI/homepage for my algorithm.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.