在 python 中更改聊天机器人名称

时间:2021-04-04 23:30:57

标签: python bots chatbot chatterbot

我创建了一个聊天机器人,一切正常,但当我问它“你叫什么名字?”它应该回应“我是ReLebot。请问我一个数学问题。”但他实际上并没有回答“我是pybot。请问我一个数学问题。”。我该怎么办?

from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer
import pyttsx3 as tts;
from tkinter import *



my_bot = ChatBot(name='ReLebot', read_only=True,
          logic_adapters=
['chatterbot.logic.MathematicalEvaluation',
          'chatterbot.logic.BestMatch'])
small_talk = ['hi there!',
          'hi!',
          'how do you do?',
          'how are you?',
          'i\'m cool.',
          'fine, you?',
          'always cool.',
          'i\'m ok',
          'glad to hear that.',
          'i\'m fine',
          'glad to hear that.',
          'i feel awesome',
          'excellent, glad to hear that.',
          'not so good',
          'sorry to hear that.',
          'what\'s your name?',
          'i\'m ReLebot. ask me a math question, please.',
              'bye',
              'good bye it was nice talk']

1 个答案:

答案 0 :(得分:0)

如果您在自定义文件夹中的 myown.yml 中添加以下代码,这可能是可能的。

categories:
- My Own 
- This is my own data
conversations:
- - what's your name?
  - i'm ReLebot.