Question answering over YouTube videos with embeddings and LLMs.
Project description
YouTube Question Answer
Simple experiment for question answering on YouTube videos using embeddings and the top n YouTube search result transcripts.
The function will take a question and optionally a YouTube search query (otherwise an LLM will auto-generate one), will compile transcripts for each video result, generate an embedding index using the transcripts and then answer the question using the relevant embeddings.
The function will return both a string response and a list of sources that were used for the answer.
Installation
The package can be installed from PyPI with pip install youtube-qa
. Make sure to set your OPENAI_API_KEY
environment variable before using.
Example
from youtube_qa.answer_question import answer_question_using_youtube
response, sources = answer_question_using_youtube(
search_term="peter attia running endurance",
question="how to train for endurance",
)
print(response)
Or to let the LLM auto-generate a relevant search query:
from youtube_qa.answer_question import answer_question_using_youtube
response, sources = answer_question_using_youtube(
question="how to train for endurance",
)
print(response)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for youtube_qa-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4765af80ecb08be28ed0e7ce869bca0aa33e31aece869bb13572e3c8ee8be3ed |
|
MD5 | eb05f870efed9ce048a614b0eda92a28 |
|
BLAKE2b-256 | a3075710f5a342d16c641ac51d9f1d3f9655e96364f2361fffebf313d107fb54 |