AWS 문서 AWS SDK SDK 예제
기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
UpdateVocabulary
OR와 함께 사용 AWS SDK CLI
다음 코드 예제는 UpdateVocabulary
의 사용 방법을 보여 줍니다.
작업 예제는 대규모 프로그램에서 발췌한 코드이며 컨텍스트에 맞춰 실행해야 합니다. 다음 코드 예제에서는 컨텍스트 내에서 이 작업을 확인할 수 있습니다.
- .NET
-
- AWS SDK for .NET
-
참고
더 많은 정보가 있습니다 GitHub. AWS 코드 예시 리포지토리
에서 전체 예시를 찾고 설정 및 실행하는 방법을 배워보세요. /// <summary> /// Update a custom vocabulary with new values. Update overwrites all existing information. /// </summary> /// <param name="languageCode">The language code of the vocabulary.</param> /// <param name="phrases">Phrases to use in the vocabulary.</param> /// <param name="vocabularyName">Name for the vocabulary.</param> /// <returns>The state of the custom vocabulary.</returns> public async Task<VocabularyState> UpdateCustomVocabulary(LanguageCode languageCode, List<string> phrases, string vocabularyName) { var response = await _amazonTranscribeService.UpdateVocabularyAsync( new UpdateVocabularyRequest() { LanguageCode = languageCode, Phrases = phrases, VocabularyName = vocabularyName }); return response.VocabularyState; }
-
자세한 API 내용은 UpdateVocabulary AWS SDK for .NETAPI참조를 참조하십시오.
-
- CLI
-
- AWS CLI
-
사용자 지정 어휘를 새 용어로 업데이트하는 방법
다음
update-vocabulary
예시에서는 사용자 지정 어휘를 생성하는 데 사용된 용어를 사용자가 제공한 새 용어로 덮어씁니다. 사전 조건: 사용자 지정 어휘의 용어를 바꾸려면 새 용어가 포함된 파일이 필요합니다.aws transcribe update-vocabulary \ --vocabulary-file-uri
s3://DOC-EXAMPLE-BUCKET/Amazon-S3-Prefix/custom-vocabulary.txt
\ --vocabulary-namecustom-vocabulary
\ --language-code
language-code출력:
{ "VocabularyName": "custom-vocabulary", "LanguageCode": "language", "VocabularyState": "PENDING" }
자세한 내용은 Amazon Transcribe 개발자 안내서의 사용자 지정 어휘를 참조하세요.
-
자세한 API 내용은 AWS CLI 명령 UpdateVocabulary
참조를 참조하십시오.
-
- Python
-
- SDK파이썬용 (보토3)
-
참고
더 많은 정보가 있습니다. GitHub AWS 코드 예시 리포지토리
에서 전체 예시를 찾고 설정 및 실행하는 방법을 배워보세요. def update_vocabulary( vocabulary_name, language_code, transcribe_client, phrases=None, table_uri=None ): """ Updates an existing custom vocabulary. The entire vocabulary is replaced with the contents of the update. :param vocabulary_name: The name of the vocabulary to update. :param language_code: The language code of the vocabulary. :param transcribe_client: The Boto3 Transcribe client. :param phrases: A list of comma-separated phrases to include in the vocabulary. :param table_uri: A table of phrases and pronunciation hints to include in the vocabulary. """ try: vocab_args = {"VocabularyName": vocabulary_name, "LanguageCode": language_code} if phrases is not None: vocab_args["Phrases"] = phrases elif table_uri is not None: vocab_args["VocabularyFileUri"] = table_uri response = transcribe_client.update_vocabulary(**vocab_args) logger.info("Updated custom vocabulary %s.", response["VocabularyName"]) except ClientError: logger.exception("Couldn't update custom vocabulary %s.", vocabulary_name) raise
-
자세한 API AWS SDK내용은 Python (Boto3) API 참조를 참조하십시오 UpdateVocabulary.
-