Giter Club home page Giter Club logo

ttyt's Introduction

Talk to Youtube!

demo_video.mp4

Overview

TtYT (Talk to YouTube) is an (almost) instant Retrieval Augmented Generation (RAG) based Question-Answering system for YouTube videos that you can run locally. It uses Youtube-DL to get the transcript (or captions) for a video, and then uses Vectara to set up the Retrieval and Generation Systems on top of it.

You then ask it questions and it generates answers with actual references to (with timestamps) of what the answer is based on from within video's content. The UI is a hacky terminal right now, but you can extend it to take audio as input or produce audio as output.

Usage

1. Get the code and requirements

Clone the repo, install the requirements in requirements.txt:

python -m venv ./ttyt_venv/
source ./ttyt_venv2/bin/activate
pip install -r requirements.txt

2. Create a Vectara account

Sign up for a Vectara account. The free tier should be enough for even the larger videos you want to talk to. Once you're logged in, create a corpus (you can name it anything) and note the Corpus ID (you'll need it for step 3).

Also note your customer ID:

And create an API Key from the "API Access" tab in the menu that we will use to index the data and query it (make sure you give it both query and indexing access):

3. Talk to Youtube!

In the terminal you are using to run the program, define the following variables that will be used by the program:

export CUSTOMER_ID=YOUR_CUSTOMER_ID
export CORPUS_ID=YOUR_CORPUS_ID
export API_KEY=YOUR_API_KEY

Then simply start the program with:

python talk_to_youtube.py --video-url=https://www.youtube.com/watch?v=ZNVuIU6UUiM

Note that the program works well for videos with manual subtitles. For some reason for videos with auto-generated captions YoutubeDL puts all the downloaded captions under one timestamp which can cause issues.

IMPORTANT NOTE: If you want to talk to another video, its best to clear the data in the existing corpus from the web console avoid data overlap between multiple videos. This will be a flag when running the program in the future (when I switch to using JWT tokens instead of API Keys) so it will automatically create a new corpus if desired. Also if you create a new corpus make sure your API key has access to it!

Bugs? Feature Requests?

Please report any bugs, and feel free to submit Pull Requests for any features or improvements you want to see! Maybe you want to have the output be an AI generated voice instead of text? Maybe you want a snazzy new UI! Build it and add it to the repo!

ttyt's People

Contributors

sulemankazi avatar

Stargazers

 avatar Nikolay Astakhayev avatar Suleman avatar Pavel Buchnev avatar Alexander Maslyakov avatar little_endian avatar Andrei avatar  avatar Имя Фамилия avatar Alikhan Kelden avatar m1nus avatar Dmitry Kulikov avatar stvn shpd avatar Hai The Dude avatar  avatar アキラ avatar Askar Yusupov avatar Shankar Ambady avatar Agusti avatar  avatar Anthony Umfer avatar Brian J King avatar Paul Mullins avatar  avatar mjtechguy avatar  avatar  avatar  avatar Valentin avatar Erfan Gholizadeh avatar Aset Akhmetov avatar Noskill avatar  avatar Guillaume Gelin avatar  avatar David Gidwani avatar Clayton Kehoe avatar Amr Awadallah avatar Ennis W. avatar  avatar

Watchers

 avatar

Forkers

trancethehuman

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.