Skip to content

YouTube Transcript Chat App is a Streamlit-based tool that lets you ask questions about any YouTube video with English captions. It fetches the transcript, finds relevant content using embeddings + FAISS, and answers your questions using the Perplexity LLM.

Notifications You must be signed in to change notification settings

TahaCoder563/Youtube-Transcript-Chat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ₯ YouTube Transcript Chat App

A Streamlit-based web application that lets users ask questions about the content of a YouTube video using its English transcript. It extracts the transcript, breaks it into chunks, embeds it using HuggingFace models, and answers questions via the Perplexity LLM.

πŸš€ Features

  • πŸ”— Enter any YouTube video URL with English captions
  • πŸ€– Ask natural language questions about the video
  • 🧠 Powered by Perplexity LLM & HuggingFace sentence embeddings
  • πŸ“š Context-aware QA using FAISS vector store
  • 🎨 Clean UI with custom background and styled answer box

The core Streamlit app that:

  • Accepts a YouTube URL and user question
  • Fetches and processes transcript using youtube-transcript-api
  • Splits transcript into chunks with RecursiveCharacterTextSplitter
  • Generates embeddings using sentence-transformers/all-MiniLM-L6-v2
  • Stores vectors in FAISS and retrieves top k similar chunks
  • Feeds context and question into a prompt chain using Perplexity
  • Displays the generated answer in a styled output box

πŸ› οΈ Technologies Used

  • Python
  • Streamlit
  • LangChain
  • HuggingFace Sentence Transformers
  • Perplexity Chat API
  • FAISS
  • YouTube Transcript API

πŸ“¦ Installation

  1. Clone the repository

    git clone https://github.com/TahaCoder563/Youtube-Transcript-Chat.git
    cd Youtube-Transcript-Chat
  2. Install dependencies

    pip install -r requirements.txt
  3. Set up API keys

    πŸ”‘ Get a Perplexity API Key:

    πŸ”‘ Get a HuggingFace API Token:

    Create a .env file in the root of the project and paste your keys:

    PERPLEXITY_API_KEY="your_perplexity_api_key_here"
    HUGGINGFACEHUB_API_TOKEN="your_huggingface_token_here"

    Replace the your_perplexity_api_key_here and your_huggingface_token_here with the respective api keys.

  4. Run the app

    streamlit run main.py

About

YouTube Transcript Chat App is a Streamlit-based tool that lets you ask questions about any YouTube video with English captions. It fetches the transcript, finds relevant content using embeddings + FAISS, and answers your questions using the Perplexity LLM.

Topics

Resources

Stars

Watchers

Forks

Languages