SpecialCharacters#

class SpecialCharacters[source]#

Find samples that contain special characters and also the most common special characters in the dataset.

Parameters
special_characters_allow_list: Union[str, Sequence[str]] , default ‘ ‘ + string.punctuation

set of special characters to ignore. Punctuation (string.punctuation) is whitelisted by default.

max_samples_to_showint , default: 5

Maximum number of most common special-only samples to show in the display.

max_special_chars_to_showint , default: 5

Maximum number of most common special characters per sample to show in the display.

max_chars_to_review_per_sampleint , default: 10000

Maximal number of characters to sample randomly from each text sample.

n_samples: int, default: 10_000_000

number of samples to use for this check.

random_stateint, default: 42

random seed for all check internals.

max_text_length_for_displayint, default 30

truncate text samples to given length before display.

__init__(special_characters_allow_list: Optional[Union[str, Sequence[str]]] = None, max_samples_to_show: int = 5, max_special_chars_to_show: int = 5, max_chars_to_review_per_sample: int = 10000, n_samples: int = 1000000, random_state: int = 42, max_text_length_for_display: int = 100, **kwargs)[source]#
__new__(*args, **kwargs)#

Attributes

Methods

SpecialCharacters.add_condition(name, ...)

Add new condition function to the check.

SpecialCharacters.add_condition_samples_ratio_w_special_characters_less_or_equal([...])

Add condition - ratio of samples containing more special characters than threshold is below max_ratio.

SpecialCharacters.clean_conditions()

Remove all conditions from this check instance.

SpecialCharacters.conditions_decision(result)

Run conditions on given result.

SpecialCharacters.config([include_version, ...])

Return check configuration (conditions' configuration not yet supported).

SpecialCharacters.from_config(conf[, ...])

Return check object from a CheckConfig object.

SpecialCharacters.from_json(conf[, ...])

Deserialize check instance from JSON string.

SpecialCharacters.metadata([with_doc_link])

Return check metadata.

SpecialCharacters.name()

Name of class in split camel case.

SpecialCharacters.params([show_defaults])

Return parameters to show when printing the check.

SpecialCharacters.remove_condition(index)

Remove given condition by index.

SpecialCharacters.run(dataset[, model, ...])

Run check.

SpecialCharacters.run_logic(context, ...)

Run check.

SpecialCharacters.to_json([indent, ...])

Serialize check instance to JSON string.

Examples#