chatterbot mathematical evaluation times and minus not working

318 Views Asked by At

I am making a chatbot using the chatterbot library on python, I am using the mathematical evaluation logic adapter. when I use the chat bot can use the addition and division functions but not the multiplication and subtraction. any fixes would be greatly appreciated.

from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
from chatterbot.trainers import ChatterBotCorpusTrainer
import chatterbot_corpus

bot = ChatBot(
    'IKO',  
    logic_adapters=[
        'chatterbot.logic.BestMatch',
        'chatterbot.logic.TimeLogicAdapter',
        'chatterbot.logic.MathematicalEvaluation'],
    storage_adapter='chatterbot.storage.SQLStorageAdapter',
    database_uri='sqlite:///databasea.sqlite3'
)

list_trainer = ListTrainer(bot)
list_trainer = ListTrainer(bot)
corpus_trainer = ChatterBotCorpusTrainer(bot)

corpus_trainer.train(
    "chatterbot.corpus.english.greetings",
    "chatterbot.corpus.english.ai"
)

list_trainer.train([
    "what is your name",
    "my name is IKO",
    "is your name IKO",
    "yes"
])

list_trainer.train([
    "turn on the light",
    "ok turning the light on"
])

name = input("Enter Your Name: ")
print("Welcome to the Bot Service! Let me know how can I help you?")
while True:
    request=input(name+':')
    if request=='Bye' or request =='bye':
        print('Bot: Bye')
        break
    elif "turn" in request and "on" in request and "light" in request:
        sig = "light on"
        print(sig)
    else:
        response=bot.get_response(request)
        print('Bot:',response)
    
0

There are 0 best solutions below