[英]How to create a train data for python chatterbot so that it can understand numeric values using ListTrainer
I am looking for a way to train the Python Chaterbot ( https://chatterbot.readthedocs.io/en/stable/# ) on some numeric data so that it can understand the user input using ListTrainer. 我正在寻找一种在一些数字数据上训练Python Chaterbot( https://chatterbot.readthedocs.io/en/stable/# )的方法,以便它可以使用ListTrainer理解用户输入。
Ex: Bot : How many tickets do you need? 例如:Bot:您需要几张票? User: 500 Bot: thats a huge number.
用户:500 Bot:多数民众赞成。 Sorry I cannot process that.
抱歉,我无法处理。
In the above scenario, I can create a dialogue to make the bot understand that 500 is big number. 在上述情况下,我可以创建一个对话以使漫游器了解500是很大的数字。 But what if 510, 600 or any number, is there a way the bot can take custom decisions based upon a rule and reply the user.
但是,如果510、600或任何数字是什么,则机器人可以根据规则做出自定义决定并回复用户。
Any suggestions will be helpful. 任何建议都会有所帮助。
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.
如果您使用MathematicalEvaluation逻辑适配器而不是BestMatch,Chatterbot可以管理数学评估。 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
我认为库中没有一种嵌入式方法可以提供带有字符串和数字的组合文本,然后让聊天机器人来解决问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.