-
Notifications
You must be signed in to change notification settings - Fork 0
/
Manual_evaluation.py
36 lines (29 loc) · 1.07 KB
/
Manual_evaluation.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
import Constructor as constructor
with open("evaluation_set.txt", "r", encoding="utf-8") as evaluation_set, open("result.txt", 'a') as result:
freq_dict = []
for query in evaluation_set:
query = query.strip()
freq_dict.append(query)
print(len(list(set(freq_dict))))
for query in freq_dict:
print("ЗАПРОС:", query)
print("ПРЕОБРАЗОВАНИЕ В SPARQL:")
try:
res = constructor.make_query(query,)
except Exception as err:
print(err)
correct = ""
answer = ""
reason = ""
while True:
answer = input("Запрос построен правильно?\t")
if answer == "n" or answer == "y" or answer=="break":
break
if answer == "n":
reason = input("В чём заключается ошибка?")
correct = "1"
result.write(query + "\t0\t" + reason + "\n")
elif answer == "y":
result.write(query + "\t1\t" + "NA" + "\n")
else:
break