ChatterBot icon indicating copy to clipboard operation
ChatterBot copied to clipboard

How to fix Chatterbot not responsed. Please...

Open intercontoni opened this issue 4 years ago • 1 comments

chatbot recibe text but not response... when I see passanger.logs I have this...

The passanger.logs

text/plain errores.log ( ASCII text, with CRLF, CR, LF line terminators )
App 1498536 output: /opt/passenger-5.3.7-9.el7.cloudlinux/src/helper-scripts/wsgi-loader.py:26: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
App 1498536 output:   import sys, os, io, re, imp, threading, signal, traceback, socket, select, struct, logging, errno

App 1498536 output: 
List Trainer: [####################] 100%

App 1498536 output: 
Training greetings.yml: [####################] 100%

App 1498536 output: 
Training trivia.yml: [####################] 100%
App 1498536 output: 

The app.py

import os
import sys
from flask import Flask, render_template, request
from sys import version
from chatterbot import ChatBot
from chatterbot.trainers import ChatterBotCorpusTrainer
from chatterbot.trainers import ListTrainer

sys.path.insert(0, os.path.dirname(__file__))

app = Flask(__name__)

chatbot = ChatBot('Toni', storage_adapter='chatterbot.storage.SQLStorageAdapter',
database_uri='sqlite:///database.sqlite3')

trainer = (ListTrainer)
trainer = ChatterBotCorpusTrainer(chatbot)

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

@app.route("/")
def home():    
    return render_template("elultimo.html") 
    
@app.route("/get")
def get_bot_response():    
    userText = request.args.get('msg')    
    return str(bot.get_response(userText)) 
    
if __name__ == "__main__":
     app.run()

The chatterbot link...

https://intercongreso.vps.co.ve/toni

I uses python 3.7.8 Flask 1.1.2 Chatterbot 1.0.8

If you need more I nformation please let me know... I need help.

Thanks a lot

intercontoni avatar Feb 16 '21 20:02 intercontoni

Any idea please?

This is a problem?

App 1498536 output: /opt/passenger-5.3.7-9.el7.cloudlinux/src/helper-scripts/wsgi-loader.py:26: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
App 1498536 output:   import sys, os, io, re, imp, threading, signal, traceback, socket, select, struct, logging, errno

Is this a problem... How to fix please....

Thanks...

intercontoni avatar Feb 21 '21 04:02 intercontoni

This appears to be an old issue so I'm going to close it off.

Looking at the code provided I don't immediately see what the issue was, but I'd recommend moving the .train() call to a different file (such as a command https://click.palletsprojects.com/en/stable/)

gunthercox avatar Oct 13 '25 17:10 gunthercox