entity_recognizers
Creates, updates, deletes, gets or lists an entity_recognizers resource.
Overview
| Name | entity_recognizers |
| Type | Resource |
| Id | aws.comprehend.entity_recognizers |
Fields
The following fields are returned by SELECT queries:
- describe_entity_recognizer
- list_entity_recognizers
| Name | Datatype | Description |
|---|---|---|
data_access_role_arn | string | The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data. (pattern: <code>arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+</code>) |
end_time | string (date-time) | The time that the recognizer creation completed. |
entity_recognizer_arn | string | The Amazon Resource Name (ARN) that identifies the entity recognizer. (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:entity-recognizer/[a-zA-Z0-9](-[a-zA-Z0-9])(/version/[a-zA-Z0-9](-[a-zA-Z0-9])*)?</code>) |
flywheel_arn | string | The Amazon Resource Number (ARN) of the flywheel (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:flywheel/[a-zA-Z0-9](-[a-zA-Z0-9])*</code>) |
input_data_config | object | The input data properties of an entity recognizer. |
language_code | string | The language of the input documents. All documents must be in the same language. Only English ("en") is currently supported. (en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW) |
message | string | A description of the status of the recognizer. |
model_kms_key_id | string | ID for the KMS key that Amazon Comprehend uses to encrypt trained custom models. The ModelKmsKeyId can be either of the following formats: KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" (pattern: <code>^\p{ASCII}+$</code>) |
output_data_config | object | Output data configuration. |
recognizer_metadata | object | Provides information about an entity recognizer. |
source_model_arn | string | The Amazon Resource Name (ARN) of the source model. This model was imported from a different Amazon Web Services account to create the entity recognizer model in your Amazon Web Services account. (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:entity-recognizer/[a-zA-Z0-9](-[a-zA-Z0-9])(/version/[a-zA-Z0-9](-[a-zA-Z0-9])*)?</code>) |
status | string | Provides the status of the entity recognizer. (SUBMITTED, TRAINING, DELETING, STOP_REQUESTED, STOPPED, IN_ERROR, TRAINED, TRAINED_WITH_WARNING) |
submit_time | string (date-time) | The time that the recognizer was submitted for processing. |
training_end_time | string (date-time) | The time that training of the entity recognizer was completed. |
training_start_time | string (date-time) | The time that training of the entity recognizer started. |
version_name | string | The version name you assigned to the entity recognizer. (pattern: <code>^[a-zA-Z0-9](-[a-zA-Z0-9])$</code>) |
volume_kms_key_id | string | ID for the Amazon Web Services Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the analysis job. The VolumeKmsKeyId can be either of the following formats: KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" (pattern: <code>^\p{ASCII}+$</code>) |
vpc_config | object | Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for the job. For more information, see Amazon VPC. |
| Name | Datatype | Description |
|---|---|---|
data_access_role_arn | string | The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data. (pattern: <code>arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+</code>) |
end_time | string (date-time) | The time that the recognizer creation completed. |
entity_recognizer_arn | string | The Amazon Resource Name (ARN) that identifies the entity recognizer. (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:entity-recognizer/[a-zA-Z0-9](-[a-zA-Z0-9])(/version/[a-zA-Z0-9](-[a-zA-Z0-9])*)?</code>) |
flywheel_arn | string | The Amazon Resource Number (ARN) of the flywheel (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:flywheel/[a-zA-Z0-9](-[a-zA-Z0-9])*</code>) |
input_data_config | object | The input data properties of an entity recognizer. |
language_code | string | The language of the input documents. All documents must be in the same language. Only English ("en") is currently supported. (en, es, fr, de, it, pt, ar, hi, ja, ko, zh, zh-TW) |
message | string | A description of the status of the recognizer. |
model_kms_key_id | string | ID for the KMS key that Amazon Comprehend uses to encrypt trained custom models. The ModelKmsKeyId can be either of the following formats: KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" (pattern: <code>^\p{ASCII}+$</code>) |
output_data_config | object | Output data configuration. |
recognizer_metadata | object | Provides information about an entity recognizer. |
source_model_arn | string | The Amazon Resource Name (ARN) of the source model. This model was imported from a different Amazon Web Services account to create the entity recognizer model in your Amazon Web Services account. (pattern: <code>arn:aws(-[^:]+)?:comprehend:[a-zA-Z0-9-]:[0-9]{12}:entity-recognizer/[a-zA-Z0-9](-[a-zA-Z0-9])(/version/[a-zA-Z0-9](-[a-zA-Z0-9])*)?</code>) |
status | string | Provides the status of the entity recognizer. (SUBMITTED, TRAINING, DELETING, STOP_REQUESTED, STOPPED, IN_ERROR, TRAINED, TRAINED_WITH_WARNING) |
submit_time | string (date-time) | The time that the recognizer was submitted for processing. |
training_end_time | string (date-time) | The time that training of the entity recognizer was completed. |
training_start_time | string (date-time) | The time that training of the entity recognizer started. |
version_name | string | The version name you assigned to the entity recognizer. (pattern: <code>^[a-zA-Z0-9](-[a-zA-Z0-9])$</code>) |
volume_kms_key_id | string | ID for the Amazon Web Services Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the analysis job. The VolumeKmsKeyId can be either of the following formats: KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" (pattern: <code>^\p{ASCII}+$</code>) |
vpc_config | object | Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for the job. For more information, see Amazon VPC. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_entity_recognizer | select | region | Provides details about an entity recognizer including status, S3 buckets containing training data, recognizer metadata, metrics, and so on. | |
list_entity_recognizers | select | region | Gets a list of the properties of all entity recognizers that you created, including recognizers currently in training. Allows you to filter the list of recognizers based on criteria such as status and submission time. This call returns up to 500 entity recognizers in the list, with a default number of 100 recognizers in the list. The results of this list are not in any particular order. Please get the list and sort locally if needed. | |
create_entity_recognizer | insert | region, RecognizerName, DataAccessRoleArn, InputDataConfig, LanguageCode | Creates an entity recognizer using submitted files. After your CreateEntityRecognizer request is submitted, you can check job status using the DescribeEntityRecognizer API. | |
delete_entity_recognizer | delete | region | Deletes an entity recognizer. Only those recognizers that are in terminated states (IN_ERROR, TRAINED) will be deleted. If an active inference job is using the model, a ResourceInUseException will be returned. This is an asynchronous action that puts the recognizer into a DELETING state, and it is then removed by a background job. Once removed, the recognizer disappears from your account and is no longer available for use. | |
stop_training_entity_recognizer | exec | region, EntityRecognizerArn | Stops an entity recognizer training job while in progress. If the training job state is TRAINING, the job is marked for termination and put into the STOP_REQUESTED state. If the training job completes before it can be stopped, it is put into the TRAINED; otherwise the training job is stopped and putted into the STOPPED state and the service sends back an HTTP 200 response with an empty HTTP body. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_entity_recognizer
- list_entity_recognizers
Provides details about an entity recognizer including status, S3 buckets containing training data, recognizer metadata, metrics, and so on.
SELECT
data_access_role_arn,
end_time,
entity_recognizer_arn,
flywheel_arn,
input_data_config,
language_code,
message,
model_kms_key_id,
output_data_config,
recognizer_metadata,
source_model_arn,
status,
submit_time,
training_end_time,
training_start_time,
version_name,
volume_kms_key_id,
vpc_config
FROM aws.comprehend.entity_recognizers
WHERE region = '{{ region }}' -- required
;
Gets a list of the properties of all entity recognizers that you created, including recognizers currently in training. Allows you to filter the list of recognizers based on criteria such as status and submission time. This call returns up to 500 entity recognizers in the list, with a default number of 100 recognizers in the list. The results of this list are not in any particular order. Please get the list and sort locally if needed.
SELECT
data_access_role_arn,
end_time,
entity_recognizer_arn,
flywheel_arn,
input_data_config,
language_code,
message,
model_kms_key_id,
output_data_config,
recognizer_metadata,
source_model_arn,
status,
submit_time,
training_end_time,
training_start_time,
version_name,
volume_kms_key_id,
vpc_config
FROM aws.comprehend.entity_recognizers
WHERE region = '{{ region }}' -- required
;
INSERT examples
- create_entity_recognizer
- Manifest
Creates an entity recognizer using submitted files. After your CreateEntityRecognizer request is submitted, you can check job status using the DescribeEntityRecognizer API.
INSERT INTO aws.comprehend.entity_recognizers (
RecognizerName,
VersionName,
DataAccessRoleArn,
Tags,
InputDataConfig,
ClientRequestToken,
LanguageCode,
VolumeKmsKeyId,
VpcConfig,
ModelKmsKeyId,
ModelPolicy,
region
)
SELECT
'{{ RecognizerName }}' /* required */,
'{{ VersionName }}',
'{{ DataAccessRoleArn }}' /* required */,
'{{ Tags }}',
'{{ InputDataConfig }}' /* required */,
'{{ ClientRequestToken }}',
'{{ LanguageCode }}' /* required */,
'{{ VolumeKmsKeyId }}',
'{{ VpcConfig }}',
'{{ ModelKmsKeyId }}',
'{{ ModelPolicy }}',
'{{ region }}'
RETURNING
entity_recognizer_arn
;
# Description fields are for documentation purposes
- name: entity_recognizers
props:
- name: region
value: "{{ region }}"
description: Required parameter for the entity_recognizers resource.
- name: RecognizerName
value: "{{ RecognizerName }}"
description: |
The name given to the newly created recognizer. Recognizer names can be a maximum of 256 characters. Alphanumeric characters, hyphens (-) and underscores (_) are allowed. The name must be unique in the account/Region.
- name: VersionName
value: "{{ VersionName }}"
description: |
The version name given to the newly created recognizer. Version names can be a maximum of 256 characters. Alphanumeric characters, hyphens (-) and underscores (_) are allowed. The version name must be unique among all models with the same recognizer name in the account/Region.
- name: DataAccessRoleArn
value: "{{ DataAccessRoleArn }}"
description: |
The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data.
- name: Tags
description: |
Tags to associate with the entity recognizer. A tag is a key-value pair that adds as a metadata to a resource used by Amazon Comprehend. For example, a tag with "Sales" as the key might be added to a resource to indicate its use by the sales department.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: InputDataConfig
description: |
Specifies the format and location of the input data. The S3 bucket containing the input data must be located in the same Region as the entity recognizer being created.
value:
DataFormat: "{{ DataFormat }}"
EntityTypes:
- Type: "{{ Type }}"
Documents:
S3Uri: "{{ S3Uri }}"
TestS3Uri: "{{ TestS3Uri }}"
InputFormat: "{{ InputFormat }}"
Annotations:
S3Uri: "{{ S3Uri }}"
TestS3Uri: "{{ TestS3Uri }}"
EntityList:
S3Uri: "{{ S3Uri }}"
AugmentedManifests:
- S3Uri: "{{ S3Uri }}"
Split: "{{ Split }}"
AttributeNames: "{{ AttributeNames }}"
AnnotationDataS3Uri: "{{ AnnotationDataS3Uri }}"
SourceDocumentsS3Uri: "{{ SourceDocumentsS3Uri }}"
DocumentType: "{{ DocumentType }}"
- name: ClientRequestToken
value: "{{ ClientRequestToken }}"
description: |
A unique identifier for the request. If you don't set the client request token, Amazon Comprehend generates one.
- name: LanguageCode
value: "{{ LanguageCode }}"
description: |
You can specify any of the following languages: English ("en"), Spanish ("es"), French ("fr"), Italian ("it"), German ("de"), or Portuguese ("pt"). If you plan to use this entity recognizer with PDF, Word, or image input files, you must specify English as the language. All training documents must be in the same language.
valid_values: ['en', 'es', 'fr', 'de', 'it', 'pt', 'ar', 'hi', 'ja', 'ko', 'zh', 'zh-TW']
- name: VolumeKmsKeyId
value: "{{ VolumeKmsKeyId }}"
description: |
ID for the Amazon Web Services Key Management Service (KMS) key that Amazon Comprehend uses to encrypt data on the storage volume attached to the ML compute instance(s) that process the analysis job. The VolumeKmsKeyId can be either of the following formats: KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
- name: VpcConfig
description: |
Configuration parameters for an optional private Virtual Private Cloud (VPC) containing the resources you are using for your custom entity recognizer. For more information, see Amazon VPC.
value:
SecurityGroupIds:
- "{{ SecurityGroupIds }}"
Subnets:
- "{{ Subnets }}"
- name: ModelKmsKeyId
value: "{{ ModelKmsKeyId }}"
description: |
ID for the KMS key that Amazon Comprehend uses to encrypt trained custom models. The ModelKmsKeyId can be either of the following formats: KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" Amazon Resource Name (ARN) of a KMS Key: "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
- name: ModelPolicy
value: "{{ ModelPolicy }}"
description: |
The JSON resource-based policy to attach to your custom entity recognizer model. You can use this policy to allow another Amazon Web Services account to import your custom model. Provide your JSON as a UTF-8 encoded string without line breaks. To provide valid JSON for your policy, enclose the attribute names and values in double quotes. If the JSON body is also enclosed in double quotes, then you must escape the double quotes that are inside the policy: "{"attribute": "value", "attribute": ["value"]}" To avoid escaping quotes, you can use single quotes to enclose the policy and double quotes to enclose the JSON names and values: '{"attribute": "value", "attribute": ["value"]}'
DELETE examples
- delete_entity_recognizer
Deletes an entity recognizer. Only those recognizers that are in terminated states (IN_ERROR, TRAINED) will be deleted. If an active inference job is using the model, a ResourceInUseException will be returned. This is an asynchronous action that puts the recognizer into a DELETING state, and it is then removed by a background job. Once removed, the recognizer disappears from your account and is no longer available for use.
DELETE FROM aws.comprehend.entity_recognizers
WHERE region = '{{ region }}' --required
;
Lifecycle Methods
- stop_training_entity_recognizer
Stops an entity recognizer training job while in progress. If the training job state is TRAINING, the job is marked for termination and put into the STOP_REQUESTED state. If the training job completes before it can be stopped, it is put into the TRAINED; otherwise the training job is stopped and putted into the STOPPED state and the service sends back an HTTP 200 response with an empty HTTP body.
EXEC aws.comprehend.entity_recognizers.stop_training_entity_recognizer
@region='{{ region }}' --required
@@json=
'{
"EntityRecognizerArn": "{{ EntityRecognizerArn }}"
}'
;