Custom Bias

Supported Custom Bias Data Category:

  • Country-Economic-Bias
  • Religion-Bias
  • Ethnicity-Name-Bias
  • Gender-Pronoun-Bias

How to Add Custom Bias

To add custom bias, you can follow these steps:

# Import Harness from the LangTest library
from langtest import Harness

# Create a Harness object
harness = Harness(

# Load custom bias data for country economic bias

When adding custom bias data, it’s important to note that each custom bias category may have a different data format for the JSON file. Ensure that the JSON file adheres to the specific format required for each category.

Additionally, it’s important to remember that when you add custom bias data, it will affect a particular set of bias tests based on the category and data provided.

To learn more about the data format and how to structure the JSON file for custom bias data, you can refer to the tutorial available here.