Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add QuestionAnswerTrainer #2112

Closed

Conversation

dancaron
Copy link

@dancaron dancaron commented Feb 3, 2021

There is a desire to have a basic question and answer trainer, so that the flow an ongoing conversation does not "ruin" the training set by linking an answer to the following question in a list of question and answers.

Unwanted:
Q: What is your favorite color?
A: Blue
Q: What is your favorite number?
A: 13
Using the ListTrainer would associate "Blue" with "What is your favorite number?"

This QuestionAnswerTrainer solves that problem by only creating Statements that associate the question with the answer, and then moves to the next question in the list to begin new Statement creation.

Fixes #1898

@dancaron
Copy link
Author

will this go (and the tagger) into site_packages/chatterbot with a "fresh pip install chatterbot" ?

No, as it has not been merged in by project admins.

@nickums
Copy link

nickums commented Apr 2, 2021

getting an error using this.

quizzer = QuestionAnswerTrainer(chatbot)
quizzer.train(["What color is sky?","Blue"])

File "C:\Python\Python38\OurStuff\AI\NLP\Chatbot\trainers.py", line 144, in train
question_search_text = self.chatbot.storage.tagger.get_text_index_string(qa_list[i-1])
AttributeError: "PosHypernymTagger" object has no attribute "get_text_index_string"

@frollino
Copy link

frollino commented Apr 7, 2021

getting an error using this.

quizzer = QuestionAnswerTrainer(chatbot)
quizzer.train(["What color is sky?","Blue"])

File "C:\Python\Python38\OurStuff\AI\NLP\Chatbot\trainers.py", line 144, in train
question_search_text = self.chatbot.storage.tagger.get_text_index_string(qa_list[i-1])
AttributeError: "PosHypernymTagger" object has no attribute "get_text_index_string"

I have the same error!

@dancaron dancaron closed this Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How to train questions and answers?
3 participants