AWSSDK を使用して Amazon Transcribe カスタムボキャブラリーを一覧表示する - AWSSDK コードサンプル

AWSDocAWS SDKGitHub サンプルリポジトリには、さらに多くの SDK サンプルがあります

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

AWSSDK を使用して Amazon Transcribe カスタムボキャブラリーを一覧表示する

次のコード例は、Amazon Transcribe ボキャブラリーのリスト方法を示します。

.NET
AWS SDK for .NET
注記

他にもありますGitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。

/// <summary> /// List custom vocabularies for the current account. Optionally specify a name /// filter and a specific state to filter the vocabularies list. /// </summary> /// <param name="nameContains">Optional string the vocabulary name must contain.</param> /// <param name="stateEquals">Optional state of the vocabulary.</param> /// <returns>List of information about the vocabularies.</returns> public async Task<List<VocabularyInfo>> ListCustomVocabularies(string? nameContains = null, VocabularyState? stateEquals = null) { var response = await _amazonTranscribeService.ListVocabulariesAsync( new ListVocabulariesRequest() { NameContains = nameContains, StateEquals = stateEquals }); return response.Vocabularies; }
  • API の詳細については、AWS SDK for .NETAPI ListVocabulariesリファレンスのを参照してください

Python
SDK for Python (Boto3)
注記

他にもありますGitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。

def list_vocabularies(vocabulary_filter, transcribe_client): """ Lists the custom vocabularies created for this AWS account. :param vocabulary_filter: The returned vocabularies must contain this string in their names. :param transcribe_client: The Boto3 Transcribe client. :return: The list of retrieved vocabularies. """ try: response = transcribe_client.list_vocabularies( NameContains=vocabulary_filter) vocabs = response['Vocabularies'] next_token = response.get('NextToken') while next_token is not None: response = transcribe_client.list_vocabularies( NameContains=vocabulary_filter, NextToken=next_token) vocabs += response['Vocabularies'] next_token = response.get('NextToken') logger.info( "Got %s vocabularies with filter %s.", len(vocabs), vocabulary_filter) except ClientError: logger.exception( "Couldn't list vocabularies with filter %s.", vocabulary_filter) raise else: return vocabs
  • API の詳細については、「AWSSDK for Python (Boto3) API リファレンス」を参照してくださいListVocabularies