-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.py.save
89 lines (28 loc) · 980 Bytes
/
bot.py.save
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
tterbot import ChatBot
from chatterbot.trainers import ListTrainer
import sqlite3
#db = MySqldb.connect("localhost", "root", "toor", "DBMSFile")
#conn = sqlite3.connect(DBMSFile)
chatbot = ChatBot('Divya', storage_adapter='chatterbot.storage.SQLStorageAdapter',
input_adapter= 'chatterbot.input.TerminalAdapter',
output_adapter= 'chatterbot.output.TerminalAdapter',
# logic_adapters=['chatterbot.logic.BestMatch'],
database='./database.sqlite3')
conversation= (
"Hello",
"hi!",
"how are you?",
"I'm good"
);
response = bot.get_respoonse(conversation)
print(response)
]
chatbot.set_trainer(ListTrainer)
chatbot.train(conversation)
print("User says: ")
while True:
try:
response = chatbot.get_response(conversation)
except(KeyboardInterrupt, EOFError, TimeoutError ):
break
#chatbot.get_response("Helloo")