-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloadData.py
More file actions
59 lines (55 loc) · 1.6 KB
/
loadData.py
File metadata and controls
59 lines (55 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from benchmarkLoader.tableQALoader import TableQADataset
from benchmarkLoader.tableFVLoader import TableFVDataset
from benchmarkLoader.retrievalLoader import RetrievalDataset
from benchmarkLoader.cpaLoader import CPADataset
from benchmarkLoader.ctaLoader import CTADataset
from benchmarkLoader.emLoader import EMDataset
import re
def extractAnswer(text:str)->str:
patt = r'answer:\s*([A-F]+)'
grps = re.findall(patt, text, re.IGNORECASE)
if grps:
return grps[-1].upper()
return ''
if __name__ == '__main__':
qads = TableQADataset('16k', True)
fvds = TableFVDataset('16k', True)
retds = RetrievalDataset('16k', True)
cpads = CPADataset('16k', True)
ctads = CTADataset('16k', True)
emds = EMDataset()
# print('qads', len(qads))
# print('fvds', len(fvds))
# print('retds', len(retds))
# print('cpads', len(cpads))
# print('ctads', len(ctads))
# print('emds', len(emds))
# for question, rightChoice in qads:
# print(question)
# print(rightChoice)
# break
#
# for question, rightChoice in fvds:
# print(question)
# print(rightChoice)
# break
#
# for question, rightChoice in retds:
# print(question)
# print(rightChoice)
# break
#
# for question, rightChoice in cpads:
# print(question)
# print(rightChoice)
# break
#
# for question, rightChoice in ctads:
# print(question)
# print(rightChoice)
# break
#
for question, rightChoice in emds:
print(question)
print(rightChoice)
break