쿠키 기본 설정 선택

당사는 사이트와 서비스를 제공하는 데 필요한 필수 쿠키 및 유사한 도구를 사용합니다. 고객이 사이트를 어떻게 사용하는지 파악하고 개선할 수 있도록 성능 쿠키를 사용해 익명의 통계를 수집합니다. 필수 쿠키는 비활성화할 수 없지만 '사용자 지정' 또는 ‘거부’를 클릭하여 성능 쿠키를 거부할 수 있습니다.

사용자가 동의하는 경우 AWS와 승인된 제3자도 쿠키를 사용하여 유용한 사이트 기능을 제공하고, 사용자의 기본 설정을 기억하고, 관련 광고를 비롯한 관련 콘텐츠를 표시합니다. 필수가 아닌 모든 쿠키를 수락하거나 거부하려면 ‘수락’ 또는 ‘거부’를 클릭하세요. 더 자세한 내용을 선택하려면 ‘사용자 정의’를 클릭하세요.

검색 서비스 결과의 의미론적 순위 지정 - Amazon Kendra

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

검색 서비스 결과의 의미론적 순위 지정

Amazon Kendra Intelligent Ranking은 Amazon Kendra의 의미 체계 검색 기능을 사용하여 검색 서비스의 결과의 순위를 다시 매깁니다. 이를 위해 검색 쿼리의 컨텍스트와 검색 서비스 문서에서 사용 가능한 모든 정보를 고려합니다. Amazon Kendra Intelligent Ranking은 간단한 키워드 일치를 개선할 수 있습니다.

CreateRescoreExecutionPlan API는 Rescore API를 프로비저닝하는 데 사용되는 Amazon Kendra Intelligent Ranking 리소스를 생성합니다. Rescore API는 OpenSearch(자체 관리형)와 같은 검색 서비스의 검색 결과 순위를 다시 매깁니다.

CreateRescoreExecutionPlan를 호출하면 검색 서비스 결과의 순위를 다시 매기는 데 필요한 용량 단위를 설정합니다. 단일 단위 기본값 외에 더 많은 용량 단위가 필요하지 않은 경우 기본값을 변경하지 마세요. 재평가 실행 계획에는 이름만 입력하세요. 최대 1000 추가 단위를 설정할 수 있습니다. 단일 용량 단위에 포함되는 항목에 대한 자세한 내용은 용량 조정을 참조하세요. Amazon Kendra Intelligent Ranking을 프로비저닝하면 설정된 용량 단위에 따라 시간당 요금이 부과됩니다. 프리 티어 및 요금 정보를 참조하세요.

재평가 실행 계획 ID가 생성되어 CreateRescoreExecutionPlan 호출 시 응답에 반환됩니다. Rescore API는 재평가 실행 계획 ID를 사용하여 사용자가 설정한 용량으로 검색 서비스 결과의 순위를 다시 매깁니다. 검색 서비스의 구성 파일에 재평가 실행 계획 ID를 포함합니다. 예를 들어, OpenSearch(자체 관리형)를 사용하는 경우 docker-compose.yml 또는 opensearch.yml 파일에 재평가 실행 계획 ID를 포함합니다. OpenSearch(자체 서비스) 결과의 지능적 순위 지정을 참조하세요.

Amazon 리소스 이름(ARN)도 CreateRescoreExecutionPlan 호출 시 응답에 생성됩니다. 이 ARN을 사용하여 AWS Identity and Access Management (IAM)에서 권한 정책을 생성하여 특정 재점수 실행 계획의 특정 ARN에 대한 사용자 액세스를 제한할 수 있습니다. 특정 재점수 실행 계획에 Rescore API를 사용할 수 있는 권한을 부여하는 IAM 정책의 예는 Amazon Kendra 자체 관리형 OpenSearch용 Intelligent Ranking을 참조하세요.

다음은 용량 단위를 1로 설정하여 재평가 실행 계획을 생성하는 예제입니다.

CLI
aws kendra-ranking create-rescore-execution-plan \ --name MyRescoreExecutionPlan \ --capacity-units '{"RescoreCapacityUnits":1}' Response: { "Id": "<rescore execution plan ID>", "Arn": "arn:aws:kendra-ranking:<region>:<account-id>:rescore-execution-plan/<rescore-execution-plan-id>" }
Python
import boto3 from botocore.exceptions import ClientError import pprint import time kendra_ranking = boto3.client("kendra-ranking") print("Create a rescore execution plan.") # Provide a name for the rescore execution plan name = "MyRescoreExecutionPlan" # Set your required additional capacity units # Don't set capacity units if you don't require more than 1 unit given by default capacity_units = 1 try: rescore_execution_plan_response = kendra_ranking.create_rescore_execution_plan( Name = name, CapacityUnits = {"RescoreCapacityUnits":capacity_units} ) pprint.pprint(rescore_execution_plan_response) rescore_execution_plan_id = rescore_execution_plan_response["Id"] print("Wait for Amazon Kendra to create the rescore execution plan.") while True: # Get the details of the rescore execution plan, such as the status rescore_execution_plan_description = kendra_ranking.describe_rescore_execution_plan( Id = rescore_execution_plan_id ) # When status is not CREATING quit. status = rescore_execution_plan_description["Status"] print(" Creating rescore execution plan. Status: "+status) time.sleep(60) if status != "CREATING": break except ClientError as e: print("%s" % e) print("Program ends.")
Java
import java.util.concurrent.TimeUnit; import software.amazon.awssdk.services.kendraranking.KendraRankingClient; import software.amazon.awssdk.services.kendraranking.model.CapacityUnitsConfiguration; import software.amazon.awssdk.services.kendraranking.model.CreateRescoreExecutionPlanRequest; import software.amazon.awssdk.services.kendraranking.model.CreateRescoreExecutionPlanResponse; import software.amazon.awssdk.services.kendraranking.model.DescribeRescoreExecutionPlanRequest; import software.amazon.awssdk.services.kendraranking.model.DescribeRescoreExecutionPlanResponse; import software.amazon.awssdk.services.kendraranking.model.RescoreExecutionPlanStatus; public class CreateRescoreExecutionPlanExample { public static void main(String[] args) throws InterruptedException { String rescoreExecutionPlanName = "MyRescoreExecutionPlan"; int capacityUnits = 1; KendraRankingClient kendraRankingClient = KendraRankingClient.builder().build(); System.out.println(String.format("Creating a rescore execution plan named %s", rescoreExecutionPlanName)); CreateRescoreExecutionPlanResponse createResponse = kendraRankingClient.createRescoreExecutionPlan( CreateRescoreExecutionPlanRequest.builder() .name(rescoreExecutionPlanName) .capacityUnits( CapacityUnitsConfiguration.builder() .rescoreCapacityUnits(capacityUnits) .build() ) .build() ); String rescoreExecutionPlanId = createResponse.id(); System.out.println(String.format("Waiting for rescore execution plan with id %s to finish creating.", rescoreExecutionPlanId)); while (true) { DescribeRescoreExecutionPlanResponse describeResponse = kendraRankingClient.describeRescoreExecutionPlan( DescribeRescoreExecutionPlanRequest.builder() .id(rescoreExecutionPlanId) .build() ); RescoreExecutionPlanStatus rescoreExecutionPlanStatus = describeResponse.status(); if (rescoreExecutionPlanStatus != RescoreExecutionPlanStatus.CREATING) { break; } TimeUnit.SECONDS.sleep(60); } System.out.println("Rescore execution plan creation is complete."); } }
aws kendra-ranking create-rescore-execution-plan \ --name MyRescoreExecutionPlan \ --capacity-units '{"RescoreCapacityUnits":1}' Response: { "Id": "<rescore execution plan ID>", "Arn": "arn:aws:kendra-ranking:<region>:<account-id>:rescore-execution-plan/<rescore-execution-plan-id>" }

다음은 재평가 실행 계획을 업데이트하여 용량 단위를 2로 설정하는 예제입니다.

CLI
aws kendra-ranking update-rescore-execution-plan \ --id <rescore execution plan ID> \ --capacity-units '{"RescoreCapacityUnits":2}'
Python
import boto3 from botocore.exceptions import ClientError import pprint import time kendra_ranking = boto3.client("kendra-ranking") print("Update a rescore execution plan.") # Provide the ID of the rescore execution plan id = <rescore execution plan ID> # Re-set your required additional capacity units capacity_units = 2 try: kendra_ranking.update_rescore_execution_plan( Id = id, CapacityUnits = {"RescoreCapacityUnits":capacity_units} ) print("Wait for Amazon Kendra to update the rescore execution plan.") while True: # Get the details of the rescore execution plan, such as the status rescore_execution_plan_description = kendra_ranking.describe_rescore_execution_plan( Id = id ) # When status is not UPDATING quit. status = rescore_execution_plan_description["Status"] print(" Updating rescore execution plan. Status: "+status) time.sleep(60) if status != "UPDATING": break except ClientError as e: print("%s" % e) print("Program ends.")
Java
import java.util.concurrent.TimeUnit; import software.amazon.awssdk.services.kendraranking.KendraRankingClient; import software.amazon.awssdk.services.kendraranking.model.CapacityUnitsConfiguration; import software.amazon.awssdk.services.kendraranking.model.DescribeRescoreExecutionPlanRequest; import software.amazon.awssdk.services.kendraranking.model.DescribeRescoreExecutionPlanResponse; import software.amazon.awssdk.services.kendraranking.model.RescoreExecutionPlanStatus; import software.amazon.awssdk.services.kendraranking.model.UpdateRescoreExecutionPlanRequest; import software.amazon.awssdk.services.kendraranking.model.UpdateRescoreExecutionPlanResponse; public class UpdateRescoreExecutionPlanExample { public static void main(String[] args) throws InterruptedException { String rescoreExecutionPlanId = <rescore execution plan ID>; int newCapacityUnits = 2; KendraRankingClient kendraRankingClient = KendraRankingClient.builder().build(); System.out.println(String.format("Updating a rescore execution plan named %s", rescoreExecutionPlanId)); UpdateRescoreExecutionPlanResponse updateResponse = kendraRankingClient.updateRescoreExecutionPlan( UpdateRescoreExecutionPlanRequest.builder() .id(rescoreExecutionPlanId) .capacityUnits( CapacityUnitsConfiguration.builder() .rescoreCapacityUnits(newCapacityUnits) .build() ) .build() ); System.out.println(String.format("Waiting for rescore execution plan with id %s to finish updating.", rescoreExecutionPlanId)); while (true) { DescribeRescoreExecutionPlanResponse describeResponse = kendraRankingClient.describeRescoreExecutionPlan( DescribeRescoreExecutionPlanRequest.builder() .id(rescoreExecutionPlanId) .build() ); RescoreExecutionPlanStatus rescoreExecutionPlanStatus = describeResponse.status(); if (rescoreExecutionPlanStatus != RescoreExecutionPlanStatus.UPDATING) { break; } TimeUnit.SECONDS.sleep(60); } System.out.println("Rescore execution plan update is complete."); } }
aws kendra-ranking update-rescore-execution-plan \ --id <rescore execution plan ID> \ --capacity-units '{"RescoreCapacityUnits":2}'

다음은 Rescore API 사용의 예입니다.

CLI
aws kendra-ranking rescore \ --rescore-execution-plan-id <rescore execution plan ID> \ --search-query "intelligent systems" \ --documents "[{\"Id\": \"DocId1\",\"Title\": \"Smart systems\", \"Body\": \"intelligent systems in everyday life\",\"OriginalScore\": 2.0}, {\"Id\": \"DocId2\",\"Title\": \"Smarter systems\", \"Body\": \"living with intelligent systems\",\"OriginalScore\": 1.0}]"
Python
import boto3 from botocore.exceptions import ClientError import pprint kendra_ranking = boto3.client("kendra-ranking") print("Use the Rescore API.") # Provide the ID of the rescore execution plan id = <rescore execution plan ID> # The search query from the search service query = "intelligent systems" # The list of documents for Intelligent Ranking to rescore document_list = [ {"Id": "DocId1", "Title": "Smart systems", "Body": "intelligent systems in everyday life", "OriginalScore": 2.0}, {"Id": "DocId2", "Title": "Smarter systems", "Body": "living with intelligent systems", "OriginalScore": 1.0} ] try: rescore_response = kendra_ranking.rescore( rescore_execution_plan_id = id, search_query = query, documents = document_list ) print(rescore_response["RescoreId"]) print(rescore_resposne["ResultItems"]) except ClientError as e: print("%s" % e) print("Program ends.")
Java
import java.util.ArrayList; import java.util.List; import software.amazon.awssdk.services.kendraranking.KendraRankingClient; import software.amazon.awssdk.services.kendraranking.model.RescoreRequest; import software.amazon.awssdk.services.kendraranking.model.RescoreResponse; import software.amazon.awssdk.services.kendraranking.model.Document; public class RescoreExample { public static void main(String[] args) { String rescoreExecutionPlanId = <rescore execution plan ID>; String query = "intelligent systems"; List<Document> documentList = new ArrayList<>(); documentList.add( Document.builder() .id("DocId1") .originalScore(2.0F) .body("intelligent systems in everyday life") .title("Smart systems") .build() ); documentList.add( Document.builder() .id("DocId2") .originalScore(1.0F) .body("living with intelligent systems") .title("Smarter systems") .build() ); KendraRankingClient kendraRankingClient = KendraRankingClient.builder().build(); RescoreResponse rescoreResponse = kendraRankingClient.rescore( RescoreRequest.builder() .rescoreExecutionPlanId(rescoreExecutionPlanId) .searchQuery(query) .documents(documentList) .build() ); System.out.println(rescoreResponse.rescoreId()); System.out.println(rescoreResponse.resultItems()); } }
aws kendra-ranking rescore \ --rescore-execution-plan-id <rescore execution plan ID> \ --search-query "intelligent systems" \ --documents "[{\"Id\": \"DocId1\",\"Title\": \"Smart systems\", \"Body\": \"intelligent systems in everyday life\",\"OriginalScore\": 2.0}, {\"Id\": \"DocId2\",\"Title\": \"Smarter systems\", \"Body\": \"living with intelligent systems\",\"OriginalScore\": 1.0}]"
프라이버시사이트 이용 약관쿠키 기본 설정
© 2025, Amazon Web Services, Inc. 또는 계열사. All rights reserved.