langchain.document_loaders.google_speech_to_text.GoogleSpeechToTextLoader

class langchain.document_loaders.google_speech_to_text.GoogleSpeechToTextLoader(project_id: str, file_path: str, location: str = 'us-central1', recognizer_id: str = '_', config: Optional[RecognitionConfig] = None, config_mask: Optional[FieldMask] = None)[source]

Loader for Google Cloud Speech-to-Text audio transcripts.

It uses the Google Cloud Speech-to-Text API to transcribe audio files and loads the transcribed text into one or more Documents, depending on the specified format.

To use, you should have the google-cloud-speech python package installed.

Audio files can be specified via a Google Cloud Storage uri or a local file path.

For a detailed explanation of Google Cloud Speech-to-Text, refer to the product documentation. https://cloud.google.com/speech-to-text

Initializes the GoogleSpeechToTextLoader.

Parameters

Methods

__init__(project_id, file_path[, location, ...])

Initializes the GoogleSpeechToTextLoader.

lazy_load()

A lazy loader for Documents.

load()

Transcribes the audio file and loads the transcript into documents.

load_and_split([text_splitter])

Load Documents and split into chunks.

__init__(project_id: str, file_path: str, location: str = 'us-central1', recognizer_id: str = '_', config: Optional[RecognitionConfig] = None, config_mask: Optional[FieldMask] = None)[source]

Initializes the GoogleSpeechToTextLoader.

Parameters
lazy_load() Iterator[Document]

A lazy loader for Documents.

load() List[Document][source]

Transcribes the audio file and loads the transcript into documents.

It uses the Google Cloud Speech-to-Text API to transcribe the audio file and blocks until the transcription is finished.

load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document]

Load Documents and split into chunks. Chunks are returned as Documents.

Parameters

text_splitter – TextSplitter instance to use for splitting documents. Defaults to RecursiveCharacterTextSplitter.

Returns

List of Documents.

Examples using GoogleSpeechToTextLoader