翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。
を使用してカスタムの Amazon Transcribe ボキャブラリーを入手してくださいAWSSDK
これらは Amazon Transcribe のカスタムボキャブラリーを取得する方法です。
アクション例は、より大きなプログラムからのコードの抜粋であり、コンテキスト内で実行する必要があります。次のコード例で、このアクションのコンテキストを確認できます。
- .NET
-
- AWS SDK for .NET
-
/// <summary>
/// Get information about a custom vocabulary.
/// </summary>
/// <param name="vocabularyName">Name of the vocabulary.</param>
/// <returns>The state of the custom vocabulary.</returns>
public async Task<VocabularyState> GetCustomVocabulary(string vocabularyName)
{
var response = await _amazonTranscribeService.GetVocabularyAsync(
new GetVocabularyRequest()
{
VocabularyName = vocabularyName
});
return response.VocabularyState;
}
- Python
-
- SDK for Python (Boto3)
-
def get_vocabulary(vocabulary_name, transcribe_client):
"""
Gets information about a custom vocabulary.
:param vocabulary_name: The name of the vocabulary to retrieve.
:param transcribe_client: The Boto3 Transcribe client.
:return: Information about the vocabulary.
"""
try:
response = transcribe_client.get_vocabulary(VocabularyName=vocabulary_name)
logger.info("Got vocabulary %s.", response['VocabularyName'])
except ClientError:
logger.exception("Couldn't get vocabulary %s.", vocabulary_name)
raise
else:
return response
AWS SDK デベロッパーガイドとコード例の詳細なリストについては、「このサービスを AWS SDK で使用する」を参照してください。このトピックには、使用開始方法に関する情報と、以前の SDK バージョンの詳細も含まれています。