Open intercontoni opened 3 years ago
Any help?
ChatterBot is no longer supported.
@intercontoni a bit more information would be useful. What are you doing. What is not working. Error messages?
Not response... I change...
http://intercongreso.vps.co.ve/tonib
This is my app...
from flask import Flask, render_template, request
from chatterbot import ChatBot
from chatterbot import languages
app = Flask(__name__)
bot = ChatBot('Toni', storage_adapter={
'tagger_language': languages.SPA,
'import_path': 'chatterbot.storage.SQLStorageAdapter',
},
logic_adapters=[
'chatterbot.logic.MathematicalEvaluation',
'chatterbot.logic.BestMatch',
{
'import_path': 'chatterbot.logic.BestMatch',
'default_response': 'Yo lo siento mucho, pero como no te estoy entendiendo.',
'maximum_similarity_threshold': 0.90
}],
read_only = True,
preprocessors=['chatterbot.preprocessors.clean_whitespace',
'chatterbot.preprocessors.unescape_html',
'chatterbot.preprocessors.convert_to_ascii']
)
@app.route("/")
def home():
return render_template("index.html")
@app.route("/get")
def get_bot_response():
user_input = request.args.get('msg')
return str(bot.get_response(user_input))
if __name__ == "__main__":
app.run(debug=True)
Whit this I speack whit terminal chatbot.py
from chatterbot import ChatBot
bot = ChatBot('Toni',
logic_adapters=[{
'import_path': 'chatterbot.logic.BestMatch',
'default_response': 'Lo siento mucho pero como que no te estoy entendiendo.',
'maximum_similarity_threshold': 0.90
}],
read_only = True,
preprocessors=['chatterbot.preprocessors.clean_whitespace',
'chatterbot.preprocessors.unescape_html',
'chatterbot.preprocessors.convert_to_ascii']
)
# run and get response from user.
name = input('Digame su nombre primero: ')
print ('Bienvenido a mi servicio, en que te puedo ayudar?')
while True:
request = input(name+': ')
if request=="Chao" or request=='chao':
print('Bot: Chao')
break
else:
response=bot.get_response(request)
print('Bot: ', response)
I get a 404 from the server when sending a comment.
Request: GET | http://intercongreso.vps.co.ve/get?msg=Test Response: 404 Not Found
I would first check if your application is triggered at all (i.e. by checking the webserver log or writing out some log lines into your own log file from within your app).
well, I'm not a programmer .... I'm going to look for information to see how it does what it tells me.
I'll tell you later ..
I have in python setup cpanel this...
Passenger log file
You can define the path along with the filename ...
I don't see nothing in there...
I don't think this is the problem ...
opt/passenger-5.3.7-13.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 10684 output: import sys, os, io, re, imp, threading, signal, traceback, socket, select, struct, logging,
As said above, you have configured your FLASK application to call chatterbot athttp://intercongreso.vps.co.ve/get?msg=Test which returns a 404/Document not found. So you surely have a misconfiguration there. I would assume the URL should be http://intercongreso.vps.co.ve/tonib/get?msg=Test instead (which returns a 200).
can you tell me how to do that?...
I don't see misconfiguration....
I create whit python setup app cpanel... I install whit pip install chatterbot, flask, spacy, etc...
And copy and paste the chatbot.py web_app.py and chatbot_training.py
I don't configure nothing.... I don't know how to make this...
Your problem is not related to chatterbot, it's a flask related issue. And it seems you are expecting this to be a runs-out-of-the-box application, which it is not. Meaning, you need to acquire a basic understanding of web technologies/programming.
Related to your problem: I'm not 100% sure, but maybe this helps.
@app.route("/tonib/") def home(): return render_template("index.html")
@app.route("/tonib/get") def get_bot_response(): userText = request.args.get('msg') return str(chatbot.get_response(userText))
Not because I have the folder tonib... in the folder tonib have the files .py
If I put
@app.route("/tonib/") def home(): return render_template("index.html")
@app.route("/tonib/get") def get_bot_response(): userText = request.args.get('msg') return str(chatbot.get_response(userText))
I have this...
Not Found The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.
I need go to the address http://intercongreso.vps.co.ve/tonib/tonib but bit whotk... os the same... not response nothing
Chatterbot 1 0 5....
My app...
Chatboy py
Look... http://intercongreso.vps.co.ve/toninot ......
I have another in chatterbot 1.0.8 the same problem.
The app...
Look http://intercongreso.vps.co.ve/toni ..... Work on the terminal not on the web...
What happen?