Azure-Samples / cognitive-services-qnamaker-java

Using the Microsoft QnA Maker API -- samples in Java.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

page_type description languages products
sample
These REST samples show you how to programmatically create, update, publish, and replace a QnA Maker knowledge base.
java
azure
azure-cognitive-services

Cognitive Services QnA Maker Samples in Java

These REST samples show you how to programmatically create, update, publish, and replace a QnA Maker knowledge base, amongst many other ways to interact with it. All samples are in Java. To view these same samples in other languages:

cognitive-services-qnamaker-csharp

cognitive-services-qnamaker-nodejs

cognitive-services-qnamaker-python

Features

Included are the following samples:

All REST samples revolve around what you can do with a knowledge base, which is made up of FAQs or product manuals where there is a question and an answer. QnA Maker gives you more control over how to answer questions by allowing you to train a chat bot to give answers in a variety of ways that feels more like natural, conversational exchanges.

Getting Started

Prerequisites

For each sample, a subscription key is required from your Azure Portal account.

With the exception of creating a new knowledge base, these samples will require your QnA Maker account knowledge base ID. To find your knowledge base ID, go to My knowledge bases and select View Code on the right. You'll see the http request and your knowledge base ID is in the topmost line: for example, POST /knowledgebases/2700e6b9-91a1-41e9-a958-6d1a98735b10/.... Use only the ID.

Run the sample

  1. Use your favorite IDE for this sample. IntelliJ IDEA is used here. This IDE has a free evaluation version.

  2. Create a new Java project, using the SDK 10. The simplest way to test these samples is to add a new class to the project's src folder for each sample.

  3. Copy/paste the sample code into the corresponding class.

  4. Add the Google GSON library to your Java project, either by manually creating & importing the .jar file or adding a dependency to your preferred project management tool, such as Maven.

  5. Add your subscription key (from Azure portal) and (if applicable) your knowledge base ID (from qnamaker.ai) as requested in the variables at the top of the class.

  6. Run your project.

Quickstart

References

QnA Maker V4.0

About

Using the Microsoft QnA Maker API -- samples in Java.

License:MIT License


Languages

Language:Java 96.8%Language:Dockerfile 3.2%