如何在LUIS中运行瀑布?

时间:2019-04-08 06:56:08

标签: c# frameworks bots

我正在尝试在WaterfallSteps中执行LUIS意图,但是将响应作为Luis的意图进行分析,因此,如果希望我解释并希望对LUIS有所帮助的答案machea,那么它还没有完成运行

                        // Check LUIS model
                        var recognizerResult = await this.Recognizer.RecognizeAsync(turnContext, cancellationToken);
                        var topIntent = recognizerResult?.GetTopScoringIntent();

                        string strIntent = (topIntent != null) ? topIntent.Value.intent : "";
                        double dblIntentScore = (topIntent != null) ? topIntent.Value.score : 0.0;

                        if (strIntent != "" && (dblIntentScore > 0.85))
                        {
                            switch (strIntent)
                            {
                                case "None":
                                    await turnContext.SendActivityAsync("Sorry, I don't understand.");
                                    break;

                                case "ComoTeLlamas":
                                    await turnContext.SendActivityAsync("Hello, whats is your name?.");
                                    break;
                                case "TicketCRM":
                                    {
                                        {
                                            var dialogContext = await _dialogs.CreateContextAsync(turnContext, cancellationToken);
                                            var results = await dialogContext.ContinueDialogAsync(cancellationToken);

                                            {

                                                await dialogContext.BeginDialogAsync("detailscrm", null, cancellationToken);

                                            }
                                        }

                                        await _accessors.ConversationState.SaveChangesAsync(turnContext, false, cancellationToken);

                                        await _accessors.UserStateCRM.SaveChangesAsync(turnContext, false, cancellationToken);
                                    }
                                    break;
                                default:
                                    // Received an intent we didn't expect, so send its name and score.
                                    await turnContext.SendActivityAsync(
                                        $"Intent: {topIntent.Value.intent} ({topIntent.Value.score}).");
                                    break;
                            }
                        }

0 个答案:

没有答案