raiseNotImplementedError('SAT Analogies dataset is not provided. Follow instructions on https://aclweb.org/aclwiki/SAT_Analogy_Questions_(State_of_the_art) to locate.')
defhas_training_docs(self):
returnFalse
defhas_validation_docs(self):
returnFalse
defhas_test_docs(self):
returnTrue
deftraining_docs(self):
return[]
defvalidation_docs(self):
return[]
deftest_docs(self):
data=[]
withopen("data/sat/SAT-package-V3.txt","r")asf:
lines=f.read().splitlines()
record=[]
forlineinlines:
iflen(line)==0andrecord:
data.append(record)
record=[]
eliflen(line)>0andline[0]=='#':
continue
else:
record.append(line)
data.append(record)
docs=[]
forrecordindata:
source=record[-8]
query=record[-7]
choices=record[-6:-1]
answer_key=record[-1]
doc={
'source':source,
'query':query,
'choices':choices,
'answer_key':answer_key,
}
docs.append(doc)
returndocs
deffewshot_description(self):
# This format is ONLY for the purposes of deduplication. For the task evaluation, we'll need to find a new strategy,
# to meet the needs of this particular task.
return"first thing is to second thing as\nthird thing is to fourth thing\nfifth thing is to sixth thing\nseventh thing is to eighth thing\nninth thing is to tenth thing\neleventh thing is to twelfth thing\nanswer which is either a b c d or e"
defdoc_to_text(self,doc,include_target=True):
# SAT Analogies is currently only writing out full examples. Partial evaluation needs implementing.