1
I’m developing a Chatbot in python, using the Chatterbot library. I wonder how I can "embed" this chatbot into an HTML page.
- I’m a beginner.
- Using USB Web Server
Follows the code:
# -*- coding: utf-8 -*-
from chatterbot.trainers import ListTrainer
from chatterbot import ChatBot
bot = ChatBot('Bot')
nome = input('Digite seu nome: ')
conv = [
'Oi',
'Olá',
'Tudo bem?',
'Estou bem obrigado'
]
bot.set_trainer(ListTrainer)
bot.train(conv)
print('-='*40)
print('Bem Vindo ao Chat!')
print('-='*40)
while True:
quest = input('Você: ')
response = bot.get_response(quest)
if float(response.confidence) > 0.5:
print('Bot:', response)
else:
print('Bot: Não entendi, isso não está na minha base de dados')
You need to use some Python Webframework to use Python in an HTML page for example. The ones I know are the Django and the Turbogears.
– Paulo Affonso Júnior
So that you can use an I.A in HTML, I indicate the AIML which is a language already totally directed to this area.
– cjdotcomdotbr