简体   繁体   English

如何为python chatterbot创建火车数据,以便它可以使用ListTrainer理解数值

[英]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.

相关问题 如何使用“Chatterbot”模块在 Python 中训练我的聊天机器人 - How can I train my chatterbot in Python with `Chatterbot` module 如何使用 GPU 而不是 CPU 训练我的 ChatterBot model - How to train my ChatterBot model using GPU instead of CPU Python-如何创建一个使用 scikit 将数据拆分为训练和验证的函数 - Python- how to create a function that splits data into train and validation using scikit 如何使用 Scikit-learn 创建具有数字和 1-hot 分类特征的训练数据集? - How do I create a train data set with both numeric and 1-hot categorical features with Scikit-learn? 使用python如何转换序数形式的数字数据? - using python how to convert numeric data in ordinal? 如何预处理一个巨大的数据集并保存它以便我可以在 Python 中训练数据 - How to preprocess a huge dataset and save it such that I can train the data in Python 如何在 python 中的 XML 数据中“拆分”多个(数字)值? - How to "split" the multiple (numeric) values in XML data, in python? 如何在 python Dataframe 中以数字形式转换 t 和 f 值? - How can I convert t and f values in numeric in python Dataframe? 如何在不使用 function train_test_split 的情况下将数据拆分为测试和训练? - How can I split the data into test and train without using function train_test_split? 如何检查“数据框”列中是否包含数值? Python 3.6 - How to check Data Frame columns contains numeric values or not? Python 3.6
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM