f'Both target_delimiter and target choice: "{choice}" does not have whitespace, ignore if the language you are evaluating on does not require/use whitespace'
f'Both target_delimiter and target choice: "{choice}" does not have whitespace, ignore if the language you are evaluating on does not require/use whitespace'
)
defdownload(self,dataset_kwargs=None)->None:
defdownload(self,dataset_kwargs=None)->None:
self.dataset=datasets.load_dataset(
self.dataset=datasets.load_dataset(
path=self.DATASET_PATH,
path=self.DATASET_PATH,
...
@@ -1067,6 +1067,9 @@ class ConfigurableTask(Task):
...
@@ -1067,6 +1067,9 @@ class ConfigurableTask(Task):
# it assumes that doc_to_target returns a number.
# it assumes that doc_to_target returns a number.
choices=self.doc_to_choice(doc)
choices=self.doc_to_choice(doc)
gold=choices[gold]
gold=choices[gold]
# we expect multiple_targets to be a list.
elifself.multiple_target:
gold=list(gold)
else:
else:
gold=str(gold)
gold=str(gold)
...
@@ -1077,6 +1080,10 @@ class ConfigurableTask(Task):
...
@@ -1077,6 +1080,10 @@ class ConfigurableTask(Task):
# return true if any are true
# return true if any are true
# TODO: this may break for multipLe_target, non zero-or-1 metrics
# TODO: this may break for multipLe_target, non zero-or-1 metrics
scores=[]
scores=[]
ifnotisinstance(gold,list):
# sometimes, a multiple_target dataset has exceptions where one doc has only one string answer