Chatterbot how to get multiple responses

451 Views Asked by At

the python chatterbot library given the datasets below convo.txt

output.txt

hey
hey 1
hey
hey 2
hey
hey 3

or when trained on this dataset, in corpus with the dataset below (yml)

- - hey
  - hey 1
- - hey
  - hey 2
- - hey
  - hey 3

when get_response('hey') is called, hey 1 and hey 2 are the only ones given, why is that? and how can i have multiple responses available when users type 'hey', i want it to randomly generate between hey 1 hey 2 and hey 3

1

There are 1 best solutions below

0
On BEST ANSWER

use the Corpus trainer, it works much better than from a text file, and delete your database every time to make sure you are getting the proper output.

trainer = ChatterBotCorpusTrainer(chatbot)
trainer.train('chatterbot.corpus.custom')