python - 如何为 python chatterbot 创建一个训练数据,以便它可以使用 ListTrainer 理解数值
问题描述
我正在寻找一种在一些数字数据上训练 Python Chaterbot ( https://chatterbot.readthedocs.io/en/stable/# ) 的方法,以便它可以使用 ListTrainer 理解用户输入。
例如:机器人:你需要多少张票?用户:500 机器人:这是一个巨大的数字。抱歉,我无法处理。
在上面的场景中,我可以创建一个对话让机器人明白 500 是一个大数字。但是,如果 510、600 或任何数字,机器人是否有办法根据规则做出自定义决策并回复用户。
任何建议都会有所帮助。
解决方案
If I understand the question correctly the problem is that you want the chatbot to estimates when a number is big or small and gives a specific response. For me, the best option is to find the number in the string, modify it to integer and then compare it with the given variable. Chatterbot can manage mathematical evaluation if you use the MathematicalEvaluation logic adapter instead of BestMatch. I don't think there is an embedded way in the library to give a combined text with strings and numbers and let the chatbot do the trick
推荐阅读
- python - rs-convert 不会从 rosbag 文件生成 .ply 文件
- python - SSE2 指令,PMULUDQ 乘法题
- image - AHK:尝试在 GUI 中的另一张图片上添加具有透明背景的图片
- python - AttributeError:模块'turtle'在spyder中没有属性'screen'?
- ios - 使用自定义标签栏图像和没有标签栏标题的插图时如何调整标签栏徽章位置?
- c++ - 如何将 32 字符(0/1)的序列转换为 32 位(uint32_t)?
- javascript - 将元素从Javascript中的for循环放入数组中
- java - 休眠查询不返回新数据
- ruby - 尝试安装 Ruby 调试器时出现错误
- julia - 如何在 Julia 中连接两个数据帧中的列和求和值?