File size: 449 Bytes
e641e34
f48d575
 
5b6bdce
e641e34
cd7f54a
 
5b6bdce
 
 
 
 
 
 
cd7f54a
e641e34
cd7f54a
b4f050c
e641e34
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gradio as gr
from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
from chatterbot.trainers import ChatterBotCorpusTrainer

chatbot = ChatBot("Chatpot")

trainer = ChatterBotCorpusTrainer(chatbot)

trainer.train(
    "chatterbot.corpus.english"
)



def greet(name):
    text = chatbot.get_response(name)
    return "Hello " + str(text) + "!!"

iface = gr.Interface(fn=greet, inputs="text", outputs="text")
iface.launch()