Skip to content

Custom question answering Json

Item Name: Custom Question Answering JSON

Category: Cognitive

Description: Allows handling the knowledge base (questions and answers) created in the Microsoft Azure portal in JSON format.

Functionality: Displays questions and answers from the knowledge base in JSON format, all in a single set. It is mainly used by developers to parse the delivered information and use it within the logic of the cognitive flow.

Requirements:

  • Build Resource: Access the Microsoft Azure portal (portal.azure.com) in the Create Resource section. For more information, refer to Azure AD B2C.
  • Build Items, each with their respective questions or possible answers: For further guidance.
  • For some of the following fields, locate in the Azure AI / Language Studio / Custom Question Answering section under Deploy Knowledge Base. There, you should find the option to Get Prediction URL, which opens a pop-up window with the necessary data.

Configuration Fields (Required)

[Evaluation Expression]: A string field where an expression, either in the form of an entity or a quoted expression, must be entered for evaluation.

[QNA MAKER EndpointKey (Optional if AUTHORING_KEY is not available)]: A string field where authorization keys for connection configuration should be entered. Obtain this in the Microsoft Azure environment by locating the created resource and selecting the option Keys and Endpoint:

[OCP-APIM-SUBSCRIPTION-KEY]: A string field where the subscription keys for connection configuration should be entered. This is obtained from the pop-up window Get Prediction URL.

[PROJECTNAME]: A string expression field where the project name is defined. This is obtained from the pop-up window Get Prediction URL.

[DEPLOYMENTNAME]: A string expression field indicating the unique name that identifies the deployment instance. This is obtained from the pop-up window Get Prediction URL.

[Entity where the menu will be saved]: When the response is a menu, this drop-down list field allows selecting the entity where the menu will be saved.

[Intent to execute in case of an error. The action flow will be interrupted, and the error description will be passed to the selected intent with the name: 'QNA_MAKERV2_ERROR.]: A drop-down list where the entity name for error handling should be selected.

Custom Question Answering Implementation Example

--Prerequisites:

Created Resource: xxxxxx

Item: Menu

Response:

  • Other available plans
  • Go to Offers

--Input

[Evaluation Expression]: 'Hello'

[QNA MAKER EndpointKey (Optional if AUTHORING_KEY is not available)]: 'https://xxxxxx.cognitiveservices.azure.com'

[OCP-APIM-SUBSCRIPTION-KEY]: x56797vv98vc6cv789ooo

[PROJECTNAME]: 'Project_1'

[DEPLOYMENTNAME]: 'Production'

[Entity where the menu will be saved]: MENU_2

[Intent to execute in case of an error. The action flow will be interrupted, and the error description will be passed to the selected intent with the name: 'QNA_MAKERV2_ERROR.]: ERROR_Project_1

--Result: MENU_2 <--

{
"Answers": [
    {
    "Questions": [
        "Double service package test",
        "I want to hire a service package",
        "hello, I need to hire",
        "I want to hire multiple services"
    ],
    "Answer": "Double:|Choose the most convenient offer [**here**](http://XXXXXX.cl/offers)|Choose an option or write your query",
    "Confidence": 0.08220000000000001,
    "QnaId": 16600,
    "Source": "1000_Hire_26xxxx22",
    "Metadata": {
        "cat": "hj",
        "sub": "gjhjhj",
        "key": "rwer"
    },
    "Dialog": {
        "IsContextOnly": false,
        "Prompts": [
        {
            "DisplayOrder": 0,
            "QnaId": 1234,
            "DisplayText": "Other available plans"
        },
        {
            "DisplayOrder": 0,
            "QnaId": 1235,
            "DisplayText": "Go to Offers"
        }
        ]
    },
    "ShortAnswer": null
    }
]
}