-
Notifications
You must be signed in to change notification settings - Fork 75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
能在ChatterBot中加入注意力机制吗? #41
Comments
我觉得这个想法很有意思。 但 ChatterBot 本是简单的数据库检索、通过相似语句匹配、得到输出答句,这是个完全的浅层学习过程(甚至好像没有用到向量和矩阵)。在这样的系统中引入深度的注意力机制是否值得。 在你编辑前给的第一版代码里,似乎是完全用 PyTorch 重写了 ChatterBot 推理的整个过程。只是把原来的一些通过编程实现的匹配、检索工作换成了基于神经网络的向量、概率实现,我觉得二者也许大概是等价的。 而后面改过的这版代码似乎更没有意义了,手写了一种 attention,然后似乎就没有然后了,没看懂 🙈 |
你好,此项目的ChatterBot如何实现,还有如何使用呢? |
然后原代碼取自XzaiCloud/AI-Vtuber項目,这是新版的代码 Define a function to calculate the dot product attention scoredef dot_product_attention(query, values): Read the conversation corpus filewith open('db.txt', 'r', encoding='utf-8') as f: Create a ChatBot instance and train itmy_bot = ChatBot(input('请输入ChatBot名称:')) print('开始训练!') Train the ChatBot instance with each conversation in the corpusfor conversation in corpus:
print('训练完毕!')` |
这个项目目前主要使用 OpenAI 的 ChatGPT API,ChatterBot 只是作为备用机制。使用 ChatterBot 的实现在: https://github.com/cdfmlr/musharing_chatbot/ ,只是对 ChatterBot 项目( https://github.com/RaSan147/ChatterBot_update )的 API 封装。
@XzaiCloud 你在 ChatterBot 加了注意力机制?😱 |
加了可能忘了 |
啊这
@win10ogod XzaiCloud/AI-Vtuber 似乎没有这个源码?😭 |
我也记得没加 |
我更推荐使用blenderbot |
chatterbot有点过时了 |
blenderbot 有中文的项目吗? |
我不太了解编程不过试着问了chatgpt。
这是chatgpt的代碼纪录:
The text was updated successfully, but these errors were encountered: