.ipynb
.pdf
OpenAIWhisperParser
OpenAIWhisperParser#
This notebook goes over how to load data from an audio file, such as an mp3.
We use the OpenAIWhisperParser, which will use the OpenAI Whisper API to transcribe audio to text.
Note: You will need to have an OPENAI_API_KEY supplied.
from langchain.document_loaders.generic import GenericLoader
from langchain.document_loaders.parsers import OpenAIWhisperParser
# Directory contains audio for the first 20 minutes of one Andrej Karpathy video 
# "The spelled-out intro to neural networks and backpropagation: building micrograd"
# https://www.youtube.com/watch?v=VMj-3S1tku0
audio_file_path = "example_data/"
loader = GenericLoader.from_filesystem(audio_file_path, glob="*.mp3", parser=OpenAIWhisperParser())
docs = loader.load()
docs
rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/document_loaders/examples/audio.html