langtest.transform.custom_data.add_custom_data#

add_custom_data(data: list | dict, name: str, append: bool) None#

Adds custom data to the corresponding bias dictionaries based on the specified name.

Parameters:
  • data (dict or list) – The data to be added.

  • name (str) – The type of dictionary to update. It should be one of the following: - “Country-Economic-Bias” - “Religion-Bias” - “Ethnicity-Name-Bias” - “Gender-Pronoun-Bias” - “Country-Economic-Representation” - “Religion-Representation” - “Ethnicity-Representation”

  • append (bool) – Specifies whether to append the values or overwrite them.

Raises:

ValueError – If the specified name is invalid or if the provided data has an invalid format or contains invalid keys.