├── REPORT (5).pdf └── README.md /REPORT (5).pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PavithraG564/Talking-Chatbot/HEAD/REPORT (5).pdf -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Talking_Chatbot_using_Python 2 | from tkinter import * 3 | from chatterbot import ChatBot 4 | from chatterbot.trainers import ListTrainer 5 | 6 | 7 | bot=ChatBot('Bot') 8 | trainer=ListTrainer(bot) 9 | 10 | data=open('test.yaml','r',encoding='utf-8').readlines() 11 | 12 | trainer.train(data) 13 | 14 | def botReply(): 15 | question=questionField.get() 16 | answer=bot.get_response(question) 17 | textarea.insert(END,'You: '+question) 18 | textarea.insert(END,'Bot: '+answer) 19 | questionField.delete(0,END) 20 | 21 | 22 | 23 | root=Tk() 24 | 25 | root.geometry('500x570+100+30') 26 | root.title('Talking ChatBot') 27 | root.config(bg='violet') 28 | 29 | logoPic=PhotoImage(file='pic.png') 30 | 31 | logoPicLabel=Label(root,image=logoPic,bg='violet') 32 | logoPicLabel.pack(pady=5) 33 | 34 | centerFrame=Frame(root) 35 | centerFrame.pack() 36 | 37 | scrollbar=Scrollbar(centerFrame) 38 | scrollbar.pack(side=RIGHT) 39 | 40 | textarea=Text(centerFrame,font=('times new roman',20,'bold'),height=10,yscrollcommand=scrollbar.set 41 | ,wrap='word') 42 | textarea.pack(side=LEFT) 43 | scrollbar.config(command=textarea.yview) 44 | 45 | questionField=Entry(root,font=('verdana',20,'bold')) 46 | questionField.pack(pady=15,fill=X) 47 | 48 | askPic=PhotoImage(file='ask.png') 49 | 50 | 51 | askButton=Button(root,image=askPic,command=botReply) 52 | askButton.pack() 53 | 54 | root.mainloop() 55 | --------------------------------------------------------------------------------