-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbasic_chatbot.py
More file actions
35 lines (31 loc) · 865 Bytes
/
Copy pathbasic_chatbot.py
File metadata and controls
35 lines (31 loc) · 865 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
33
34
35
from chatterbot import ChatBot
bot = ChatBot(
'Buddy',
logic_adapters=[
'chatterbot.logic.BestMatch',
'chatterbot.logic.TimeLogicAdapter'],
)
from chatterbot.trainers import ListTrainer
trainer = ListTrainer(bot)
trainer.train([
'Hi',
'Hello',
'I need your assistance regarding my health',
'Please, Provide me with your symptoms',
'I have a complaint.',
'Please elaborate, your concern',
'How long it will take to cure the illness ?',
'An order takes 3-5 days to get recovered.',
'Okay Thanks',
'No Problem! Have a Good Day!'
])
name=input("Enter Your Name: ")
print("Welcome to the Bot Service! Let me know how can I help you?")
while True:
request=input(name+':')
if request=='Bye' or request =='bye':
print('Bot: Bye')
break
else:
response=bot.get_response(request)
print('Bot:',response)