Managing class in not working as expected

We defined a class in Manage class option
And tried using it while defining a Term in ‘User Says’ section of FQA but on training the bot and on testing it the defined class keyword are not getting interpreted

@shobhit1.singh Could you please provide us snapshots of your Knowledge Graph Ontology configuration? The utterances added at classes, the terms associated with the class and the FAQ under the terms could help us debug more on the issue

Thanks @Subrahmanyam for your response.
As of now we managed the class issue. Below is our BOT ontology.

ontology

Further on this,
we need BOT response like below when user is not able to fetch any details for his query,

"I can do following things for you and provide all ontology child nodes in response if they click on that node it will go to answer of that node"

FYI, I gone through all standard response but it is having only list of FAQs, not ontology child nodes.

Could you please help us to achieve this functionality?

Thanks in advance.

Hi @shobhit1.singh, Please check if the below configuration could help:

  1. Configure a dialog intent not found in your bot of type hidden.
  2. At intent not found dialog, have a message node to present a template which shows the Nodes at KG as elements to the users.
  3. Configure the template at message node to pass the payload as intended at each of the elements/ Nodes. (You could pass the FAQ or even pass the terms which help identify the path and show suggestions upon selecting of element )
  4. Now under the NL section, at default dialog, set intent not found as the default dialog (This dialog is triggered when bot couldn’t identify the user intent based on the utterance passed)

During runtime, when the intent is not identified by the bot, the intent not found dialog is executed and the message template is presented. Based on the user selection of the node, the payload as configured at the element as is sent to bot and the response is delivered to the user.

The reason I ask you to send FAQ or terms as payload at nodes of the template is that, ontology is based on the number of terms present in the user utterance to identify the path and passing only the node name shouldn’t be of much help.

Thanks @Subrahmanyam for your response.
I have created hidden dialog intent with name “intent not found” and this dialog is associated to one message node.
But not able to find the way, how message node can present a template which shows the nodes at KG as elements to the users.

Also not aware how to achieve this part:
Configure the template at message node to pass the payload as intended at each of the elements/ Nodes. (You could pass the FAQ or even pass the terms which help identify the path and show suggestions upon selecting of element )

Could you please help on this?
Thanks in advance.

Hi @shobhit1.singh,

Please find the below example and screenshots to achieve your requirement:

STEP-1: Getting the Ontology structure.

  • In the Knowledge collection, you will have an “export” option on the top-right corner menu.
  • Export as a JSON file.

STEP-2: Integrating the Knowledge collection data with a message node.

  • In the respective bot, create a new dialog task named “Intent not found”. Open advanced settings and select "Hide from Help ".
    Screenshot

  • In this dialog task, add a new “message node” after the default “user intent” node.

  • Open “Manage Responses” in the “Message node” settings.

  • Add a default message for “All channels”. Then click on “Add Bot response”.

  • Select the Channel as “Web/Mobile Client”.

  • Switch to the “Javascript” tab in the editor, you can observe a “select template” drop-down.
    Screenshot

  • Select “Quick replies” for now. (You may select the required template of your choice)

  • Javascript code with default syntax would be auto-generated.

  • You may observe that the “payload” object, provide a value to the “text” key. (You can write a message which you would want to display).

  • Add a new javascript variable “quickReplies”(Array) and copy & paste the JSON structure from the Knowledge collection JSON file.
    Screenshot

  • You can observe a for-loop, change the title to “quickReplies[i].terms[0]” . Ideally, the Knowledge collection will have the node names as the first element in the “terms” array. Hence, to display node names, we have selected the above snippet. (You may traverse the JSON as per your requirement).

  • Similarly, to the payLoad.
    Screenshot

  • Now under the NL section, at “default dialog”, set intent not found as the default dialog (This dialog is triggered when bot couldn’t identify the user intent based on the utterance passed)

Let us know if you need any further clarification on the above.

Regards,
Yoga Ramya,
Kore Support Team.

1 Like

Thanks @yogaramya.mendu for your detailed steps.
But getting below error.
msgerror

This is my ontology JSON format:
{“faqs”:[{“question”:"",
“answer”:[],
“terms”:[],
“tags”:[],
“alternateQuestions”:[],
“tags”:[]},
{“question”:"",
“terms”:[],
“tags”:[]}

Could you please help on this.

Thanks in advance.

Hi @shobhit1.singh,

We observe from the screenshot that the Knowldge graph JSON structure provided to the quickReplies variable has the faqs Array first and in this array, the questions and answers are provided.

We request you to remove the faqs array(quickReplies expects the Array of objects directly) and please make a note of the brackets to be removed at end of the JSON.

Kindly refer the attached screenshot for better understanding:
quickReplies

Also, providing the JSON structure below:

var quickReplies = [{
“question”:“What is a country”,
“alternateQuestions”:[

     ],
     "terms":[
        "Country",
        "TestingCommunity"
     ],
     "tags":[

     ],
     "refId":"06c36827-3b91-519f-8a4f-ebf5638d8f93",
     "responseType":"message",
     "answer":[
        {
           "text":"A country is a region that is identified as a distinct entity in political geography. A country may be an independent sovereign state or part of a larger state, as a non-sovereign or formerly sovereign",
           "type":"basic",
           "channel":"default"
        }
     ],
     "alternateAnswers":[

     ]
  },
  {
     "question":"What is a state",
     "alternateQuestions":[

     ],
     "terms":[
        "State",
        "TestingCommunity"
     ],
     "tags":[

     ],
     "refId":"4b8e3970-f170-55e6-8994-67189844f919",
     "responseType":"message",
     "answer":[
        {
           "text":"A state is a compulsory political organization with a centralized government that maintains a monopoly on the legitimate use of force within a certain geographical territory. Some states are sovereign, other states are subject to external sovereignty or hegemony, ",
           "type":"basic",
           "channel":"default"
        }
     ],
     "alternateAnswers":[

     ]
  },
  {
     "question":"What is a district",
     "alternateQuestions":[

     ],
     "terms":[
        "District",
        "TestingCommunity"
     ],
     "tags":[

     ],
     "refId":"28c84ef4-5e8c-5d84-97b4-7b97c6797664",
     "responseType":"message",
     "answer":[
        {
           "text":"A district is a type of administrative division that, in some countries, is managed by local government. Across the world, areas known as \"districts\" vary greatly in size, spanning regions or counties, several municipalities, subdivisions of municipalities,",
           "type":"basic",
           "channel":"default"
        }
     ],
     "alternateAnswers":[

     ]
  },
  {
     "question":"What is a city",
     "alternateQuestions":[

     ],
     "terms":[
        "City",
        "TestingCommunity"
     ],
     "tags":[

     ],
     "refId":"d234aee3-ce62-563b-87d3-6cd8a0042bee",
     "responseType":"message",
     "answer":[
        {
           "text":"A city is a large human settlement. Cities generally have extensive systems for housing, transportation, sanitation, utilities, land use, and communication. Their density facilitates interaction between people, government organizations and businesses, sometimes benefiting different parties in the process",
           "type":"basic",
           "channel":"default"
        }
     ],
     "alternateAnswers":[

     ]
  }]

Let us know if you need any further clarification.

Regards,
Yoga Ramya.

Thanks @yogaramya.mendu for your detailed steps.

I am able to get ontology child nodes in different way as a response if intent not found. This is the output.

ontology_node

Here you can see in the response,
Let us take example for Email node,
Email node is having all Path Level Synonyms along with Child node name. I need only child node Email as a response, not along with synonyms.

ontology_node_synonyms

Could you please help me on this to get desired response.

Thanks in advance.

Thanks @yogaramya.mendu for your detailed steps.
Further I have removed the path level synonyms from JSON and getting required output.

Could you please suggest how we can modify our response to get it in List view instead horizontally.
I have tried list template but not able to get required output.
Please help.

Hi @shobhit1.singh,

Apologies for the late reply.
We have checked with the list view template. The provision to display a KG answer as we click on a list item is not possible as the list item expects a URL and the “defaultAction” type cannot be changed from “Web-Url”.

Hence, the above scenario of displaying the KG nodes in a list template and view the KG response on clicking it is not possible as of now.

We will communicate these use cases to our engineering team for further action on the message templates.

Also, there is no provision to display quickReplies vertically as list. The template is pre-defined and cannot be modified.

Regards,
Yoga Ramya.

@shobhit1.singh The developers have the provision to configure custom templates for displaying at webSDK . Please refer to the below topic for more details.