LouiS0616 score 34313
2018/11/08 17:14 投稿
> ```Python |
sttResult = stt.recognize(audio = audio_file, content_type="audio/wav",timestamps = False) |
> ``` |
> ```Python |
speech_recognition_results = speech_to_text.recognize( |
audio=audio_file, |
content_type='audio/flac', |
timestamps=True, |
word_alternatives_threshold=0.9, |
keywords=['colorado', 'tornado', 'tornadoes'], |
keywords_threshold=0.5 |
).get_result() |
> ``` |
サンプルと見比べる限り、おそらくこんな感じでしょう。 |
```Python |
sttResult = stt.recognize(audio = audio_file, content_type="audio/wav",timestamps = False) |
sttResult = sttResult.get_result() |
``` |
``` |
また、コーディングスタイルの面でもサンプルにもうちょっと倣った方が良いかと。 |
- 変数の命名ルールがスネイルケースに一本化されていない |
- キーワード引数の = の前後に空白があったりなかったり、統一されていない |
- 生のopen関数が存在し、しかもリソースが解放されていない |
- その他もろもろ |