For those wanting a visual walk through of the process to create a Cortana skill with botframework!
Uses node.js.
Retrogaming, Single Boards, Natural Language Processing, Computer Programming, Software Engineering
// Dialog for QnAMaker GA service
[Serializable]
public class BasicQnAMakerDialog : QnAMakerDialog
{
// Go to https://qnamaker.ai and feed data, train & publish your QnA Knowledgebase.
// Parameters to QnAMakerService are:
// Required: qnaAuthKey, knowledgebaseId, endpointHostName
// Optional: defaultMessage, scoreThreshold[Range 0.0 – 1.0]
public BasicQnAMakerDialog() : base(new QnAMakerService(new QnAMakerAttribute(RootDialog.qnaAuthKey, RootDialog.qnaKBId, "No good match in FAQ.", 0.5, 1, RootDialog.endpointHostName)))
{ }
// Override to also include the knowledgebase question with the answer on confident matches
protected override async Task RespondFromQnAMakerResultAsync(IDialogContext context, IMessageActivity message, QnAMakerResults results)
{
if (results.Answers.Count > 0)
{
IMessageActivity response = context.MakeMessage();
response.Text = "Here is the match from FAQ: \r\n Q: " + results.Answers[0].Questions[0] + " \r\n A: " + results.Answers[0].Answer;
response.Speak = response.Text;
response.InputHint = "acceptingInput";
await context.PostAsync(response);
}
}
}