from typing import Optional, Union from configs.fs import FSConfig class SuperGLUEConfig(FSConfig): @property def id_key(self) -> str: return "idx" @property def target_key(self) -> str: return "label" @property def train_file(self) -> str: return "train.jsonl" @property def validation_file(self) -> str: return "val.jsonl" @property def test_file(self) -> str: return "test.jsonl" class BoolQConfig(SuperGLUEConfig): @property def source_key(self) -> str: return "passage" @property def question_key(self) -> Union[str, None]: return "question" class RTEConfig(SuperGLUEConfig): # TODO HACK - we treat premise == source, hypothesis == question @property def source_key(self) -> str: return "premise" @property def question_key(self) -> Union[str, None]: return "hypothesis"