Table of Contents
KendraRanking.
Client
¶A low-level client representing Amazon Kendra Intelligent Ranking (Kendra Ranking)
Amazon Kendra Intelligent Ranking uses Amazon Kendra semantic search capabilities to intelligently re-rank a search service's results.
import boto3
client = boto3.client('kendra-ranking')
These are the available methods:
can_paginate()
close()
create_rescore_execution_plan()
delete_rescore_execution_plan()
describe_rescore_execution_plan()
get_paginator()
get_waiter()
list_rescore_execution_plans()
list_tags_for_resource()
rescore()
tag_resource()
untag_resource()
update_rescore_execution_plan()
can_paginate
(operation_name)¶Check if an operation can be paginated.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.True
if the operation can be paginated,
False
otherwise.close
()¶Closes underlying endpoint connections.
create_rescore_execution_plan
(**kwargs)¶Creates a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API. You set the number of capacity units that you require for Amazon Kendra Intelligent Ranking to rescore or re-rank a search service's results.
For an example of using the CreateRescoreExecutionPlan
API, including using the Python and Java SDKs, see Semantically ranking a search service's results.
See also: AWS API Documentation
Request Syntax
response = client.create_rescore_execution_plan(
Name='string',
Description='string',
CapacityUnits={
'RescoreCapacityUnits': 123
},
Tags=[
{
'Key': 'string',
'Value': 'string'
},
],
ClientToken='string'
)
[REQUIRED]
A name for the rescore execution plan.
You can set additional capacity units to meet the needs of your rescore execution plan. You are given a single capacity unit by default. If you want to use the default capacity, you don't set additional capacity units. For more information on the default capacity and additional capacity units, see Adjusting capacity.
The amount of extra capacity for your rescore execution plan.
A single extra capacity unit for a rescore execution plan provides 0.01 rescore requests per second. You can add up to 1000 extra capacity units.
A list of key-value pairs that identify or categorize your rescore execution plan. You can also use tags to help control access to the rescore execution plan. Tag keys and values can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
A key-value pair that identifies or categorizes a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API. You can also use a tag to help control access to a rescore execution plan. A tag key and value can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
The key for the tag. Keys are not case sensitive and must be unique.
The value associated with the tag. The value can be an empty string but it can't be null.
A token that you provide to identify the request to create a rescore execution plan. Multiple calls to the CreateRescoreExecutionPlanRequest
API with the same client token will create only one rescore execution plan.
This field is autopopulated if not provided.
dict
Response Syntax
{
'Id': 'string',
'Arn': 'string'
}
Response Structure
(dict) --
Id (string) --
The identifier of the rescore execution plan.
Arn (string) --
The Amazon Resource Name (ARN) of the rescore execution plan.
Exceptions
KendraRanking.Client.exceptions.AccessDeniedException
KendraRanking.Client.exceptions.ConflictException
KendraRanking.Client.exceptions.ServiceQuotaExceededException
KendraRanking.Client.exceptions.ThrottlingException
KendraRanking.Client.exceptions.ValidationException
KendraRanking.Client.exceptions.InternalServerException
delete_rescore_execution_plan
(**kwargs)¶Deletes a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API.
See also: AWS API Documentation
Request Syntax
response = client.delete_rescore_execution_plan(
Id='string'
)
[REQUIRED]
The identifier of the rescore execution plan that you want to delete.
Exceptions
KendraRanking.Client.exceptions.AccessDeniedException
KendraRanking.Client.exceptions.ValidationException
KendraRanking.Client.exceptions.ConflictException
KendraRanking.Client.exceptions.ResourceNotFoundException
KendraRanking.Client.exceptions.ThrottlingException
KendraRanking.Client.exceptions.InternalServerException
describe_rescore_execution_plan
(**kwargs)¶Gets information about a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API.
See also: AWS API Documentation
Request Syntax
response = client.describe_rescore_execution_plan(
Id='string'
)
[REQUIRED]
The identifier of the rescore execution plan that you want to get information on.
{
'Id': 'string',
'Arn': 'string',
'Name': 'string',
'Description': 'string',
'CapacityUnits': {
'RescoreCapacityUnits': 123
},
'CreatedAt': datetime(2015, 1, 1),
'UpdatedAt': datetime(2015, 1, 1),
'Status': 'CREATING'|'UPDATING'|'ACTIVE'|'DELETING'|'FAILED',
'ErrorMessage': 'string'
}
Response Structure
The identifier of the rescore execution plan.
The Amazon Resource Name (ARN) of the rescore execution plan.
The name for the rescore execution plan.
The description for the rescore execution plan.
The capacity units set for the rescore execution plan. A capacity of zero indicates that the rescore execution plan is using the default capacity. For more information on the default capacity and additional capacity units, see Adjusting capacity.
The amount of extra capacity for your rescore execution plan.
A single extra capacity unit for a rescore execution plan provides 0.01 rescore requests per second. You can add up to 1000 extra capacity units.
The Unix timestamp of when the rescore execution plan was created.
The Unix timestamp of when the rescore execution plan was last updated.
The current status of the rescore execution plan. When the value is ACTIVE
, the rescore execution plan is ready for use. If the Status
field value is FAILED
, the ErrorMessage
field contains a message that explains why.
When the Status
field value is FAILED
, the ErrorMessage
field contains a message that explains why.
Exceptions
KendraRanking.Client.exceptions.ValidationException
KendraRanking.Client.exceptions.ResourceNotFoundException
KendraRanking.Client.exceptions.ThrottlingException
KendraRanking.Client.exceptions.AccessDeniedException
KendraRanking.Client.exceptions.InternalServerException
get_paginator
(operation_name)¶Create a paginator for an operation.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.client.can_paginate
method to
check if an operation is pageable.get_waiter
(waiter_name)¶Returns an object that can wait for some condition.
list_rescore_execution_plans
(**kwargs)¶Lists your rescore execution plans. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API.
See also: AWS API Documentation
Request Syntax
response = client.list_rescore_execution_plans(
NextToken='string',
MaxResults=123
)
dict
Response Syntax
{
'SummaryItems': [
{
'Name': 'string',
'Id': 'string',
'CreatedAt': datetime(2015, 1, 1),
'UpdatedAt': datetime(2015, 1, 1),
'Status': 'CREATING'|'UPDATING'|'ACTIVE'|'DELETING'|'FAILED'
},
],
'NextToken': 'string'
}
Response Structure
(dict) --
SummaryItems (list) --
An array of summary information for one or more rescore execution plans.
(dict) --
Summary information for a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API.
Name (string) --
The name of the rescore execution plan.
Id (string) --
The identifier of the rescore execution plan.
CreatedAt (datetime) --
The Unix timestamp when the rescore execution plan was created.
UpdatedAt (datetime) --
The Unix timestamp when the rescore execution plan was last updated.
Status (string) --
The current status of the rescore execution plan. When the value is ACTIVE
, the rescore execution plan is ready for use.
NextToken (string) --
If the response is truncated, Amazon Kendra Intelligent Ranking returns a pagination token in the response.
Exceptions
KendraRanking.Client.exceptions.ValidationException
KendraRanking.Client.exceptions.AccessDeniedException
KendraRanking.Client.exceptions.ThrottlingException
KendraRanking.Client.exceptions.InternalServerException
Gets a list of tags associated with a specified resource. A rescore execution plan is an example of a resource that can have tags associated with it.
See also: AWS API Documentation
Request Syntax
response = client.list_tags_for_resource(
ResourceARN='string'
)
[REQUIRED]
The Amazon Resource Name (ARN) of the rescore execution plan to get a list of tags for.
{
'Tags': [
{
'Key': 'string',
'Value': 'string'
},
]
}
Response Structure
If the action is successful, the service sends back an HTTP 200 response.
A list of tags associated with the rescore execution plan.
A key-value pair that identifies or categorizes a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API. You can also use a tag to help control access to a rescore execution plan. A tag key and value can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
The key for the tag. Keys are not case sensitive and must be unique.
The value associated with the tag. The value can be an empty string but it can't be null.
Exceptions
KendraRanking.Client.exceptions.ValidationException
KendraRanking.Client.exceptions.ResourceUnavailableException
KendraRanking.Client.exceptions.ThrottlingException
KendraRanking.Client.exceptions.AccessDeniedException
KendraRanking.Client.exceptions.InternalServerException
rescore
(**kwargs)¶Rescores or re-ranks search results from a search service such as OpenSearch (self managed). You use the semantic search capabilities of Amazon Kendra Intelligent Ranking to improve the search service's results.
See also: AWS API Documentation
Request Syntax
response = client.rescore(
RescoreExecutionPlanId='string',
SearchQuery='string',
Documents=[
{
'Id': 'string',
'GroupId': 'string',
'Title': 'string',
'Body': 'string',
'TokenizedTitle': [
'string',
],
'TokenizedBody': [
'string',
],
'OriginalScore': ...
},
]
)
[REQUIRED]
The identifier of the rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API.
[REQUIRED]
The input query from the search service.
[REQUIRED]
The list of documents for Amazon Kendra Intelligent Ranking to rescore or rank on.
Information about a document from a search service such as OpenSearch (self managed). Amazon Kendra Intelligent Ranking uses this information to rank and score on.
The identifier of the document from the search service.
The optional group identifier of the document from the search service. Documents with the same group identifier are grouped together and processed as one document within the service.
The title of the search service's document.
The body text of the search service's document.
The title of the search service's document represented as a list of tokens or words. You must choose to provide Title
or TokenizedTitle
. You cannot provide both.
The body text of the search service's document represented as a list of tokens or words. You must choose to provide Body
or TokenizedBody
. You cannot provide both.
The original document score or rank from the search service. Amazon Kendra Intelligent Ranking gives the document a new score or rank based on its intelligent search algorithms.
dict
Response Syntax
{
'RescoreId': 'string',
'ResultItems': [
{
'DocumentId': 'string',
'Score': ...
},
]
}
Response Structure
(dict) --
RescoreId (string) --
The identifier associated with the scores that Amazon Kendra Intelligent Ranking gives to the results. Amazon Kendra Intelligent Ranking rescores or re-ranks the results for the search service.
ResultItems (list) --
A list of result items for documents with new relevancy scores. The results are in descending order.
(dict) --
A result item for a document with a new relevancy score.
DocumentId (string) --
The identifier of the document from the search service.
Score (float) --
The relevancy score or rank that Amazon Kendra Intelligent Ranking gives to the result.
Exceptions
KendraRanking.Client.exceptions.ValidationException
KendraRanking.Client.exceptions.ConflictException
KendraRanking.Client.exceptions.AccessDeniedException
KendraRanking.Client.exceptions.ResourceNotFoundException
KendraRanking.Client.exceptions.ThrottlingException
KendraRanking.Client.exceptions.InternalServerException
tag_resource
(**kwargs)¶Adds a specified tag to a specified rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API. If the tag already exists, the existing value is replaced with the new value.
See also: AWS API Documentation
Request Syntax
response = client.tag_resource(
ResourceARN='string',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the rescore execution plan to tag.
[REQUIRED]
A list of tag keys to add to a rescore execution plan. If a tag already exists, the existing value is replaced with the new value.
A key-value pair that identifies or categorizes a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API. You can also use a tag to help control access to a rescore execution plan. A tag key and value can consist of Unicode letters, digits, white space, and any of the following symbols: _ . : / = + - @.
The key for the tag. Keys are not case sensitive and must be unique.
The value associated with the tag. The value can be an empty string but it can't be null.
dict
Response Syntax
{}
Response Structure
(dict) --
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Exceptions
KendraRanking.Client.exceptions.ValidationException
KendraRanking.Client.exceptions.ResourceUnavailableException
KendraRanking.Client.exceptions.ThrottlingException
KendraRanking.Client.exceptions.AccessDeniedException
KendraRanking.Client.exceptions.InternalServerException
untag_resource
(**kwargs)¶Removes a tag from a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
operation.
See also: AWS API Documentation
Request Syntax
response = client.untag_resource(
ResourceARN='string',
TagKeys=[
'string',
]
)
[REQUIRED]
The Amazon Resource Name (ARN) of the rescore execution plan to remove the tag.
[REQUIRED]
A list of tag keys to remove from the rescore execution plan. If a tag key does not exist on the resource, it is ignored.
dict
Response Syntax
{}
Response Structure
(dict) --
If the action is successful, the service sends back an HTTP 200 response with an empty HTTP body.
Exceptions
KendraRanking.Client.exceptions.ValidationException
KendraRanking.Client.exceptions.ResourceUnavailableException
KendraRanking.Client.exceptions.ThrottlingException
KendraRanking.Client.exceptions.AccessDeniedException
KendraRanking.Client.exceptions.InternalServerException
update_rescore_execution_plan
(**kwargs)¶Updates a rescore execution plan. A rescore execution plan is an Amazon Kendra Intelligent Ranking resource used for provisioning the Rescore
API. You can update the number of capacity units you require for Amazon Kendra Intelligent Ranking to rescore or re-rank a search service's results.
See also: AWS API Documentation
Request Syntax
response = client.update_rescore_execution_plan(
Id='string',
Name='string',
Description='string',
CapacityUnits={
'RescoreCapacityUnits': 123
}
)
[REQUIRED]
The identifier of the rescore execution plan that you want to update.
You can set additional capacity units to meet the needs of your rescore execution plan. You are given a single capacity unit by default. If you want to use the default capacity, you don't set additional capacity units. For more information on the default capacity and additional capacity units, see Adjusting capacity.
The amount of extra capacity for your rescore execution plan.
A single extra capacity unit for a rescore execution plan provides 0.01 rescore requests per second. You can add up to 1000 extra capacity units.
None
Exceptions
KendraRanking.Client.exceptions.ValidationException
KendraRanking.Client.exceptions.ResourceNotFoundException
KendraRanking.Client.exceptions.ThrottlingException
KendraRanking.Client.exceptions.AccessDeniedException
KendraRanking.Client.exceptions.ServiceQuotaExceededException
KendraRanking.Client.exceptions.ConflictException
KendraRanking.Client.exceptions.InternalServerException
The available paginators are: