【问题标题】:Chatterbot how to get multiple responsesChatterbot如何获得多个响应
【发布时间】:2020-10-17 01:51:51
【问题描述】:

python chatterbot 库给出 convo.txt 下面的数据集

输出.txt

hey
hey 1
hey
hey 2
hey
hey 3

或者当在这个数据集上训练时,在下面的数据集(yml)的语料库中

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

当调用 get_response('hey') 时,hey 1 和 hey 2 是唯一给出的,这是为什么呢?以及当用户输入“嘿”时如何获得多个响应,我希望它在 hey 1 hey 2 和 hey 3 之间随机生成

【问题讨论】:

    标签: python python-3.x chatbot corpus chatterbot


    【解决方案1】:

    使用 Corpus 训练器,它比文本文件更有效,并且每次都删除数据库以确保获得正确的输出。

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

    【讨论】:

      猜你喜欢
      • 2022-11-22
      • 1970-01-01
      • 2021-12-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-08
      • 1970-01-01
      • 2015-01-31
      相关资源
      最近更新 更多