microsoft / botframework-sdk

Bot Framework provides the most comprehensive experience for building conversation applications.
MIT License
7.47k stars 2.44k forks source link

Bug with LUIS and Skype groupchats #1276

Closed liiver closed 7 years ago

liiver commented 7 years ago

There is a serious bug with LUIS and Skype groupchats. When I interact with bout 1:1, it is ok and querys into Luis come in as expected, but whenever I use groupchat, for some reason the incoming query has also some BotID in it and it messes up totally the queryes and LUIS itself. I am using C# with botbuilder 3.2.0

Sample log output from luis logs. Queries from Skype groupchat:

@eldur 3.0/deleteprofile,09/20/2016 07:29:51,"{ ""query"": ""@Eldur 3.0/deleteprofile"", .... ![log](https://cloud.githubusercontent.com/assets/20423307/18661798/382cbe46-7f20-11e6-89d5-bcf1208fcd62.PNG) Attaching also log output from LUIS. As you can see it totally messes up the whole LUIS. Even If I create a whole new bot and new LUIS, it still messes it up. It really is all in preview mode.
dhirajgupta1 commented 7 years ago

My BOT is working in group conversation but its giving error messages too because of extra information sent by channel

For collection I understood Value1. "id 28 1a2a2391 5a3d 49ff a9a6 66be40d11a8b BOTName" is not an option.

Please suggest how to fix it?

msft-shahins commented 7 years ago

Similar to this. because of @botid in the text of the incoming activity your Luis models are getting confused. Either train your Luis models to ignore the bot id or remove the bot mention from the text before posting to your Luis model.

brandonh-msft commented 7 years ago

potentially fixed by #1398 ?

tomlm commented 7 years ago

In a group conversation the pattern is usually that the bot needs to be "mentioned" in some way. We leave the original text entact, but send entity annotation information which describes the part of the text which is the mention so you can deal with it (for example remove it) before sending to a system like LUIS.

Look at https://docs.botframework.com/en-us/csharp/builder/sdkreference/activities.html In the section "Mention Entities" Mention Entities Many communication clients have mechanisms to "mention" someone. Knowing that someone is mentioned can be an important piece of information for a bot that the channel knows and needs to be able to pass to you. Frequently a bot needs to know that they were mentioned, but with some channels they don't always know what their name is on that channel. (again see Slack and Group me where names are assigned per conversation) To accommodate these needs the Entities property includes Mention objects, accessible through the GetMentions() method. The Mention object Property Description type type of the entity ("mention") mentioned ChannelAccount of the person or user who was mentioned text the text in the Activity.Text property which represents the mention. (this can be empty or null) Example: The user on slack says: @ColorBot pick me a new color {
... "entities": [{ "type":"mention", "mentioned": { "id": "UV341235", "name":"Color Bot" }, "text": "@ColorBot" }] ... } This allows the bot to know that they were mentioned and to ignore the part of the input when trying to determine the user intent. NOTE: Mentions go both ways. A bot may want to mention a user in a reply to a conversation. If they fill out the Mentions object with the mention information then it allows the Channel to map it to the mentioning semantics of the channel.

ipavlic commented 6 years ago

Sure, you can have entities, but don't send them in text as well.