Skip to content
This repository has been archived by the owner on Jun 30, 2022. It is now read-only.

Commit

Permalink
[VA Template] Fix LUIS and QnA names in DispatchLuis (#1953)
Browse files Browse the repository at this point in the history
* Fix casing for general, faq, and chitchat models

* Rename r_ChitChat (typo) to q_ChitChat

* Copy changes to template project
  • Loading branch information
ryanisgrig committed Jul 25, 2019
1 parent 9afe1f7 commit ab0b5d4
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 48 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ public class DispatchTestUtil
{
private static Dictionary<string, IRecognizerConvert> _utterances = new Dictionary<string, IRecognizerConvert>
{
{ GeneralUtterances.Cancel, CreateIntent(GeneralUtterances.Cancel, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.Escalate, CreateIntent(GeneralUtterances.Escalate, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.FinishTask, CreateIntent(GeneralUtterances.FinishTask, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.GoBack, CreateIntent(GeneralUtterances.GoBack, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.Help, CreateIntent(GeneralUtterances.Help, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.Repeat, CreateIntent(GeneralUtterances.Repeat, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.SelectAny, CreateIntent(GeneralUtterances.SelectAny, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.SelectItem, CreateIntent(GeneralUtterances.SelectItem, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.SelectNone, CreateIntent(GeneralUtterances.SelectNone, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.ShowNext, CreateIntent(GeneralUtterances.ShowNext, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.ShowPrevious, CreateIntent(GeneralUtterances.ShowPrevious, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.StartOver, CreateIntent(GeneralUtterances.StartOver, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.Stop, CreateIntent(GeneralUtterances.Stop, DispatchLuis.Intent.l_general) },
{ FaqUtterances.Overview, CreateIntent(FaqUtterances.Overview, DispatchLuis.Intent.q_faq) },
{ ChitchatUtterances.Greeting, CreateIntent(ChitchatUtterances.Greeting, DispatchLuis.Intent.q_chitchat) },
{ GeneralUtterances.Cancel, CreateIntent(GeneralUtterances.Cancel, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.Escalate, CreateIntent(GeneralUtterances.Escalate, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.FinishTask, CreateIntent(GeneralUtterances.FinishTask, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.GoBack, CreateIntent(GeneralUtterances.GoBack, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.Help, CreateIntent(GeneralUtterances.Help, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.Repeat, CreateIntent(GeneralUtterances.Repeat, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.SelectAny, CreateIntent(GeneralUtterances.SelectAny, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.SelectItem, CreateIntent(GeneralUtterances.SelectItem, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.SelectNone, CreateIntent(GeneralUtterances.SelectNone, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.ShowNext, CreateIntent(GeneralUtterances.ShowNext, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.ShowPrevious, CreateIntent(GeneralUtterances.ShowPrevious, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.StartOver, CreateIntent(GeneralUtterances.StartOver, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.Stop, CreateIntent(GeneralUtterances.Stop, DispatchLuis.Intent.l_General) },
{ FaqUtterances.Overview, CreateIntent(FaqUtterances.Overview, DispatchLuis.Intent.q_Faq) },
{ ChitchatUtterances.Greeting, CreateIntent(ChitchatUtterances.Greeting, DispatchLuis.Intent.q_ChitChat) },
};

public static MockLuisRecognizer CreateRecognizer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public MainDialog(
await CompleteAsync(dc);
}
}
else if (intent == DispatchLuis.Intent.l_general)
else if (intent == DispatchLuis.Intent.l_General)
{
// If dispatch result is general luis model
cognitiveModels.LuisServices.TryGetValue("general", out var luisService);
cognitiveModels.LuisServices.TryGetValue("General", out var luisService);

if (luisService == null)
{
Expand Down Expand Up @@ -132,9 +132,9 @@ public MainDialog(
}
}
}
else if (intent == DispatchLuis.Intent.q_faq)
else if (intent == DispatchLuis.Intent.q_Faq)
{
cognitiveModels.QnAServices.TryGetValue("faq", out var qnaService);
cognitiveModels.QnAServices.TryGetValue("Faq", out var qnaService);

if (qnaService == null)
{
Expand All @@ -154,9 +154,9 @@ public MainDialog(
}
}
}
else if (intent == DispatchLuis.Intent.q_chitchat)
else if (intent == DispatchLuis.Intent.q_ChitChat)
{
cognitiveModels.QnAServices.TryGetValue("chitchat", out var qnaService);
cognitiveModels.QnAServices.TryGetValue("ChitChat", out var qnaService);

if (qnaService == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public partial class DispatchLuis: IRecognizerConvert
public string Text;
public string AlteredText;
public enum Intent {
l_general,
q_chitchat,
q_faq,
l_General,
q_ChitChat,
q_Faq,
None
};
public Dictionary<Intent, IntentScore> Intents;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ public class DispatchTestUtil
{
private static Dictionary<string, IRecognizerConvert> _utterances = new Dictionary<string, IRecognizerConvert>
{
{ GeneralUtterances.Cancel, CreateIntent(GeneralUtterances.Cancel, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.Escalate, CreateIntent(GeneralUtterances.Escalate, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.FinishTask, CreateIntent(GeneralUtterances.FinishTask, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.GoBack, CreateIntent(GeneralUtterances.GoBack, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.Help, CreateIntent(GeneralUtterances.Help, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.Repeat, CreateIntent(GeneralUtterances.Repeat, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.SelectAny, CreateIntent(GeneralUtterances.SelectAny, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.SelectItem, CreateIntent(GeneralUtterances.SelectItem, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.SelectNone, CreateIntent(GeneralUtterances.SelectNone, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.ShowNext, CreateIntent(GeneralUtterances.ShowNext, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.ShowPrevious, CreateIntent(GeneralUtterances.ShowPrevious, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.StartOver, CreateIntent(GeneralUtterances.StartOver, DispatchLuis.Intent.l_general) },
{ GeneralUtterances.Stop, CreateIntent(GeneralUtterances.Stop, DispatchLuis.Intent.l_general) },
{ FaqUtterances.Overview, CreateIntent(FaqUtterances.Overview, DispatchLuis.Intent.q_faq) },
{ ChitchatUtterances.Greeting, CreateIntent(ChitchatUtterances.Greeting, DispatchLuis.Intent.q_chitchat) },
{ GeneralUtterances.Cancel, CreateIntent(GeneralUtterances.Cancel, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.Escalate, CreateIntent(GeneralUtterances.Escalate, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.FinishTask, CreateIntent(GeneralUtterances.FinishTask, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.GoBack, CreateIntent(GeneralUtterances.GoBack, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.Help, CreateIntent(GeneralUtterances.Help, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.Repeat, CreateIntent(GeneralUtterances.Repeat, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.SelectAny, CreateIntent(GeneralUtterances.SelectAny, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.SelectItem, CreateIntent(GeneralUtterances.SelectItem, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.SelectNone, CreateIntent(GeneralUtterances.SelectNone, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.ShowNext, CreateIntent(GeneralUtterances.ShowNext, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.ShowPrevious, CreateIntent(GeneralUtterances.ShowPrevious, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.StartOver, CreateIntent(GeneralUtterances.StartOver, DispatchLuis.Intent.l_General) },
{ GeneralUtterances.Stop, CreateIntent(GeneralUtterances.Stop, DispatchLuis.Intent.l_General) },
{ FaqUtterances.Overview, CreateIntent(FaqUtterances.Overview, DispatchLuis.Intent.q_Faq) },
{ ChitchatUtterances.Greeting, CreateIntent(ChitchatUtterances.Greeting, DispatchLuis.Intent.q_ChitChat) },
};

public static MockLuisRecognizer CreateRecognizer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,10 @@ public MainDialog(
await CompleteAsync(dc);
}
}
else if (intent == DispatchLuis.Intent.l_general)
else if (intent == DispatchLuis.Intent.l_General)
{
// If dispatch result is general luis model
cognitiveModels.LuisServices.TryGetValue("general", out var luisService);
cognitiveModels.LuisServices.TryGetValue("General", out var luisService);

if (luisService == null)
{
Expand Down Expand Up @@ -132,9 +132,9 @@ public MainDialog(
}
}
}
else if (intent == DispatchLuis.Intent.q_faq)
else if (intent == DispatchLuis.Intent.q_Faq)
{
cognitiveModels.QnAServices.TryGetValue("faq", out var qnaService);
cognitiveModels.QnAServices.TryGetValue("Faq", out var qnaService);

if (qnaService == null)
{
Expand All @@ -154,9 +154,9 @@ public MainDialog(
}
}
}
else if (intent == DispatchLuis.Intent.q_chitchat)
else if (intent == DispatchLuis.Intent.q_ChitChat)
{
cognitiveModels.QnAServices.TryGetValue("chitchat", out var qnaService);
cognitiveModels.QnAServices.TryGetValue("ChitChat", out var qnaService);

if (qnaService == null)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public partial class DispatchLuis: IRecognizerConvert
public string Text;
public string AlteredText;
public enum Intent {
l_general,
q_chitchat,
q_faq,
l_General,
q_ChitChat,
q_Faq,
None
};
public Dictionary<Intent, IntentScore> Intents;
Expand Down

0 comments on commit ab0b5d4

Please sign in to comment.