import_model
¶
import_model(
source_model_arn: ComprehendModelArn,
*,
config_overrides: Optional[ComprehendClientConfig] = None,
model_name: Optional[ComprehendArnName] = None,
version_name: Optional[VersionName] = None,
model_kms_key_id: Optional[KmsKeyId] = None,
data_access_role_arn: Optional[IamRoleArn] = None,
tags: Optional[TagList] = None,
) -> ImportModelResponse
Creates a new custom model that replicates a source custom model that you import. The source model can be in your Amazon Web Services account or another one.
If the source model is in another Amazon Web Services account, then it must have a resource-based policy that authorizes you to import it.
The source model must be in the same Amazon Web Services Region that you're using when you import. You can't import a model that's in a different Region.
Parameters:
-
source_model_arn(ComprehendModelArn) –The Amazon Resource Name (ARN) of the custom model to import.
-
model_name(Optional[ComprehendArnName], default:None) –The name to assign to the custom model that is created in Amazon Comprehend by this import.
-
version_name(Optional[VersionName], default:None) –The version name given to the custom model that is created by this import. Version names can have a maximum of 256 characters. Alphanumeric characters, hyphens (-) and underscores (_) are allowed. The version name must be unique among all models with the same classifier name in the account/Region.
-
model_kms_key_id(Optional[KmsKeyId], default:None) –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"
-
-
data_access_role_arn(Optional[IamRoleArn], default:None) –The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend permission to use Amazon Key Management Service (KMS) to encrypt or decrypt the custom model.
-
tags(Optional[TagList], default:None) –Tags to associate with the custom model that is created by this import. 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.
Raises:
-
InternalServerException–An internal server error occurred. Retry your request.
-
InvalidRequestException–The request is invalid.
-
KmsKeyValidationException–The KMS customer managed key (CMK) entered cannot be validated. Verify the key and re-enter it.
-
ResourceInUseException–The specified resource name is already in use. Use a different name and try your request again.
-
ResourceLimitExceededException–The maximum number of resources per account has been exceeded. Review the resources, and then try your request again.
-
ResourceNotFoundException–The specified resource ARN was not found. Check the ARN and try your request again.
-
ResourceUnavailableException–The specified resource is not available. Check the resource and try your request again.
-
TooManyRequestsException–The number of requests exceeds the limit. Resubmit your request later.
-
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.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_comprehend/_services/comprehend.py
2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 | |