langchain_community.document_loaders.google_speech_to_text
.GoogleSpeechToTextLoader¶
- class langchain_community.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]¶
[Deprecated] 用于Google Cloud Speech-to-Text音频转录的加载程序。
它使用Google Cloud Speech-to-Text API来转录音频文件,并根据指定的格式将转录文本加载到一个或多个文档中。
要使用,应该已安装``google-cloud-speech`` python包。
可以通过Google Cloud Storage uri或本地文件路径指定音频文件。
有关Google Cloud Speech-to-Text的详细说明,请参阅产品文档。 https://cloud.google.com/speech-to-text
Notes
Deprecated since version 0.0.32.
初始化GoogleSpeechToTextLoader。
- 参数:
project_id: Google Cloud 项目ID。 file_path: Google Cloud存储URI或本地文件路径。 location: 语音转文本识别器位置。 recognizer_id: 语音转文本识别器ID。 config: 识别选项和特性。
- config_mask: 在此识别请求期间覆盖识别器的``default_recognition_config``中的值的config中字段列表。
Methods
__init__
(project_id, file_path[, location, ...])初始化GoogleSpeechToTextLoader。
一个用于文档的惰性加载器。
aload
()将数据加载到文档对象中。
一个用于文档的惰性加载器。
load
()将音频文件转录并加载转录内容到文档中。
load_and_split
([text_splitter])加载文档并分割成块。块作为文档返回。
- Parameters
project_id (str) –
file_path (str) –
location (str) –
recognizer_id (str) –
config (Optional[RecognitionConfig]) –
config_mask (Optional[FieldMask]) –
- __init__(project_id: str, file_path: str, location: str = 'us-central1', recognizer_id: str = '_', config: Optional[RecognitionConfig] = None, config_mask: Optional[FieldMask] = None)[source]¶
初始化GoogleSpeechToTextLoader。
- 参数:
project_id: Google Cloud 项目ID。 file_path: Google Cloud存储URI或本地文件路径。 location: 语音转文本识别器位置。 recognizer_id: 语音转文本识别器ID。 config: 识别选项和特性。
- config_mask: 在此识别请求期间覆盖识别器的``default_recognition_config``中的值的config中字段列表。
- Parameters
project_id (str) –
file_path (str) –
location (str) –
recognizer_id (str) –
config (Optional[RecognitionConfig]) –
config_mask (Optional[FieldMask]) –
- load() List[Document] [source]¶
将音频文件转录并加载转录内容到文档中。
使用Google Cloud语音转文本API来转录音频文件,并阻塞直到转录完成。
- Return type
List[Document]
- load_and_split(text_splitter: Optional[TextSplitter] = None) List[Document] ¶
加载文档并分割成块。块作为文档返回。
不要覆盖此方法。应该被视为已弃用!
- 参数:
- text_splitter: 用于分割文档的TextSplitter实例。
默认为RecursiveCharacterTextSplitter。
- 返回:
文档列表。
- Parameters
text_splitter (Optional[TextSplitter]) –
- Return type
List[Document]