Skip to content

can't get the same response if I type same input twice #2213

@samsam3215

Description

@samsam3215

I'm trying to develop a chatbot for my project, the problem is I cannot get the same response with the same input. Can anyone help to solve this issue?

it looks like that:
https://ibb.co/19b5zxP

here is the code below:

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

ticket_number = random.randint(10000,19999)

chatbot = ChatBot(
'IThelpdeskChatbot',
storage_adapter='chatterbot.storage.SQLStorageAdapter',
preprocessors=[
'chatterbot.preprocessors.clean_whitespace',
'chatterbot.preprocessors.unescape_html',
'chatterbot.preprocessors.convert_to_ascii'
],
logic_adapters=[
{
'import_path': 'chatterbot.logic.SpecificResponseAdapter',
'input_text': 'bye',
'output_text': 'Thank you for using IT helpdesk Chatbot! Your ticket number is : {} .
Please help us to complete a survey and give us some feedback.'.format(ticket_number)
},
{
'import_path': 'chatterbot.logic.SpecificResponseAdapter',
'input_text': '1',
'output_text': 'Go to network tab from bottom right corner, choose inn001 network, click on connect'
},
{
'import_path': 'chatterbot.logic.SpecificResponseAdapter',
'input_text': '2',
'output_text': 'Go to URL: www.password.reset.com , Enter you login id, enter password received, reset the password'
},
{
'import_path': 'chatterbot.logic.SpecificResponseAdapter',
'input_text': '3',
'output_text': ' Verify that your computer is able to see the Internet and/or other computers to ensure that your computer is not encountering a connection issue, which would be causing your e-mail issue. Ensure that your Internet e-mail server or your Network e-mail server is not encountering issues by contacting either your Internet Service Provider or your Network administrator.'
},
{
'import_path': 'chatterbot.logic.BestMatch',
#'threshold' : 0.9,
'maximum_similarity_threshold': 0.9,
'default_response': 'Sorry, I do not understand. '
}
],
database_uri='sqlite:///database.sqlite3'
)
trainer_corpus = ChatterBotCorpusTrainer(chatbot)
trainer_corpus.train(
"chatterbot.corpus.english.greetings",
"chatterbot.corpus.english.computers",
"chatterbot.corpus.english.conversations",
"chatterbot.corpus.custom.qna"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions