This repository hosts a Python-based chatbot YODA that interacts with YouTube videos. The chatbot downloads a specified YouTube video, transcribes its audio content to text using speech recognition, and then uses a pre-trained question-answering model to answer user queries about the video.
The chatbot combines several powerful libraries, including PyTube for downloading YouTube videos, SpeechRecognition for transcribing audio, and Hugging Face's Transformers library for question answering using a BERT-based model. This project aims to provide a simple yet effective way to interact with video content through natural language queries.
- YouTube Video Download: Easily download YouTube videos using the PyTube library.
- Speech-to-Text Transcription: Utilize the SpeechRecognition library to transcribe audio from the video to text.
- Question Answering: Leverage a pre-trained BERT-based question-answering model from Hugging Face's Transformers library.
Make sure you have the following installed:
- Python (>=3.6)
Clone the repository:
git clone https://github.com/your-username/your-repo.git
cd yoda
pip install -r requirements.txt
python Youtube_Chat.py
Follow the prompts to provide a YouTube video URL and ask questions about the video.
The download_video function uses the PyTube library to download the audio stream of a specified YouTube video.
The transcribe_audio function utilizes the SpeechRecognition library to transcribe the downloaded audio to text.
The answer_questions function uses a pre-trained BERT-based question-answering model to answer user queries based on the transcribed text.
Feel free to customize the code or integrate different models based on your preferences. You can explore other speech recognition libraries, download methods, or even experiment with different question-answering models.
Contributions are welcome! Please fork the repository and submit a pull request.