Class: AWSCDK::Comprehend::CfnDocumentClassifier::DocumentClassifierInputDataConfigProperty

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

Overview

The input properties for training a document classifier.

For more information on how the input file is formatted, see Preparing training data in the Comprehend Developer Guide.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(augmented_manifests: nil, data_format: nil, document_reader_config: nil, documents: nil, document_type: nil, label_delimiter: nil, s3_uri: nil, test_s3_uri: nil) ⇒ DocumentClassifierInputDataConfigProperty

Returns a new instance of DocumentClassifierInputDataConfigProperty.

Parameters:



788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
# File 'comprehend/cfn_document_classifier.rb', line 788

def initialize(augmented_manifests: nil, data_format: nil, document_reader_config: nil, documents: nil, document_type: nil, label_delimiter: nil, s3_uri: nil, test_s3_uri: nil)
  @augmented_manifests = augmented_manifests
  Jsii::Type.check_type(@augmented_manifests, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfY29tcHJlaGVuZC5DZm5Eb2N1bWVudENsYXNzaWZpZXIuQXVnbWVudGVkTWFuaWZlc3RzTGlzdEl0ZW1Qcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "augmentedManifests") unless @augmented_manifests.nil?
  @data_format = data_format
  Jsii::Type.check_type(@data_format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dataFormat") unless @data_format.nil?
  @document_reader_config = document_reader_config.is_a?(Hash) ? ::AWSCDK::Comprehend::CfnDocumentClassifier::DocumentReaderConfigProperty.new(**document_reader_config.transform_keys(&:to_sym)) : document_reader_config
  Jsii::Type.check_type(@document_reader_config, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb21wcmVoZW5kLkNmbkRvY3VtZW50Q2xhc3NpZmllci5Eb2N1bWVudFJlYWRlckNvbmZpZ1Byb3BlcnR5In1dfX0=")), "documentReaderConfig") unless @document_reader_config.nil?
  @documents = documents.is_a?(Hash) ? ::AWSCDK::Comprehend::CfnDocumentClassifier::DocumentClassifierDocumentsProperty.new(**documents.transform_keys(&:to_sym)) : documents
  Jsii::Type.check_type(@documents, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19jb21wcmVoZW5kLkNmbkRvY3VtZW50Q2xhc3NpZmllci5Eb2N1bWVudENsYXNzaWZpZXJEb2N1bWVudHNQcm9wZXJ0eSJ9XX19")), "documents") unless @documents.nil?
  @document_type = document_type
  Jsii::Type.check_type(@document_type, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "documentType") unless @document_type.nil?
  @label_delimiter = label_delimiter
  Jsii::Type.check_type(@label_delimiter, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "labelDelimiter") unless @label_delimiter.nil?
  @s3_uri = s3_uri
  Jsii::Type.check_type(@s3_uri, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "s3Uri") unless @s3_uri.nil?
  @test_s3_uri = test_s3_uri
  Jsii::Type.check_type(@test_s3_uri, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "testS3Uri") unless @test_s3_uri.nil?
end

Instance Attribute Details

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

A list of augmented manifest files that provide training data for your custom model.

An augmented manifest file is a labeled dataset that is produced by Amazon SageMaker Ground Truth.

This parameter is required if you set DataFormat to AUGMENTED_MANIFEST .



815
816
817
# File 'comprehend/cfn_document_classifier.rb', line 815

def augmented_manifests
  @augmented_manifests
end

#data_formatString? (readonly)

The format of your training data:.

  • COMPREHEND_CSV : A two-column CSV file, where labels are provided in the first column, and documents are provided in the second. If you use this value, you must provide the S3Uri parameter in your request.
  • AUGMENTED_MANIFEST : A labeled dataset that is produced by Amazon SageMaker Ground Truth. This file is in JSON lines format. Each line is a complete JSON object that contains a training document and its associated labels.

If you use this value, you must provide the AugmentedManifests parameter in your request.

If you don't specify a value, Amazon Comprehend uses COMPREHEND_CSV as the default.



827
828
829
# File 'comprehend/cfn_document_classifier.rb', line 827

def data_format
  @data_format
end

#document_typeString? (readonly)

The type of input documents for training the model.

Provide plain-text documents to create a plain-text model, and provide semi-structured documents to create a native document model.



844
845
846
# File 'comprehend/cfn_document_classifier.rb', line 844

def document_type
  @document_type
end

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

The S3 location of the training documents.

This parameter is required in a request to create a native document model.



837
838
839
# File 'comprehend/cfn_document_classifier.rb', line 837

def documents
  @documents
end

#label_delimiterString? (readonly)

Indicates the delimiter used to separate each label for training a multi-label classifier.

The default delimiter between labels is a pipe (|). You can use a different character as a delimiter (if it's an allowed character) by specifying it under Delimiter for labels. If the training documents use a delimiter other than the default or the delimiter you specify, the labels on that line will be combined to make a single unique label, such as LABELLABELLABEL.



851
852
853
# File 'comprehend/cfn_document_classifier.rb', line 851

def label_delimiter
  @label_delimiter
end

#s3_uriString? (readonly)

The Amazon S3 URI for the input data.

The S3 bucket must be in the same Region as the API endpoint that you are calling. The URI can point to a single input file or it can provide the prefix for a collection of input files.

For example, if you use the URI S3://bucketName/prefix , if the prefix is a single file, Amazon Comprehend uses that file as input. If more than one file begins with the prefix, Amazon Comprehend uses all of them as input.

This parameter is required if you set DataFormat to COMPREHEND_CSV .



862
863
864
# File 'comprehend/cfn_document_classifier.rb', line 862

def s3_uri
  @s3_uri
end

#test_s3_uriString? (readonly)

This specifies the Amazon S3 location that contains the test annotations for the document classifier.

The URI must be in the same AWS Region as the API endpoint that you are calling.



869
870
871
# File 'comprehend/cfn_document_classifier.rb', line 869

def test_s3_uri
  @test_s3_uri
end

Class Method Details

.jsii_propertiesObject



871
872
873
874
875
876
877
878
879
880
881
882
# File 'comprehend/cfn_document_classifier.rb', line 871

def self.jsii_properties
  {
    :augmented_manifests => "augmentedManifests",
    :data_format => "dataFormat",
    :document_reader_config => "documentReaderConfig",
    :documents => "documents",
    :document_type => "documentType",
    :label_delimiter => "labelDelimiter",
    :s3_uri => "s3Uri",
    :test_s3_uri => "testS3Uri",
  }
end

Instance Method Details

#to_jsiiObject



884
885
886
887
888
889
890
891
892
893
894
895
896
897
# File 'comprehend/cfn_document_classifier.rb', line 884

def to_jsii
  result = {}
  result.merge!({
    "augmentedManifests" => @augmented_manifests,
    "dataFormat" => @data_format,
    "documentReaderConfig" => @document_reader_config,
    "documents" => @documents,
    "documentType" => @document_type,
    "labelDelimiter" => @label_delimiter,
    "s3Uri" => @s3_uri,
    "testS3Uri" => @test_s3_uri,
  })
  result.compact
end