我想将RASA 响应选择器用于 QnA 系统,其中答案是多行文本,而不仅仅是单行。假设允许答案的常见问题解答系统是文档段落。
以这个 Q/A 示例为例,其中问题是单行的:
How to follow people on Twitter?
相应的答案(来自 twitter FAQ 的真实示例)是一段:
1. Find a Tweet from the account you’d like to follow.
2. Hover your mouse over their name.
3. Click the **Follow** button.
OR
1. Navigate to a Tweet from the account you’d like to follow.
2. Tap the icon located at the top of the Tweet.
3. Tap **Follow** from the selection menu.
如何使用data/responses.md
响应选择器降价格式管理此复合/多行答案?
据我所知(请告诉我我错了),现在在 RASA 我只能用 1 行来回答。如果这是真的,我发现的唯一解决方案是\n
在文本中显式插入一个换行符。所以上面提到的例子可以这样翻译:
(venv) $ cat data/responses.md
## ask languages
* faq/ask_how_to_follow_people_on_twitter
- 1. Find a Tweet from the account you’d like to follow.\n 2. Hover your mouse over their name.\n 3. Click the **Follow** button.\n \n OR \n\n 1. Navigate to a Tweet from the account you’d like to follow.\n 2. Tap the icon located at the top of the Tweet. \n 3. Tap **Follow** from the selection menu.
## ask blablabla
* faq/ask_blablabla
- blablabla\nblablabla\nblablabla
很不可读,不是吗?它“有效”,但我不喜欢它有很多原因:
- 文件上的答案
data/responses.md
变得不可读 - 我需要编写一个脚本,以降价格式转换常见问题解答,用
\n
s 替换每个换行符。 - 使用 RASA cli 命令(例如
rasa shell
)对话测试,我得到了不可读的单行压缩文本:/
两个问题:
我可以在response.md 中有由多行文本组成的FAQ 答案吗(在markdown 文件中写的WTSIWYG “as”,可能没有插入
'\n'
)?如果是长文本(~一页/段落)的答案,管理 RASA 响应选择器答案的建议方法是什么?
更新
我打开了问题/更改请求:https ://github.com/RasaHQ/rasa/issues/5800
谢谢你的帮助
乔治