Finalized README instructions + fixed a bug for LUIS deployments not published to WestUS.
This commit is contained in:
Родитель
42a9439ff5
Коммит
da688c2bf9
|
@ -27,12 +27,15 @@ namespace LuisCacheClient
|
|||
public MainPage()
|
||||
{
|
||||
this.InitializeComponent();
|
||||
var luisSubscriptionKey = "LUIS_KEY";
|
||||
var luisAppId = "LUIS_APP_ID";
|
||||
var mobileAppUri = "http://XXXXXXXXX.azurewebsites.net/";
|
||||
// MAKE SURE TO POPULATE THE VALUES BELOW WITH THE VALUES FROM YOUR OWN LUIS AND APP SERVICE
|
||||
// DEPLOYMENT IN AZURE.
|
||||
// See the instruction on the README page on GitHub for the LUIS Cachine Service.
|
||||
var luisSubscriptionKey = "INSERT YOUR LUIS SECRET KEY HERE";
|
||||
var luisAppId = "INSERT YOUR LUIS APPLICATION ID HERE";
|
||||
var mobileAppUri = "https://INSERT-YOU-APPSERVICE-NAME-HERE.azurewebsites.net";
|
||||
var luisregion = "westus"; // Must match the exact region spelling where you deployed your LUIS service
|
||||
|
||||
_processor = new TextProcessor(luisAppId, luisSubscriptionKey, mobileAppUri);
|
||||
|
||||
_processor = new TextProcessor(luisAppId, luisSubscriptionKey, mobileAppUri, luisregion);
|
||||
}
|
||||
|
||||
private async void submitButton_Click(object sender, RoutedEventArgs e)
|
||||
|
|
|
@ -37,7 +37,7 @@ namespace LuisCacheLib
|
|||
|
||||
//private static TextProcessor instance = null;
|
||||
|
||||
public TextProcessor(string luisAppId, string luisSubscriptionKey, string mobileAppUri) //:base()
|
||||
public TextProcessor(string luisAppId, string luisSubscriptionKey, string mobileAppUri, string luisregion) //:base()
|
||||
{
|
||||
this.mobileAppUri = mobileAppUri;
|
||||
this.luisAppId = luisAppId;
|
||||
|
@ -64,8 +64,7 @@ namespace LuisCacheLib
|
|||
|
||||
bool preview = true;
|
||||
|
||||
_client = new LuisClient(luisAppId, luisSubscriptionKey, preview);
|
||||
|
||||
_client = new LuisClient(luisAppId, luisSubscriptionKey, preview, luisregion);
|
||||
}
|
||||
|
||||
//private TextProcessor()
|
||||
|
|
|
@ -235,6 +235,7 @@
|
|||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="Properties\PublishProfiles\luiscacheey42of7tswuvs - Web Deploy.pubxml" />
|
||||
<None Include="Properties\PublishProfiles\luiscachen7vjs63ikakmo - Web Deploy.pubxml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\LuisCacheModel\LuisCacheModel.csproj">
|
||||
|
|
|
@ -51,6 +51,10 @@ LUIS Caching Service includes the following components:
|
|||
* In the App Service publishing dialog that appears, select your subscription and expand the resource group you created during the ARM template deployment.
|
||||
* Select the App Service under that group. There should be only one, named using the prefix you selected with a random suffix appended.
|
||||
* Select the **OK** button to start deployment.
|
||||
8. Repeat the steps above to publish the project **LuisCacheFunctions** to the Azure Function that was created for you. Note that functions are also published as Azure App services. The existing function name will start with your prefix, followed by the same random suffix, and ends with "func".
|
||||
8. Select the Cognitive Service that was created by the ARM template deployment process. In the **Quick Start** section, open the [Language Understanding Portal](https://www.luis.ai/). Once authenticated, open the LUIS model you want to use with the caching service, or [create a new model](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/). Once your model is ready, select the option to [Publish](https://docs.microsoft.com/en-us/azure/cognitive-services/luis/publishapp) your LUIS model. Under **Resources and Keys**, add a new key and select the tenant, subscription name and key settings that match the new Cognitive Service that was just created for you. Once the new key is added, **Publish** your model. Make note of the LUIS Application ID and secret subscription key since you will need them below.
|
||||
9. Open the client components solution **LuisCacheClient.sln** and edit the file **Mainpage.xaml.cs** in the UWP client project **LuisCacheClient**:
|
||||
* In the **MainPage()** constructor, populate the three variables with your LUIS Subscription key, LUIS App Id, and App Service web uri. Note that while the LUIS service was created for you by the ARM template, you'll have to build your own LUIS model [in the LUIS portal](https://www.luis.ai) and publish it to Azure.
|
||||
* In the **MainPage()** constructor, populate the three variables with your LUIS Application ID, secret subscription key, and App Service web uri. Note that while the LUIS service was created for you by the ARM template, you'll have to build your own LUIS model [in the LUIS portal](https://www.luis.ai) and publish it to Azure.
|
||||
10. Run the LUISCacheClient UWP app locally on your computer. Type an utterance that matches your LUIS model and click the **Submit Utterance** button. The app will display the macthing intent and entities as returned by LUIS. The second part of the result indicates if the result came from the LUIS service (*false*) or from the cached data (*true*). Your first entry will always be *false* since the cache starts empty. Resubmit the same utterance and the caching result should display *true*.
|
||||
11. Congratulations! Your LUIS Caching Service is now up and running, and ready to be integrated in your UWP and Windows Mixed Reality projects.
|
||||
|
||||
If you have questions or if you discover issues with this solution, please file an issue here on GitHub.
|
Загрузка…
Ссылка в новой задаче