-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdpr_result_process.py
76 lines (62 loc) · 4.35 KB
/
dpr_result_process.py
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import json
import pandas as pd
import corpus_subset
esr_corpus_dict = corpus_subset.get_corpus('ESR',1)
deep_learning_list = esr_corpus_dict['deep_learning_list']
question_answering_list = esr_corpus_dict ['question_answering_list']
computer_vision_list = esr_corpus_dict ['computer_vision_list']
information_geometry_list = esr_corpus_dict['information_geometry_list']
cryptography_list = esr_corpus_dict['cryptography_list']
dpr_deep_learning_data =json.load(open('./dpr_data/esr/esr_dpr_deep_learning.json', encoding = 'utf-8'))
dpr_deep_learning_list = [next(item for item in esr_corpus_dict['corpus'] if item['searchtext'] == doc).get('_key') for doc in dpr_deep_learning_data]
dpr_question_answering_data =json.load(open('./dpr_data/esr/esr_dpr_question_answering.json', encoding = 'utf-8'))
dpr_question_answering_list = [next(item for item in esr_corpus_dict['corpus'] if item['searchtext'] == doc).get('_key') for doc in dpr_question_answering_data]
dpr_computer_vision_data =json.load(open('./dpr_data/esr/esr_dpr_computer_vision.json', encoding = 'utf-8'))
dpr_computer_vision_list = [next(item for item in esr_corpus_dict['corpus'] if item['searchtext'] == doc).get('_key') for doc in dpr_computer_vision_data]
dpr_information_geometry_data =json.load(open('./dpr_data/esr/esr_dpr_information_geometry.json', encoding = 'utf-8'))
dpr_information_geometry_list = [next(item for item in esr_corpus_dict['corpus'] if item['searchtext'] == doc).get('_key') for doc in dpr_information_geometry_data]
dpr_cryptography_data =json.load(open('./dpr_data/esr/esr_dpr_cryptography.json', encoding = 'utf-8'))
dpr_cryptography_list = [next(item for item in esr_corpus_dict['corpus'] if item['searchtext'] == doc).get('_key') for doc in dpr_cryptography_data]
dpr_result = []
dpr_result.append({'keyword': 'deep learning' ,
'esr_hit': len(deep_learning_list),
'esr_list': deep_learning_list,
'common_hit':len(list(set(deep_learning_list)&set(dpr_deep_learning_list))),
'common_list': list(set(deep_learning_list)&set(dpr_deep_learning_list)),
'dpr_hits': len(dpr_deep_learning_list),
'dpr_list': dpr_deep_learning_list,
})
dpr_result.append({'keyword': 'question answering' ,
'esr_hit': len(question_answering_list),
'esr_list': question_answering_list,
'common_hit':len(list(set(question_answering_list)&set(dpr_question_answering_list))),
'common_list': list(set(question_answering_list)&set(dpr_question_answering_list)),
'dpr_hits': len(dpr_question_answering_list),
'dpr_list': dpr_question_answering_list,
})
dpr_result.append({'keyword': 'computer vision' ,
'esr_hit': len(computer_vision_list),
'esr_list': computer_vision_list,
'common_hit':len(list(set(computer_vision_list)&set(dpr_computer_vision_list))),
'common_list': list(set(computer_vision_list)&set(dpr_computer_vision_list)),
'dpr_hits': len(dpr_computer_vision_list),
'dpr_list': dpr_computer_vision_list,
})
dpr_result.append({'keyword': 'information geometry' ,
'esr_hit': len(information_geometry_list),
'esr_list': information_geometry_list,
'common_hit':len(list(set(information_geometry_list)&set(dpr_information_geometry_list))),
'common_list': list(set(information_geometry_list)&set(dpr_information_geometry_list)),
'dpr_hits': len(dpr_information_geometry_list),
'dpr_list': dpr_information_geometry_list,
})
dpr_result.append({'keyword': 'cryptography' ,
'esr_hit': len(cryptography_list),
'esr_list': cryptography_list,
'common_hit':len(list(set(cryptography_list)&set(dpr_cryptography_list))),
'common_list': list(set(cryptography_list)&set(dpr_cryptography_list)),
'dpr_hits': len(dpr_cryptography_list),
'dpr_list': dpr_cryptography_list,
})
df = pd.DataFrame(dpr_result)
df.to_excel("./result/dpr/esr_dpr_result.xlsx", index=False)