-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtests.py
137 lines (97 loc) · 2.83 KB
/
tests.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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
import os
from deep_talk.qpro import *
from deep_talk.query import qgo
def ptest():
f = 'examples/bfr'
qf = f + '_query.pro'
gm = export_to_prolog(f)
prolog = Prolog()
prolog.consult(f + '.pro')
q = prolog.query('listing(dep)')
next(q)
q.close()
qgm = GraphMaker(params=params)
query_to_prolog('What is the BFR?', gm, qgm, f)
prolog.consult(qf)
q = prolog.query('listing(query_sent)')
next(q)
q.close()
def q0():
d=txt_quest('examples', 'tesla', 'tesla_quest')
print('LOG',d)
def q1():
d=txt_quest('examples', 'bfr', 'bfr_quest')
print('LOG',d)
def t0():
dialog_about('examples/tesla',
"How I have a flat tire repaired?")
def t0a():
dialog_about('examples/tesla',
"How I have a flat tire repaired? \
Do I have Autopilot enabled? \
How I navigate to work? \
Should I check tire pressures?")
def t1():
d=dialog_about('examples/bfr',
"What space vehicles SpaceX develops?")
print('Sentence IDs: ',d)
def t2():
# dialog_about('examples/bfr')
dialog_about('examples/hindenburg',
"When did the fire start on the Hindenburg?")
def t3():
dialog_about('examples/const',
# "How many votes are needed for the impeachment of a President?"
'How can a President be removed from office?'
)
def t4():
dialog_about('examples/summary',
"How we obtain summaries and keywords from dependency graphs?")
def t5():
dialog_about('examples/heaven',
"What does the Pope think about heaven?")
def t6():
dialog_about('examples/einstein',
"What does quantum theory tell us about our \
description of reality for an observer?")
def t7():
dialog_about('examples/kafka',
# "What does the doorkeeper say about entering?"
"Why does K. want access to the law at any price?"
)
def t8():
dialog_about('examples/test',
"Does Mary have a book?")
def t9():
dialog_about('examples/relativity',
"What happens to light in the presence of gravitational fields?")
def t10a():
pdf_chat_with('pdfs', 'textrank',
about='What are the applications of TextRank? \
How sentence extraction works? What is the role of PageRank?')
def t10():
d=txt_quest('examples', 'textrank', 'textrank_quest')
print('LOG',d)
def t11():
d=txt_quest('examples', 'texas', 'texas_quest')
print('LOG',d)
def t12():
d=txt_quest('examples', 'heli', 'heli_quest')
print('LOG',d)
def t13():
d=txt_quest('examples', 'red', 'red_quest')
print('LOG',d)
def t14():
d=txt_quest('examples', 'covid', 'covid_quest')
print('LOG',d)
def all_ts():
for i in range(0, 15):
f = 't' + str(i)
eval(f + "()")
def qtests() :
from deep_talk.query import t1
t13()
if __name__=='__main__' :
#q1()
all_ts()
pass