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

2024-10-01 04:44:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我创建了一个聊天机器人,一切正常,但当我问它“你叫什么名字?”它应该回答“我是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']

Tags: tonamefromimportyouthat数学hi
1条回答
网友
1楼 · 发布于 2024-10-01 04:44:07

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

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

相关问题 更多 >