CreateFlywheel - Amazon Comprehend API Reference

CreateFlywheel

A flywheel is an AWS resource that orchestrates the ongoing training of a model for custom classification or custom entity recognition. You can create a flywheel to start with an existing trained model, or Comprehend can create and train a new model.

When you create the flywheel, Comprehend creates a data lake in your account. The data lake holds the training data and test data for all versions of the model.

To use a flywheel with an existing trained model, you specify the active model version. Comprehend copies the model's training data and test data into the flywheel's data lake.

To use the flywheel with a new model, you need to provide a dataset for training data (and optional test data) when you create the flywheel.

For more information about flywheels, see Flywheel overview in the Amazon Comprehend Developer Guide.

Request Syntax

{ "ActiveModelArn": "string", "ClientRequestToken": "string", "DataAccessRoleArn": "string", "DataLakeS3Uri": "string", "DataSecurityConfig": { "DataLakeKmsKeyId": "string", "ModelKmsKeyId": "string", "VolumeKmsKeyId": "string", "VpcConfig": { "SecurityGroupIds": [ "string" ], "Subnets": [ "string" ] } }, "FlywheelName": "string", "ModelType": "string", "Tags": [ { "Key": "string", "Value": "string" } ], "TaskConfig": { "DocumentClassificationConfig": { "Labels": [ "string" ], "Mode": "string" }, "EntityRecognitionConfig": { "EntityTypes": [ { "Type": "string" } ] }, "LanguageCode": "string" } }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

ActiveModelArn

To associate an existing model with the flywheel, specify the Amazon Resource Number (ARN) of the model version. Do not set TaskConfig or ModelType if you specify an ActiveModelArn.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:(document-classifier|entity-recognizer)/[a-zA-Z0-9](-*[a-zA-Z0-9])*(/version/[a-zA-Z0-9](-*[a-zA-Z0-9])*)?

Required: No

ClientRequestToken

A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: ^[a-zA-Z0-9-]+$

Required: No

DataAccessRoleArn

The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend the permissions required to access the flywheel data in the data lake.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+

Required: Yes

DataLakeS3Uri

Enter the S3 location for the data lake. You can specify a new S3 bucket or a new folder of an existing S3 bucket. The flywheel creates the data lake at this location.

Type: String

Length Constraints: Maximum length of 512.

Pattern: s3://[a-z0-9][\.\-a-z0-9]{1,61}[a-z0-9](/.*)?

Required: Yes

DataSecurityConfig

Data security configurations.

Type: DataSecurityConfig object

Required: No

FlywheelName

Name for the flywheel.

Type: String

Length Constraints: Maximum length of 63.

Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9])*$

Required: Yes

ModelType

The model type. You need to set ModelType if you are creating a flywheel for a new model.

Type: String

Valid Values: DOCUMENT_CLASSIFIER | ENTITY_RECOGNIZER

Required: No

Tags

The tags to associate with this flywheel.

Type: Array of Tag objects

Required: No

TaskConfig

Configuration about the model associated with the flywheel. You need to set TaskConfig if you are creating a flywheel for a new model.

Type: TaskConfig object

Required: No

Response Syntax

{ "ActiveModelArn": "string", "FlywheelArn": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

ActiveModelArn

The Amazon Resource Number (ARN) of the active model version.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:(document-classifier|entity-recognizer)/[a-zA-Z0-9](-*[a-zA-Z0-9])*(/version/[a-zA-Z0-9](-*[a-zA-Z0-9])*)?

FlywheelArn

The Amazon Resource Number (ARN) of the flywheel.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]*:[0-9]{12}:flywheel/[a-zA-Z0-9](-*[a-zA-Z0-9])*

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerException

An internal server error occurred. Retry your request.

HTTP Status Code: 500

InvalidRequestException

The request is invalid.

HTTP Status Code: 400

KmsKeyValidationException

The KMS customer managed key (CMK) entered cannot be validated. Verify the key and re-enter it.

HTTP Status Code: 400

ResourceInUseException

The specified resource name is already in use. Use a different name and try your request again.

HTTP Status Code: 400

ResourceLimitExceededException

The maximum number of resources per account has been exceeded. Review the resources, and then try your request again.

HTTP Status Code: 400

ResourceNotFoundException

The specified resource ARN was not found. Check the ARN and try your request again.

HTTP Status Code: 400

ResourceUnavailableException

The specified resource is not available. Check the resource and try your request again.

HTTP Status Code: 400

TooManyRequestsException

The number of requests exceeds the limit. Resubmit your request later.

HTTP Status Code: 400

TooManyTagsException

The request contains more tags than can be associated with a resource (50 tags per resource). The maximum number of tags includes both existing tags and those included in your current request.

HTTP Status Code: 400

UnsupportedLanguageException

Amazon Comprehend can't process the language of the input text. For a list of supported languages, Supported languages in the Comprehend Developer Guide.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: