QnA机器人无法正确显示表格格式 [英] QnA bot not displaying table format properly
问题描述
我的QnA制造商知识库当前正在通过pdf文件进行培训(
我应该怎么做才能将表格格式(带有所有行和列的边框)带到聊天结果中,就像输入的pdf文件中一样.
跟进JJ_Wailes编写的内容...
她是100%正确的;您可以使用markdown编辑Q& A在测试"面板中的显示方式.但是,要记住的一件事是她从QnA文档中摘录的最后一部分:
但是,客户端应用程序(例如聊天机器人)可能不支持相同的降价格式集.测试客户端很重要应用程序的答案显示.
因此,如何在聊天中向用户呈现事物最终取决于您使用的渠道.
夫妇建议
#1坚持向用户显示表格的想法
因此,如果您真正坚持要向用户显示表,则可以考虑使用的一种选择是
但是,我的2美分是改为建议2,并使用
现在,由于多圈功能目前处于预览状态,因此Bot Framework尚不支持它,但是很快,因为已经有PR可以将多圈功能集成到3种语言中Bot Framework的SDK: C#, Python
不过,我们已经在实验中拥有示例botbuilder-samples存储库部分,向您展示如何将其集成到bot中.
My QnA maker Knowledge Base is currently trained by a pdf file (http://download.microsoft.com/download/2/9/B/29B20383-302C-4517-A006-B0186F04BE28/surface-pro-4-user-guide-EN.pdf ). While testing, QnA bot is not displaying the table formats from the input given.
The below image shows how it is currently displayed in the QnA maker test page.
What should I do to bring the table format (with all the row and column borders) to the chat result as same as in the input pdf file.
To follow up what JJ_Wailes had written...
She is 100% correct; you can use markdown to edit the rendering of how your Q&A appears inside the Test panel. However the thing to also bare in mind is the last part of the excerpt she posted from the QnA docs:
However, the client application, such as a chat bot may not support the same set of markdown formats. It is important to test the client application's display of answers.
So how things are rendered to the users in chat ultimately depends on the channel you use.
Couple Suggestions
#1 Sticking with the idea of displaying a table to user
So if you truly insist on sticking with displaying a table to the users, one option you could look into is using the Bot Framework Web Chat channel. You can check out this thread in the webchat repo for how you can implement a table using markdown in WebChat.
await context.sendActivity({
type: 'message',
textFormat: 'markdown',
text: `| My | Table | \n|-------|--------| \n| Hello | World! |`
});
However, my 2 cents, is to instead go with recommendation #2, and using the multi-turn feature of QnA Maker. Because 1.) a table is a massive block of text to send the user all at once 2.) might render nicely on desktop, but not necessarily mobile
#2 Using Multi-Turn Feature of QnA Maker
The multi-turn feature will allow you to break down large bits of information into multiple messages to the user.
For example if user wrote "drinks",
- QnA can render 3 buttons displaying "soda, alcohol, milkshakes".
Then if the user clicked the "soda",
- QnA can then render "Coke, Rootbeer, Orange Soda" as follow-up.
Screenshot of multi-turn buttons in QnA docs:
Now since the multi-turn feature is currently in preview, it's not natively supported in the Bot Framework just yet, however it will be soon, as there are already PRs up for the work of integrating multi-turn into the 3 language SDKs of Bot Framework: C#, JS, Python
However we already have a sample in the experimental section of our botbuilder-samples repo, that shows you how you can already integrate it into your bot.
这篇关于QnA机器人无法正确显示表格格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!