지원 종료 공지: 2025년 9월 15 AWS 일에는 Amazon Lex V1에 대한 지원을 중단합니다. 2025년 9월 15일 이후에는 Amazon Lex V1 콘솔 또는 Amazon Lex V1 리소스에 더 이상 액세스할 수 없습니다. Amazon Lex V2를 사용하는 경우 대신 Amazon Lex V2 가이드를 참조하세요.
기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.
오디오 파일을 사용하여 봇을 테스트하려면 PostContent 작업을 사용합니다. Amazon Polly 텍스트 음성 변환 작업을 사용하여 오디오 파일을 생성합니다.
이 연습에서 명령을 실행하려면 Amazon Lex 및 Amazon Polly 명령이 실행될 리전을 알아야 합니다. Amazon Lex의 지역 목록은 런타임 서비스 할당량을 참조하십시오. Amazon Polly 리전 목록은 Amazon Web Services 일반 참조에서 AWS 리전 및 엔드포인트를 참조하세요.
참고
다음 AWS CLI 예제는 Unix, Linux 및 macOS용 형식입니다. Windows의 경우 "\$LATEST"
를 $LATEST
로 바꾸고, 각 줄의 끝에 있는 백슬래시(\) 연속 문자를 캐럿(^)으로 변경합니다.
음성 입력을 사용하여 봇을 테스트하려면(AWS CLI)
-
에서 Amazon Polly를 사용하여 오디오 파일을 AWS CLI생성합니다. 다음은 Unix, Linux, macOS용 형식으로 지정된 예제입니다. Windows의 경우 각 줄의 끝에 있는 백슬래시(\) Unix 연속 문자를 캐럿(^)으로 바꿉니다.
aws polly synthesize-speech \ --region
region
\ --output-format pcm \ --text "i would like to order flowers" \ --voice-id "Salli" \ IntentSpeech.mpg -
Amazon Lex 에서 오디오 파일을 보내려면 다음 명령을 실행합니다. Amazon Lex는 오디오 응답을 지정된 출력 파일에 저장합니다.
aws lex-runtime post-content \ --region
region
\ --bot-name OrderFlowersBot \ --bot-alias "\$LATEST" \ --user-id UserOne \ --content-type "audio/l16; rate=16000; channels=1" \ --input-stream IntentSpeech.mpg \ IntentOutputSpeech.mpgAmazon Lex는 첫 번째 슬롯에 대한 요청으로 응답합니다. 오디오 응답을 지정된 출력 파일에 저장합니다.
{ "contentType": "audio/mpeg", "slotToElicit": "FlowerType", "dialogState": "ElicitSlot", "intentName": "OrderFlowers", "inputTranscript": "i would like to order some flowers", "slots": { "PickupDate": null, "PickupTime": null, "FlowerType": null }, "message": "What type of flowers would you like to order?" }
-
장미를 주문하려면 다음 오디오 파일을 생성하여 Amazon Lex에 보냅니다.
aws polly synthesize-speech \ --region
region
\ --output-format pcm \ --text "roses" \ --voice-id "Salli" \ FlowerTypeSpeech.mpgaws lex-runtime post-content \ --region
region
\ --bot-name OrderFlowersBot \ --bot-alias "\$LATEST" \ --user-id UserOne \ --content-type "audio/l16; rate=16000; channels=1" \ --input-stream FlowerTypeSpeech.mpg \ FlowerTypeOutputSpeech.mpg -
배달 날짜를 설정하려면 다음 오디오 파일을 만들어 Amazon Lex로 보냅니다.
aws polly synthesize-speech \ --region
region
\ --output-format pcm \ --text "tuesday" \ --voice-id "Salli" \ DateSpeech.mpgaws lex-runtime post-content \ --region
region
\ --bot-name OrderFlowersBot \ --bot-alias "\$LATEST" \ --user-id UserOne \ --content-type "audio/l16; rate=16000; channels=1" \ --input-stream DateSpeech.mpg \ DateOutputSpeech.mpg -
배달 날짜를 설정하려면 다음 오디오 파일을 만들어 Amazon Lex 로 보냅니다.
aws polly synthesize-speech \ --region
region
\ --output-format pcm \ --text "10:00 a.m." \ --voice-id "Salli" \ TimeSpeech.mpgaws lex-runtime post-content \ --region
region
\ --bot-name OrderFlowersBot \ --bot-alias "\$LATEST" \ --user-id UserOne \ --content-type "audio/l16; rate=16000; channels=1" \ --input-stream TimeSpeech.mpg \ TimeOutputSpeech.mpg -
배달 여부를 확인하려면 다음 오디오 파일을 만들어 Amazon Lex로 보냅니다.
aws polly synthesize-speech \ --region
region
\ --output-format pcm \ --text "yes" \ --voice-id "Salli" \ ConfirmSpeech.mpgaws lex-runtime post-content \ --region
region
\ --bot-name OrderFlowersBot \ --bot-alias "\$LATEST" \ --user-id UserOne \ --content-type "audio/l16; rate=16000; channels=1" \ --input-stream ConfirmSpeech.mpg \ ConfirmOutputSpeech.mpg배달 확인 후에는 Amazon Lex가 의도 이행을 확인하는 응답을 보냅니다.
{ "contentType": "text/plain;charset=utf-8", "dialogState": "ReadyForFulfillment", "intentName": "OrderFlowers", "inputTranscript": "yes", "slots": { "PickupDate": "2017-05-16", "PickupTime": "10:00", "FlowerType": "roses" } }