【发布时间】:2017-07-24 17:33:32
【问题描述】:
我正在尝试在 Python 中创建一个“人工智能”(不是真的)。因此,我使用 SpeechRecognition 模块来识别我的口语和音频播放器模块等。 一切正常,但现在我想创建一个清晰且可分类的数据结构,其中包含我的程序的所有知识。 “可分类”意味着您可以为每个主题或具有不同单词可能性的不同区域使用“文件夹和子文件夹”。
为了更清楚一点,这是我的想象:
示例 1:
class greeting:
cheerful = {"Hi, how are you?": ["I'm fine!", "Hey nice to see you"],
"Hey": "Oh hello!"}
notHappy = {"Hi": "Leave me alone!"}
class topics:
class football:
games = {"Did you hear about Manchester?": "Blablabla"}
根据程序的主题/变量(fe.greeting.cheerful),您可以说不同的可能性。
示例 2:不是我最喜欢的
brain = {"greeting": {"cheerful": {"Hi, how are you?": ["I'm fine!", "Hey nice to see you"],
"Hey": "Oh hello!"},
"notHappy": {"Hi": "Leave me alone!"}},
"topics": {"football": .................
这只是示例,我不知道最好的方法是什么。每说完一个句子就会跳到另一个你可以继续的话题。
感谢您的帮助!只是一个小项目:)
问候
PS:对不起我的英语不好
【问题讨论】:
标签: python artificial-intelligence speech-recognition