Class: AWSCDK::Sagemaker::CfnEndpointConfig::ClarifyTextConfigProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
sagemaker/cfn_endpoint_config.rb

Overview

A parameter used to configure the SageMaker Clarify explainer to treat text features as text so that explanations are provided for individual units of text.

Required only for natural language processing (NLP) explainability.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(granularity:, language:) ⇒ ClarifyTextConfigProperty

Returns a new instance of ClarifyTextConfigProperty.

Parameters:

  • granularity (String)

    The unit of granularity for the analysis of text features.

  • language (String)

    Specifies the language of the text features in ISO 639-1 or ISO 639-3 code of a supported language.



1328
1329
1330
1331
1332
1333
# File 'sagemaker/cfn_endpoint_config.rb', line 1328

def initialize(granularity:, language:)
  @granularity = granularity
  Jsii::Type.check_type(@granularity, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "granularity")
  @language = language
  Jsii::Type.check_type(@language, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "language")
end

Instance Attribute Details

#granularityString (readonly)

The unit of granularity for the analysis of text features.

For example, if the unit is 'token' , then each token (like a word in English) of the text is treated as a feature. SHAP values are computed for each unit/feature.



1341
1342
1343
# File 'sagemaker/cfn_endpoint_config.rb', line 1341

def granularity
  @granularity
end

#languageString (readonly)

Specifies the language of the text features in ISO 639-1 or ISO 639-3 code of a supported language.

For a mix of multiple languages, use code 'xx' .



1348
1349
1350
# File 'sagemaker/cfn_endpoint_config.rb', line 1348

def language
  @language
end

Class Method Details

.jsii_propertiesObject



1350
1351
1352
1353
1354
1355
# File 'sagemaker/cfn_endpoint_config.rb', line 1350

def self.jsii_properties
  {
    :granularity => "granularity",
    :language => "language",
  }
end

Instance Method Details

#to_jsiiObject



1357
1358
1359
1360
1361
1362
1363
1364
# File 'sagemaker/cfn_endpoint_config.rb', line 1357

def to_jsii
  result = {}
  result.merge!({
    "granularity" => @granularity,
    "language" => @language,
  })
  result.compact
end