Update app.py
Browse files
app.py
CHANGED
|
@@ -6,19 +6,23 @@ from chatterbot.trainers import ListTrainer
|
|
| 6 |
|
| 7 |
chatbot = ChatBot("Chatpot",storage_adapter='chatterbot.storage.SQLStorageAdapter',database_uri = 'sqlite:///database.sqlite3')
|
| 8 |
|
| 9 |
-
|
| 10 |
|
| 11 |
|
| 12 |
file1 = open("dialogs.txt", "r")
|
| 13 |
training_data = file1.read().splitlines()
|
| 14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
print(training_data)
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
def greet(name):
|
| 20 |
text = chatbot.get_response(name)
|
| 21 |
-
return
|
| 22 |
|
| 23 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 24 |
iface.launch()
|
|
|
|
| 6 |
|
| 7 |
chatbot = ChatBot("Chatpot",storage_adapter='chatterbot.storage.SQLStorageAdapter',database_uri = 'sqlite:///database.sqlite3')
|
| 8 |
|
| 9 |
+
|
| 10 |
|
| 11 |
|
| 12 |
file1 = open("dialogs.txt", "r")
|
| 13 |
training_data = file1.read().splitlines()
|
| 14 |
+
|
| 15 |
+
|
| 16 |
+
#trainer = ListTrainer(chatbot)
|
| 17 |
+
#trainer.train(training_data)
|
| 18 |
+
|
| 19 |
print(training_data)
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
def greet(name):
|
| 24 |
text = chatbot.get_response(name)
|
| 25 |
+
return str(text)
|
| 26 |
|
| 27 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 28 |
iface.launch()
|