-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
32 lines (27 loc) · 715 Bytes
/
Copy pathmain.py
File metadata and controls
32 lines (27 loc) · 715 Bytes
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
#pip install chatterbot
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
bot = ChatBot("BOT")
conversation = [
'Hello',
'My name is bot. I am created by Raghav Rathi',
'I like ice-cream',
'I am doing great, what about you ?',
'Oh great to hear that',
'Sorry to hear that',
'I live in your computer',
'I am just a week year old',
'I speak only in english language',
'I have no idea how I am created, must be some genius',
'I like beyonce',
'I love competitive programming',
'Thank you' ]
trainer = ListTrainer(bot)
trainer.train(conversation)
while True:
print("You: ")
ques = input()
if ques == 'exit':
break
ans = bot.get_response(ques)
print("Bot: ", ans)