Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve YouTube transcripts #172

Open
ccstan99 opened this issue Aug 30, 2023 · 1 comment
Open

Improve YouTube transcripts #172

ccstan99 opened this issue Aug 30, 2023 · 1 comment

Comments

@ccstan99
Copy link
Collaborator

We are currently using transcripts directly from YouTube. Many are low quality, without proper capitalization & punctuation and odd formatting. There are Otter transcripts at https://drive.google.com/drive/u/0/folders/12FFjcP_60rq3qgq_Wl7HDWIjEA7p_3T_ for many of the YouTube videos from the previous ARD but we'll need to reconcile the transcripts with the associated URL.

For new videos, we may want to consider integrating Whisper transcripts into the workflow, i.e. https://huggingface.co/spaces/SteveDigital/free-fast-youtube-url-video-to-text-using-openai-whisper

@ccstan99
Copy link
Collaborator Author

ccstan99 commented Sep 9, 2023

Maybe we can use LangChain document loaders in conjuction with their whisper parser?
https://python.langchain.com/docs/integrations/document_loaders/youtube_audio

# ! pip install yt_dlp
# ! pip install pydub

from langchain.document_loaders.generic import GenericLoader
from langchain.document_loaders.parsers import OpenAIWhisperParser
from langchain.document_loaders.blob_loaders.youtube_audio import YoutubeAudioLoader

url="https://www.youtube.com/watch?v=jGwO_UgTS7I"
save_dir="docs/youtube/"
loader = GenericLoader(
    YoutubeAudioLoader([url],save_dir),
    OpenAIWhisperParser()
)
docs = loader.load()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant