###前提・実現したいこと
WatsonのCloud Platform 「Blue Mix」上で提供されているSpeechToText APIを使用しています。
その中で、custom language modelを使用すると以下の認証エラーが起こります
###発生している問題・エラーメッセージ
watson_developer_cloud.watson_developer_cloud_service.WatsonException: Unauthorized: Access is denied due to invalid credentials
###該当のソースコード
import json<
1 from os.path import join, dirname<
2 from watson_developer_cloud import SpeechToTextV1<
3 <
4 speech_to_text = SpeechToTextV1(<
~ 5 username='<username>',<
~ 6 password='<password>',<
7 x_watson_learning_opt_out=False<
8 )<
9 <
10 print(json.dumps(speech_to_text.models(), indent=2))<
11 <
~ 12 print(json.dumps(speech_to_text.get_model('en-UK_BroadbandModel'), indent=2)) <
13 <
~ 14 with open(join(dirname(file), '../commentary_resourses/output.flac'),<
15 'rb') as audio_file:<
16 print(json.dumps(speech_to_text.recognize(<
~ 17 audio_file,-<
- 18 content_type='audio/flac',<
- 19 customization_id='<customization_id>',-<
- 20 timestamps=True,-<
- 21 #audio_file, content_type='audio/flac', timestamps=True,-<
22 word_confidence=True),<
23 indent=2))<
###試したこと
上記のソースコードにて、自分でカスタムしたモデルの使用を試みて、customization_idを指定した場合のみエラーが起こります(customization_idを指定しなければ正常に処理がなされます)
何が問題なのか少しネットで調べてみましたが、同様の事例はなく、検討もつかない状態です。
お詳しい方、アドバイスお願い致します。
あなたの回答
tips
プレビュー