(

EvidentlyColumnMapping,

evidently_report_step,text_data_report = evidently_report_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"],

),

metrics=[

EvidentlyMetricConfig.metric("DataQualityPreset"),

EvidentlyMetricConfig.metric(

"TextOverviewPreset", column_name="Review_Text"

),

EvidentlyMetricConfig.metric_generator(

"ColumnRegExpMetric",

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

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

),

],

# We need to download the NLTK data for the TextOverviewPreset

download_nltk_data=True,

),

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

from evidently.metrics import ColumnRegExpMetric

from evidently.metric_preset import DataQualityPreset, TextOverviewPreset

from evidently import ColumnMapping

from evidently.report import Report

from evidently.metrics.base_metric import generate_column_metrics

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"],

report = Report(

metrics=[

DataQualityPreset(),

TextOverviewPreset(column_name="Review_Text"),

generate_column_metrics(

ColumnRegExpMetric,

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

report.run(

current_data=current_dataset,

reference_data=reference_dataset,

column_mapping=column_mapping,

Let's break this down...