기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
다음과 UpdateVocabulary
함께 사용하십시오. 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 .NET API참조.
-
- 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 내용은 UpdateVocabulary
을 참조하십시오. AWS CLI 명령 참조.
-
- 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 내용은 UpdateVocabulary을 참조하십시오. AWS SDK파이썬 (Boto3) API 참조용.
-
전체 목록은 다음과 같습니다. AWS SDK개발자 가이드 및 코드 예제는 을 참조하십시오SDK와 함께 이 서비스 사용 AWS. 이 항목에는 시작에 대한 정보와 이전 SDK 버전에 대한 세부 정보도 포함되어 있습니다.