2016-11-19 6 views
2

私はLUISモデルと話すボットを構築しようとしています。ボットは35のシナリオを持ち、それぞれがLUISインテントに対応しています。現在、LUISは最大20個のインテントをサポートしています。 これを私のコードでどのようにスケールすることができますか? LUISモデル階層を持つ方が良いかどうか、親モデルが特定の子モデルを呼び出すことが望ましいかどうか疑問に思っています。または、データベースのキーワードのリストを維持し、それに基づいて特定のモデルを呼び出す必要があります。私は両方のアプローチの長所と短所を評価するのに助けが必要です。ありがとう!LUISはインテントの数を20に制限します

+1

最近、インテントの制限が80から500に引き上げられました。https://docs.microsoft.com/en-in/azure/cognitive-services/luis/luis-boundaries –

答えて

2

BestMatchDialog(少なくとも15個)を使用できるように、多くのシナリオを置き換えることをお勧めします。

あなたは引き続きルートダイアログとしてLuisDialogを使用します。 ここでの例です:あなたLuisDialogから

[Serializable] 
public class GreetingsDialog: BestMatchDialog<bool> 
{ 
    [BestMatch(new string[] { "Hi", "Hi There", "Hello there", "Hey", "Hello", 
     "Hey there", "Greetings", "Good morning", "Good afternoon", "Good evening", "Good day" }, 
     threshold: 0.5, ignoreCase: true, ignoreNonAlphaNumericCharacters: true)] 
    public async Task WelcomeGreeting(IDialogContext context, string messageText) 
    { 
     await context.PostAsync("Hello there. How can I help you?"); 
     context.Done(true); 
    } 

    [BestMatch(new string[] { "bye", "bye bye", "got to go", 
     "see you later", "laters", "adios" })] 
    public async Task FarewellGreeting(IDialogContext context, string messageText) 
    { 
     await context.PostAsync("Bye. Have a good day."); 
     context.Done(true); 
    } 

    public override async Task NoMatchHandler(IDialogContext context, string messageText) 
    { 
     context.Done(false); 
    } 
} 

は、あなたがこのよう

[LuisIntent("None")] 
    [LuisIntent("")] 
    public async Task None(IDialogContext context, IAwaitable<IMessageActivity> message, LuisResult result) 
    { 
     var cts = new CancellationTokenSource(); 
     await context.Forward(new GreetingsDialog(), GreetingDialogDone, await message, cts.Token); 
    } 

上記Ankitbko's MeBot repoから借りたコードを呼び出すことができます。

+1

ありがとう!また、次回のLUISリリースで意図の数が緩和されるようです。 – happydevdays

+0

@happydevdaysそれは素晴らしいですが、価格には注意が必要です:P – jcmontx

+0

これは40までの意向です。 – JPThorne

関連する問題