该功能出现在rasa-plus中。
基于意图大模型的对话系统,大模型扮演3个核心功能:
- 基于prompt的意图分类
- 无意图策略
- NLG的rephrase
使用大模型做意图分类
意图和意图样例一起放入prompt
不建议将全部意图放入prompt,这样会让prompt太长,也会导致无法加入意图对应的样例。
如果不加入意图对应的样例,大模型只能根据意图的名字判断,可能无法预测出正常的意图。
只放入会用到的意图及其样例。
预测的意图不在领域意图内
当大模型预测的意图不在domain的全部意图内时,找到一个最接近的领域意图返回。
和输入最相似的样例放入prompt
通过向量搜索,找到和输入最相似的样例,放入prompt
Label a users message from a conversation with an intent. Reply ONLY with the name of the intent. The intent should be one of the following: {% for intent in intents %}- { {intent}} {% endfor %} {% for example in examples %} Message: { {example['text']}} Intent: { {example['intent']}} {% endfor %} Message: { {message}} Intent: <