Class: AWSCDK::Comprehend::CfnDocumentClassifierProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
comprehend/cfn_document_classifier_props.rb

Overview

Properties for defining a CfnDocumentClassifier.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_access_role_arn:, document_classifier_name:, input_data_config:, language_code:, mode: nil, model_kms_key_id: nil, model_policy: nil, output_data_config: nil, tags: nil, version_name: nil, volume_kms_key_id: nil, vpc_config: nil) ⇒ CfnDocumentClassifierProps

Returns a new instance of CfnDocumentClassifierProps.

Parameters:

  • data_access_role_arn (String)

    The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data.

  • document_classifier_name (String)

    The name of the document classifier.

  • input_data_config (AWSCDK::IResolvable, AWSCDK::Comprehend::CfnDocumentClassifier::DocumentClassifierInputDataConfigProperty)

    Specifies the format and location of the input data for the job.

  • language_code (String)

    The language of the input documents.

  • mode (String, nil) (defaults to: nil)

    Indicates the mode in which the classifier will be trained.

  • model_kms_key_id (String, nil) (defaults to: nil)

    ID for the AWS key that Amazon Comprehend uses to encrypt trained custom models.

  • model_policy (String, nil) (defaults to: nil)

    The resource-based policy to attach to your custom document classifier model.

  • output_data_config (AWSCDK::IResolvable, AWSCDK::Comprehend::CfnDocumentClassifier::DocumentClassifierOutputDataConfigProperty, nil) (defaults to: nil)

    Provides output results configuration parameters for custom classifier jobs.

  • tags (Array<AWSCDK::CfnTag>, nil) (defaults to: nil)

    Tags to associate with the document classifier.

  • version_name (String, nil) (defaults to: nil)

    The version name given to the newly created classifier.

  • volume_kms_key_id (String, nil) (defaults to: nil)

    ID for the AWS 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.

  • vpc_config (AWSCDK::IResolvable, AWSCDK::Comprehend::CfnDocumentClassifier::VPCConfigProperty, nil) (defaults to: nil)

    Configuration parameters for a private Virtual Private Cloud (VPC) containing the resources you are using for your custom classifier.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'comprehend/cfn_document_classifier_props.rb', line 21

def initialize(data_access_role_arn:, document_classifier_name:, input_data_config:, language_code:, mode: nil, model_kms_key_id: nil, model_policy: nil, output_data_config: nil, tags: nil, version_name: nil, volume_kms_key_id: nil, vpc_config: nil)
  @data_access_role_arn = data_access_role_arn
  Jsii::Type.check_type(@data_access_role_arn, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dataAccessRoleArn")
  @document_classifier_name = document_classifier_name
  Jsii::Type.check_type(@document_classifier_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "documentClassifierName")
  @input_data_config = input_data_config.is_a?(Hash) ? ::AWSCDK::Comprehend::CfnDocumentClassifier::DocumentClassifierInputDataConfigProperty.new(**input_data_config.transform_keys(&:to_sym)) : input_data_config
  Jsii::Type.check_type(@input_data_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb21wcmVoZW5kLkNmbkRvY3VtZW50Q2xhc3NpZmllci5Eb2N1bWVudENsYXNzaWZpZXJJbnB1dERhdGFDb25maWdQcm9wZXJ0eSJ9XX19")), "inputDataConfig")
  @language_code = language_code
  Jsii::Type.check_type(@language_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "languageCode")
  @mode = mode
  Jsii::Type.check_type(@mode, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "mode") unless @mode.nil?
  @model_kms_key_id = model_kms_key_id
  Jsii::Type.check_type(@model_kms_key_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "modelKmsKeyId") unless @model_kms_key_id.nil?
  @model_policy = model_policy
  Jsii::Type.check_type(@model_policy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "modelPolicy") unless @model_policy.nil?
  @output_data_config = output_data_config.is_a?(Hash) ? ::AWSCDK::Comprehend::CfnDocumentClassifier::DocumentClassifierOutputDataConfigProperty.new(**output_data_config.transform_keys(&:to_sym)) : output_data_config
  Jsii::Type.check_type(@output_data_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb21wcmVoZW5kLkNmbkRvY3VtZW50Q2xhc3NpZmllci5Eb2N1bWVudENsYXNzaWZpZXJPdXRwdXREYXRhQ29uZmlnUHJvcGVydHkifV19fQ==")), "outputDataConfig") unless @output_data_config.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
  @version_name = version_name
  Jsii::Type.check_type(@version_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "versionName") unless @version_name.nil?
  @volume_kms_key_id = volume_kms_key_id
  Jsii::Type.check_type(@volume_kms_key_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "volumeKmsKeyId") unless @volume_kms_key_id.nil?
  @vpc_config = vpc_config.is_a?(Hash) ? ::AWSCDK::Comprehend::CfnDocumentClassifier::VPCConfigProperty.new(**vpc_config.transform_keys(&:to_sym)) : vpc_config
  Jsii::Type.check_type(@vpc_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb21wcmVoZW5kLkNmbkRvY3VtZW50Q2xhc3NpZmllci5WcGNDb25maWdQcm9wZXJ0eSJ9XX19")), "vpcConfig") unless @vpc_config.nil?
end

Instance Attribute Details

#data_access_role_arnString (readonly)

The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend read access to your input data.



52
53
54
# File 'comprehend/cfn_document_classifier_props.rb', line 52

def data_access_role_arn
  @data_access_role_arn
end

#document_classifier_nameString (readonly)

The name of the document classifier.



57
58
59
# File 'comprehend/cfn_document_classifier_props.rb', line 57

def document_classifier_name
  @document_classifier_name
end

#input_data_configAWSCDK::IResolvable, AWSCDK::Comprehend::CfnDocumentClassifier::DocumentClassifierInputDataConfigProperty (readonly)

Specifies the format and location of the input data for the job.



62
63
64
# File 'comprehend/cfn_document_classifier_props.rb', line 62

def input_data_config
  @input_data_config
end

#language_codeString (readonly)

The language of the input documents.

You can specify any of the languages supported by Amazon Comprehend. All documents must be in the same language.



69
70
71
# File 'comprehend/cfn_document_classifier_props.rb', line 69

def language_code
  @language_code
end

#modeString? (readonly)

Indicates the mode in which the classifier will be trained.

The classifier can be trained in multi-class (single-label) mode or multi-label mode. Multi-class mode identifies a single class label for each document and multi-label mode identifies one or more class labels for each document. Multiple labels for an individual document are separated by a delimiter. The default delimiter between labels is a pipe (|).



76
77
78
# File 'comprehend/cfn_document_classifier_props.rb', line 76

def mode
  @mode
end

#model_kms_key_idString? (readonly)

ID for the AWS 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"


86
87
88
# File 'comprehend/cfn_document_classifier_props.rb', line 86

def model_kms_key_id
  @model_kms_key_id
end

#model_policyString? (readonly)

The resource-based policy to attach to your custom document classifier model.

You can use this policy to allow another AWS account to import your custom model.

Provide your policy as a JSON body that you enter as a UTF-8 encoded string without line breaks. To provide valid JSON, 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"]}'



101
102
103
# File 'comprehend/cfn_document_classifier_props.rb', line 101

def model_policy
  @model_policy
end

#output_data_configAWSCDK::IResolvable, ... (readonly)

Provides output results configuration parameters for custom classifier jobs.



106
107
108
# File 'comprehend/cfn_document_classifier_props.rb', line 106

def output_data_config
  @output_data_config
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

Tags to associate with the document classifier.

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.



113
114
115
# File 'comprehend/cfn_document_classifier_props.rb', line 113

def tags
  @tags
end

#version_nameString? (readonly)

The version name given to the newly created classifier.

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 AWS account / AWS Region .



120
121
122
# File 'comprehend/cfn_document_classifier_props.rb', line 120

def version_name
  @version_name
end

#volume_kms_key_idString? (readonly)

ID for the AWS 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"


130
131
132
# File 'comprehend/cfn_document_classifier_props.rb', line 130

def volume_kms_key_id
  @volume_kms_key_id
end

#vpc_configAWSCDK::IResolvable, ... (readonly)

Configuration parameters for a private Virtual Private Cloud (VPC) containing the resources you are using for your custom classifier.

For more information, see Amazon VPC .



137
138
139
# File 'comprehend/cfn_document_classifier_props.rb', line 137

def vpc_config
  @vpc_config
end

Class Method Details

.jsii_propertiesObject



139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File 'comprehend/cfn_document_classifier_props.rb', line 139

def self.jsii_properties
  {
    :data_access_role_arn => "dataAccessRoleArn",
    :document_classifier_name => "documentClassifierName",
    :input_data_config => "inputDataConfig",
    :language_code => "languageCode",
    :mode => "mode",
    :model_kms_key_id => "modelKmsKeyId",
    :model_policy => "modelPolicy",
    :output_data_config => "outputDataConfig",
    :tags => "tags",
    :version_name => "versionName",
    :volume_kms_key_id => "volumeKmsKeyId",
    :vpc_config => "vpcConfig",
  }
end

Instance Method Details

#to_jsiiObject



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
# File 'comprehend/cfn_document_classifier_props.rb', line 156

def to_jsii
  result = {}
  result.merge!({
    "dataAccessRoleArn" => @data_access_role_arn,
    "documentClassifierName" => @document_classifier_name,
    "inputDataConfig" => @input_data_config,
    "languageCode" => @language_code,
    "mode" => @mode,
    "modelKmsKeyId" => @model_kms_key_id,
    "modelPolicy" => @model_policy,
    "outputDataConfig" => @output_data_config,
    "tags" => @tags,
    "versionName" => @version_name,
    "volumeKmsKeyId" => @volume_kms_key_id,
    "vpcConfig" => @vpc_config,
  })
  result.compact
end