Giter Site home page Giter Site logo

botframework's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botframework's Issues

[QnAMakerDialog] Support version 2.0 api

The version 2.0 api documentation has some really nice features I would like to use such as:

  • questions that are linked to that answer
  • multiple answers

I have a feeling this will not be backwards compatible, but would love to lend a hand if possible.

This is also a partial duplicate of #9

Can LUIS intents be forwarded to the None handler if they have a low score?

Hi Gary, this is way off topic but in case you know as you have deep knowledge in this area; I am using your combined LUIS+QnA handler technique within the None intent to handle phrases not picked up by the LUIS intent handlers. But every now and then my intent handlers will pick up a user's phrase that shouldn't have gone there and likely has a very low score for an entity. Do you by chance know of a way within an intent to check the score and if the score for an entity found in an intent is below a threshold, let's say < .75, that it could be rerouted to the None handler instead?

Thanks,
Rick

<bool>

Hi Gary, super helpful code, I'm using it for a LUIS+QNA dialog. I noticed when attempting to use this line:
private async Task AfterQnADialog(IDialogContext context, IAwaitable result)
that it would not accept a type of < bool >. To get it to work I had to use this with < object > and then cast to bool:

    private async Task AfterQNADialog(IDialogContext context, IAwaitable<object> result)
    {
        var messageHandled = await result;

        bool b_messageHandled = true;
        if (messageHandled is bool)
        {
            b_messageHandled = (bool)messageHandled;

        }           
        if (!b_messageHandled)
        {
            string message = $"Sorry, I did not understand. Type 'help' if you need assistance.";
            await context.PostAsync(message);
        }

        context.Wait(MessageReceived);
    }

Have you seen that issue?

Thanks,
Rick

Get question list

Hi Gary,

Could you add the "questions" property in the qna maker call response. It will be very useful for a development I am doing.

Many thanks,

How to support active learning using this package?

Hello,

QnA Maker service supports active learning in run-time by providing best n matches to the user and allowing the end user to select the right question. How do we support that using QnAMakerDialog nuget package?

How to extract List BestMatch(new string[] { "Hi", "Hi There", "Hello... to a resource File (.resx)

Hi Gary,

Thank you for your nice projet ! very usefull ;)
Do you have an idea how to get the list of strings ( BestMatch(new string[] { "Hi", "Hi There", "Hello.. ) from multiple resources Files (.resx) (ex FR, US,...) we can imagine having a row :

BestMatchHelloKeyRow : Hi|Hi There|Hello|... in the US.resx file

BestMatchHelloKeyRow : Bonjour|Salut|... in the FR.resx file

If you have an idea ;)
Thanks in advance,

QnA Maker GA release breaks QnaDialog

I created a new knowledge base now that QnA Maker is out of preview and in general availability.

It looks like subscription key is obsolete, now you need to use Endpoint Keys. Also, you provision your own azure service instance, so you need to give it a url to that service, not the westus url.

I'm working on updates now, hopefully I get a PR over tonight.

threshold does not work

Hi, I tested this part: The dialog will take the incoming message and find the Best Match in the list of strings, according the a threshold that you set (0.5 by default). For example, if the incoming message was "hello", it would match be a match (matched with "hello there"), but "greetings" would not match at all.

and it does not seem to work at all.

For example if you try to put Hello in the list below:

[BestMatch(new string[] { "Hi", "Hi There", "Hello there", "Hey",
"Hey there", "Greetings", "Good morning", "Good afternoon", "Good evening", "Good day" },

Its not working. How to adjust? or which threshold should I put?

how can i catch the no match found

i have a requirement to catch all the unanswered questions. please suggest me an idea to find unanswered questions. i have to store unanswered questions into a database.

Getting some compile errors after upgrading the QnAMakerDialog nuget package

Hi, I have been using QnAMakerDialog for handing some of my botframework questions and I just updated the Nuget package to 3.0.0 and am getting 2 compile errors in QnaDialog.cs. They are:

Error CS0246 The type or namespace name 'QnAMakerResult' could not be found (are you missing a using directive or an assembly reference?)
Error CS0115 'QnADialog.DefaultMatchHandler(IDialogContext, string, QnAMakerResult)': no suitable method found to override

My code behind is this which was working before the upgrade:

`using System;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.Dialogs;

using Newtonsoft.Json.Linq;
using QnAMakerDialog;

namespace LuisBot.Dialogs
{
[Serializable]
[QnAMakerService("c355bee79baa424c8bc4c85f14b31892", "41918fa1-2f6a-4ebd-a9ec-682265481121")]
public class QnADialog : QnAMakerDialog
{
public override async Task NoMatchHandler(IDialogContext context, string originalQueryText)
{
string message = $"Sorry, I did not understand '{originalQueryText}'. Type 'help' if you need assistance.";

        context.Done(false);
    }

    public override async Task DefaultMatchHandler(IDialogContext context, string originalQueryText, QnAMakerResult result)
    {
        await context.PostAsync($"{result.Answer}");

        context.Done(true);
    }
}

}`

The errors are occurring on the 2 override lines. Can you spot what the issues are? I looked at your sample project and the lines seem to match.

Thanks,
Rick

Always getting "sorry, I couldn't find answer for ..."

I was hoping originally to get the version that has the youtube video, but I can't seem to find that. So downloaded the more complex version, and I'm not sure where to look in debug. QnA Maker doesn't show you how many times the endpoint has been hit, so I don't know if I'm even connecting. I do know I put in the right ID and Subscription. How do I move forward?

General availability of QnAMaker on nuget

When can we expect the newest commit that added changes to QnADialog so it would work with services on Azure to be updated on the nuget package? Wanted to change my code to use that service instead of the preview, but without what was changed on that commit I can't do it.

(I don't know what involves updating on nuget, if it takes much time or effort, asking so I can get a sense of when it will be available).

Example does not compile

Hi, when using the dialog as in the example:

        [LuisIntent("")]
        public async Task None(IDialogContext context, LuisResult result)
        {
            var dialog = new CommonResponsesDialog();
            dialog.InitialMessage = result.Query;
            context.Call(dialog, AfterCommonResponseHandled);
        }

        public async Task AfterCommonResponseHandled(IDialogContext context, IAwaitable<bool> result)
        {
            var messageHandled = await result;

            if (!messageHandled)
            {
                await context.PostAsync("Iā€™m not sure what you want");
            }

            context.Wait(MessageReceived);
        }

I get
Error CS1503 Argument 2: cannot convert from 'method group' to 'ResumeAfter'
In: context.Call(dialog, AfterCommonResponseHandled);

Any clues about this?

Thanks

How to handle messages with an attachment?

When trying to send a message with an attachment, im getting an error exception, how can i handle this?

` if (activity.Type == ActivityTypes.Message)
{
try
{
await Conversation.SendAsync(activity, MakeRoot);
}
catch (Exception ex)
{

            }
        }`

Exception: The remote server returned an error: (400) Bad Request.
[File of type 'text/plain']

URL Encoding Quotation mark

Hi,

Can "" in a question be a problem?
Because for me it's not working with quotation marks in a question

Is Qnamaker question unique

Hi ,

Is qnamker questins are unique?can i give same question twice with metadata to differentiate it?

can anyone help me in this?

"No suitable method method found to override" on DefaultMatchHandler after QnADialog update

I just updated my QNADialog NuGet package to the more recent one, and now for no reason that I can see I started getting a "No suitable method method found to override" error on the overriding DefaultMatchHandler method, which I didn't have beforehand.

My code:

using System;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using Microsoft.Bot.Builder.CognitiveServices.QnAMaker;
using Microsoft.Bot.Builder.Dialogs;
using QnAMakerDialog;
using QnAMakerDialog.Models;

namespace Wegho_BOT.Dialogs
{
    [Serializable]
    [QnAMakerService("", "")]
    public class QnADialog : QnAMakerDialog<bool>
    {
        /// <summary>
        /// Goes back to the MainLUISDialog with a false boolean value when no answer is found in the QnAMaker knowledge base.
        /// </summary>
#pragma warning disable CS1998
        public override async Task NoMatchHandler(IDialogContext context, string originalQueryText)
        {
            context.Done(false);
        }
#pragma warning restore CS1998

        /// <summary>
        /// Sends the user an answer to the user's question, and goes back to the MainLUISDialog with a true boolean value, after the QnAMaker calculates it..
        /// </summary>
        /// <param name="originalQueryText">The original question asked by the user</param>
        /// <param name="result">The answer calculated by the QnAMaker</param>
        public override async Task DefaultMatchHandler(IDialogContext context, string originalQueryText, QnAMakerResult result)
        {
            var answerSeparated = SplitAnswer(result.Answer);

            foreach (var item in answerSeparated)
            {
                await context.PostAsync($"{item}");
            }
            context.Done(true);
        }

        /// <summary>
        /// Splits an answer into an array of strings, separated by phrases.
        /// </summary>
        /// <param name="answer">The string to separate</param>
        /// <returns>Array of strings of the separated answer</returns>
        public string[] SplitAnswer(string answer)
        {
            string pattern = @"([^\d][.!?][^a-z])";
            string pattern2 = @"([\d][.])";
            string substitution = @"$1|";
            string substitution2 = @"|$1";
            Regex regex = new Regex(pattern, RegexOptions.IgnoreCase);
            Regex regex2 = new Regex(pattern2, RegexOptions.IgnoreCase);
            string answerSeparated = System.Net.WebUtility.HtmlDecode(regex.Replace(answer, substitution));
            answerSeparated = System.Net.WebUtility.HtmlDecode(regex2.Replace(answerSeparated, substitution2));
            return answerSeparated.Split(new[] { "|" }, StringSplitOptions.RemoveEmptyEntries);
        }
    }
}

I've even tried copying and pasting the method signature from the sample in the repository and still I get this error.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. šŸ“ŠšŸ“ˆšŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.