TextConfig: Config object to handle text features.

TextConfigR Documentation

Config object to handle text features.

Description

The SHAP analysis will break down longer text into chunks (e.g. tokens, sentences, or paragraphs ) and replace them with the strings specified in the baseline for that feature. The shap value of a chunk then captures how much replacing it affects the prediction.

Super class

sagemaker.common::ExplainabilityConfig -> TextConfig

Public fields

text_config

Text Config

Methods

Public methods

Inherited methods

Method new()

Initializes a text configuration.

Usage
TextConfig$new(granularity, language)
Arguments
granularity

(str): Determines the granularity in which text features are broken down to, can be "token", "sentence", or "paragraph". Shap values are computed for these units.

language

(str): Specifies the language of the text features, can be "chinese", "danish", "dutch", "english", "french", "german", "greek", "italian", "japanese", "lithuanian", "multi-language", "norwegian bokmal", "polish", "portuguese", "romanian", "russian", "spanish", "afrikaans", "albanian", "arabic", "armenian", "basque", "bengali", "bulgarian", "catalan", "croatian", "czech", "estonian", "finnish", "gujarati", "hebrew", "hindi", "hungarian", "icelandic", "indonesian", "irish", "kannada", "kyrgyz", "latvian", "ligurian", "luxembourgish", "macedonian", "malayalam", "marathi", "nepali", "persian", "sanskrit", "serbian", "setswana", "sinhala", "slovak", "slovenian", "swedish", "tagalog", "tamil", "tatar", "telugu", "thai", "turkish", "ukrainian", "urdu", "vietnamese", "yoruba". Use "multi-language" for a mix of mulitple languages.


Method get_text_config()

Returns part of an analysis config dictionary.

Usage
TextConfig$get_text_config()

Method clone()

The objects of this class are cloneable with this method.

Usage
TextConfig$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.


DyfanJones/sagemaker-r-common documentation built on June 14, 2022, 10:31 p.m.