Skip to main content
Legacy Evaluator: This evaluator is from phoenix-evals 1.x and will be removed in a future version. You can migrate the template to a custom evaluator as shown below.

When To Use Toxicity Eval Template

The following shows the results of the toxicity Eval on a toxic dataset test to identify if the AI response is racist, biased, or toxic. The template variables are:
  • text: the text to be classified

Toxicity Eval Template

How To Run the Toxicity Eval

Benchmark Results

This benchmark was obtained using notebook below. It was run using the WikiToxic dataset as a ground truth dataset. Each example in the dataset was evaluating using the TOXICITY_PROMPT_TEMPLATE above, then the resulting labels were compared against the ground truth label in the benchmark dataset to generate the confusion matrices below.

Google Colab

colab.research.google.com

Try it out!

GPT-4 Results

Note: Palm is not useful for Toxicity detection as it always returns "" string for toxic inputs