首页 > 解决方案 > Google Speech to Text API 很慢

问题描述

我在这里使用“使用 Google 云存储文件转录长音频文件”的指南。

但是使用“enable_automatic_punctuation”的“增强视频”模型时速度很慢。每 10 分钟的音频持续时间大约需要 2.5 分钟。

这是我的配置:

config = speech.RecognitionConfig(
  encoding=speech.RecognitionConfig.AudioEncoding.FLAC,
  audio_channel_count=2,
  language_code="en-US",
  use_enhanced=True,  # Use enhanced model.
  model='video',  # Enhanced model for videos
  enable_word_time_offsets=True,  # Add the word video times (seconds)
  enable_automatic_punctuation=True  # Add punctuation to the transcript.
)
operation = client.long_running_recognize(config=config, audio=audio)

有什么方法可以让我们得到更快的响应。对于 10 分钟持续时间的音频文件,语音识别模型 + NLP 标点符号模型真的需要这么长时间吗? 2 分钟?

标签: google-apigoogle-api-python-clientgoogle-speech-apigoogle-speech-to-text-api

解决方案


推荐阅读