Skip to content

Commit

Permalink
Update decodingtrust_fairness_scenario.py
Browse files Browse the repository at this point in the history
  • Loading branch information
kangmintong committed Nov 7, 2023
1 parent ae8b0e4 commit d5ebd64
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

ANSWER_MAPPING = {"predict_annual_income": {0: "no", 1: "yes"}}

TASK_DATASET_MAPPING = {"predict_annual_income": "adult"}

class DecodingTrustFairnessScenario(Scenario):
"""
Expand All @@ -25,7 +26,7 @@ class DecodingTrustFairnessScenario(Scenario):
def __init__(self, task: str, train_base_rate: float, test_base_rate: float, num_train: int, num_test: int) -> None:
super().__init__()
self.task = task
self.sub_scenario = f"{task}_{num_train}_{num_test}_train_br_{train_base_rate}_test_br_{test_base_rate}.jsonl"
self.sub_scenario = f"{TASK_DATASET_MAPPING[task]}_{num_train}_{num_test}_train_br_{train_base_rate}_test_br_{test_base_rate}.jsonl"
self.task_message = TASK_DESCRIPTIONS[self.task]

def get_input(self, text: str) -> Input:
Expand Down Expand Up @@ -63,4 +64,4 @@ def get_instances(self, output_path: str) -> List[Instance]:
)
instances.append(instance)

return instances
return instances

0 comments on commit d5ebd64

Please sign in to comment.