如何更改Android语音语言理解(LUIS)SDK的端点?

问题描述 投票:0回答:1

我已经在luis.ai和eu.luis.ai上都建立了一个应用程序。

我正在使用此存储库中提供的SDK将其用于语音识别:https://github.com/Azure-Samples/Cognitive-Speech-STT-Android可以将LUIS与语音识别直接结合使用,而这正是我所需要的。

它在luis.ai上有效,因为端点在我们西部。在eu.luis.ai上,它无法在SDK中运行,因为端点似乎是错误的。端点的appID和subID错误。

有什么方法可以强制SDK(上面链接的存储库中的那个)使用westeu或其他?

android speech-recognition speech-to-text microsoft-cognitive
1个回答
0
投票

假定您引用的是https://github.com/Microsoft/Cognitive-LUIS-Windows,则LuisClient构造函数具有一个接受基本URI的重载。参见https://github.com/Microsoft/Cognitive-LUIS-Windows/blob/master/ClientLibrary/LuisClient.cs,具体是:

    /// <summary>
    /// Construct a new Luis client with a shared <see cref="HttpClient"/> instance.
    /// </summary>
    /// <param name="appId">The application ID of the LUIS application</param>
    /// <param name="appKey">The application subscription key of the LUIS application</param>
    /// <param name="baseApiUrl">Root URI for the service endpoint.</param>
    /// <param name="preview">A flag indicating whether to use preview features or not (Dialogue)</param>
    /// top scoring in case of using the dialogue</param>

    public LuisClient(string appId, string appKey, string baseApiUrl, bool preview = false)

[针对Android Speech SDK而不是LUIS SDK的更新:

Android Speech SDK(https://github.com/Azure-Samples/Cognitive-Speech-STT-Android)具有类似的用于指定URL的方法。请参见createDataClientWithIntent重载,该重载在https://github.com/Azure-Samples/Cognitive-Speech-STT-Android/blob/e27487b57f31afa04f6f3a8badfc566b1885011d/docs/com/microsoft/cognitiveservices/speechrecognition/SpeechRecognitionServiceFactory.html中带有可选的URL参数:

createDataClientWithIntent(android.app.Activity activity, java.lang.String language, ISpeechRecognitionServerEvents eventHandlers, java.lang.String primaryKey, java.lang.String secondaryKey, java.lang.String luisAppId, java.lang.String luisSubscriptionId, java.lang.String url)

© www.soinside.com 2019 - 2024. All rights reserved.