t (

EvidentlyColumnMapping,

evidently_test_step,from zenml.integrations.evidently.tests import EvidentlyTestConfig

text_data_test = evidently_test_step.with_options(

parameters=dict(

column_mapping=EvidentlyColumnMapping(

target="Rating",

numerical_features=["Age", "Positive_Feedback_Count"],

categorical_features=[

"Division_Name",

"Department_Name",

"Class_Name",

],

text_features=["Review_Text", "Title"],

),

tests=[

EvidentlyTestConfig.test("DataQualityTestPreset"),

EvidentlyTestConfig.test_generator(

"TestColumnRegExp",

columns=["Review_Text", "Title"],

reg_exp=r"[A-Z][A-Za-z0-9 ]*",

),

],

# We need to download the NLTK data for the TestColumnRegExp test

download_nltk_data=True,

),

The configuration shown in the example is the equivalent of running the following Evidently code inside the step:

from evidently.tests import TestColumnRegExp

from evidently.test_preset import DataQualityTestPreset

from evidently import ColumnMapping

from evidently.test_suite import TestSuite

from evidently.tests.base_test import generate_column_tests

import nltk

nltk.download("words")

nltk.download("wordnet")

nltk.download("omw-1.4")

column_mapping = ColumnMapping(

target="Rating",

numerical_features=["Age", "Positive_Feedback_Count"],

categorical_features=[

"Division_Name",

"Department_Name",

"Class_Name",

],

text_features=["Review_Text", "Title"],

test_suite = TestSuite(

tests=[

DataQualityTestPreset(),

generate_column_tests(

TestColumnRegExp,

columns=["Review_Text", "Title"],

parameters={"reg_exp": r"[A-Z][A-Za-z0-9 ]*"}

# The datasets are those that are passed to the Evidently step

# as input artifacts

test_suite.run(

current_data=current_dataset,

reference_data=reference_dataset,

column_mapping=column_mapping,

Let's break this down...

We configure the evidently_test_step using parameters that you would normally pass to the Evidently TestSuite object to configure and run an Evidently test suite . It consists of the following fields: