简体   繁体   English

Python ChatterBot 中机器人名称的用途是什么?

[英]what is the use of the bot's name in Python ChatterBot?

from chatterbot import ChatBot

# Create a new chat bot named Charlie
chatbot = ChatBot('Charlie')

what is the use of the bot's name "Charlie"?机器人的名字“查理”有什么用? Can my chatbot know his name in a group chat, and only reply message about him?我的聊天机器人可以在群聊中知道他的名字,并且只回复关于他的消息吗?

-- "Hi, Charlie"
- bot: "Hi"
-- "Charlie, tell me the time"
- bot: "It's nine o'clock"
-- "how are you?"
- ...

I have read the doc but find nothing about it, say thanks advanced if you guys tell me how to approach it.我已经阅读了文档,但一无所获,如果你们告诉我如何处理它,请说谢谢。

From what I have seen from their ChatBot.py, the constructor requires "name" as the only parameter.从我从他们的 ChatBot.py 中看到的,构造函数需要“名称”作为唯一的参数。

I am unable to find anything in the documentation that addresses it and I can neither test it as of now, but based on [1], it appears that upon generating an answer, it is used to define the "persona" parameter for the Statement constructor.我无法在解决它的文档中找到任何内容,我现在也无法对其进行测试,但是基于 [1],似乎在生成答案时,它用于定义 Statement 的“persona”参数构造函数。 Upon looking into the Stament [2] constructor, it seems that the "persona" parameter might be a string identifying who generated the statement.在查看 Stament [2] 构造函数时,似乎“persona”参数可能是一个字符串,用于标识生成语句的人。


[1] https://github.com/gunthercox/ChatterBot/blob/4ff8af28567ed446ae796d37c246bb6a14032fe7/chatterbot/chatterbot.py#L203 [1] https://github.com/gunthercox/ChatterBot/blob/4ff8af28567ed446ae796d37c246bb6a14032fe7/chatterbot/chatterbot.py#L203

[2] https://github.com/gunthercox/ChatterBot/blob/4ff8af28567ed446ae796d37c246bb6a14032fe7/chatterbot/conversation.py#L64 [2] https://github.com/gunthercox/ChatterBot/blob/4ff8af28567ed446ae796d37c246bb6a14032fe7/chatterbot/conversation.py#L64

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM