create_batch_inference_job
¶
create_batch_inference_job(
job_name: Name,
solution_version_arn: Arn,
job_input: BatchInferenceJobInput,
job_output: BatchInferenceJobOutput,
role_arn: RoleArn,
*,
config_overrides: Optional[PersonalizeClientConfig] = None,
filter_arn: Optional[Arn] = None,
num_results: Optional[NumBatchResults] = None,
batch_inference_job_config: Optional[BatchInferenceJobConfig] = None,
tags: Optional[Tags] = None,
batch_inference_job_mode: Optional[BatchInferenceJobMode] = None,
theme_generation_config: Optional[ThemeGenerationConfig] = None,
) -> CreateBatchInferenceJobResponse
Generates batch recommendations based on a list of items or users stored in Amazon S3 and exports the recommendations to an Amazon S3 bucket.
To generate batch recommendations, specify the ARN of a solution version and an Amazon S3 URI for the input and output data. For user personalization, popular items, and personalized ranking solutions, the batch inference job generates a list of recommended items for each user ID in the input file. For related items solutions, the job generates a list of recommended items for each item ID in the input file.
For more information, see Creating a batch inference job .
If you use the Similar-Items recipe, Amazon Personalize can add descriptive themes to batch recommendations. To generate themes, set the job's mode to THEME_GENERATION and specify the name of the field that contains item names in the input data.
For more information about generating themes, see Batch recommendations with themes from Content Generator .
You can't get batch recommendations with the Trending-Now or Next-Best-Action recipes.
Parameters:
-
job_name(Name) –The name of the batch inference job to create.
-
solution_version_arn(Arn) –The Amazon Resource Name (ARN) of the solution version that will be used to generate the batch inference recommendations.
-
filter_arn(Optional[Arn], default:None) –The ARN of the filter to apply to the batch inference job. For more information on using filters, see Filtering batch recommendations.
-
num_results(Optional[NumBatchResults], default:None) –The number of recommendations to retrieve.
-
job_input(BatchInferenceJobInput) –The Amazon S3 path that leads to the input file to base your recommendations on. The input material must be in JSON format.
-
job_output(BatchInferenceJobOutput) –The path to the Amazon S3 bucket where the job's output will be stored.
-
role_arn(RoleArn) –The ARN of the Amazon Identity and Access Management role that has permissions to read and write to your input and output Amazon S3 buckets respectively.
-
batch_inference_job_config(Optional[BatchInferenceJobConfig], default:None) –The configuration details of a batch inference job.
-
tags(Optional[Tags], default:None) –A list of tags to apply to the batch inference job.
-
batch_inference_job_mode(Optional[BatchInferenceJobMode], default:None) –The mode of the batch inference job. To generate descriptive themes for groups of similar items, set the job mode to
THEME_GENERATION. If you don't want to generate themes, use the defaultBATCH_INFERENCE.When you get batch recommendations with themes, you will incur additional costs. For more information, see Amazon Personalize pricing.
-
theme_generation_config(Optional[ThemeGenerationConfig], default:None) –For theme generation jobs, specify the name of the column in your Items dataset that contains each item's name.
Raises:
-
InvalidInputException–Provide a valid value for the field or parameter.
-
LimitExceededException–The limit on the number of requests per second has been exceeded.
-
ResourceAlreadyExistsException–The specified resource already exists.
-
ResourceInUseException–The specified resource is in use.
-
ResourceNotFoundException–Could not find the specified resource.
-
TooManyTagsException–You have exceeded the maximum number of tags you can apply to this resource.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_personalize/_services/personalize.py
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |