This repository contains a Python application that allows you to ask questions about a YouTube video and receive concise answers based on the video's content. The application uses the Langchain library for text processing, Hugging Face for embeddings, and OpenAI for question answering.
- Installation
- Environment Setup
- Running the Application
- Usage
- Acknowledgements
To install the required dependencies, run the following command in your terminal:
pip install -r requirements.txt- Create a
.envfile in the root directory of the project and add the following environment variables:
HUGGINGFACEHUB_API_TOKEN=your_huggingface_api_token
OPENAI_API_KEY=your_openai_api_key
Replace your_huggingface_api_token and your_openai_api_key with your actual API keys.
- Load the environment variables in your Python script:
import os
load_dotenv()Run the following command in your terminal to run the application:
python app.py- Enter a YouTube video URL in the provided textbox.
- Click the "Submit URL" button to process the video and make it available for questions.
- Once the video is processed, you can ask questions about the video in the chat interface.
- Click the "Ask Question" button to receive an answer based on the video's content.
- You can clear the chat history by clicking the "Clear Chat" button.
This project uses the following libraries:
