Repository navigation
Expand file tree
/
Copy pathquery_map.py
More file actions
58 lines (38 loc) · 1.73 KB
/
Copy pathquery_map.py
File metadata and controls
58 lines (38 loc) · 1.73 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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Author: Xiaoy Li
# description:
# query_map.py
# ---------------------------------------------
# query collections for different dataset
# ---------------------------------------------
import os
import json
root_path = "/".join(os.path.realpath(__file__).split("/")[:-2])
path_en_ace2004 = os.path.join(root_path, "../../data_preprocess/queries/en_ace04.json")
path_en_ace2005 = os.path.join(root_path, "../../data_preprocess/queries/en_ace05.json")
path_en_conll03 = os.path.join(root_path, "../../data_preprocess/queries/en_conll03.json")
path_en_genia = os.path.join(root_path, "../../data_preprocess/queries/en_genia.json")
path_en_ontonotes5 = os.path.join(root_path, "../../data_preprocess/queries/en_ontonotes5.json")
path_zh_msra = os.path.join(root_path, "../../data_preprocess/queries/zh_msra.json")
path_zh_ontonotes4 = os.path.join(root_path, "../../data_preprocess/queries/zh_ontonotes4.json")
def load_query_map(query_map_path):
with open(query_map_path, "r", encoding='utf-8') as f:
query_map = json.load(f)
return query_map
query_en_ace2004 = load_query_map(path_en_ace2004)
query_en_ace2005 = load_query_map(path_en_ace2005)
query_en_conll03 = load_query_map(path_en_conll03)
query_en_genia = load_query_map(path_en_genia)
query_en_ontonotes5 = load_query_map(path_en_ontonotes5)
query_zh_msra = load_query_map(path_zh_msra)
query_zh_ontonotes4 = load_query_map(path_zh_ontonotes4)
queries_for_dataset = {
"en_ace2004": query_en_ace2004,
"en_ace2005": query_en_ace2005,
"en_conll03": query_en_conll03,
"en_ontonotes5": query_en_ontonotes5,
"en_genia": query_en_genia,
"zh_ontonotes4": query_zh_ontonotes4,
"zh_msra": query_zh_msra
}