Text Quality Score (Text SQS)

Compare the quality of two text datasets

To learn about the parts of the report, please see the Synthetic Text Data Quality page.

Notebook

Use this notebook as a template for how to use the text quality score SDK.

SDK

The Gretel SDK provides Python classes specifically to run reports. The TextQualityReport() class uses evaluate with text task type generate a Text Quality Report. The most basic usage is below:

from gretel_client.evaluation.text_quality_report import TextQualityReport

# NOTE: In this example, the text data to compare has the header "email_text" 
synthetic_data = "synthetic.csv"
training_data = "training.csv"

synthetic_df = pd.read_csv(synthetic_data)
training_df = pd.read_csv(training_data)

report = TextQualityReport(data_source=synthetic_df,
                           ref_data=training_df,
                           target="email_text",
                           record_count=len(synthetic_df))

report.run() # this will wait for the job to finish

# This will return the full report JSON details
report.as_dict

# This will return the full HTML contents of the report
report.as_html

Last updated