2
votes

I'm trying to build a "search intent" for books/articles.

I created a book-tag which has all predefined tags of our books.

book-tags-entity

I created another entity named "intent-action"

intent-action-entity

and a entity for search term:

search-term-should-match-whatever-else-entity

Now, I want to have a intent which will could understand what's user searching for.

For example:

Input: search medical book of diabetes

Expected output:

Intent-action: "search" correct

Book-tag: "medical" correct

Search-term: it should match anything else, for this example, it should be "book of diabetes".

search-book-intent

Is there any chance of making this happen?

Update 1: with @sys-any

Thanks for helping.

I try with "sys-any". It works with predefined search-term. I manually map "book of diabetes", "article of copd", " book of headache" to sys-any,

but it still can't recognize any new search-term.

try with sys-any

Update 2, response from Dialogflow support

Thanks for reaching out to Dialogflow support.

Currently, Dialogflow doesn't provide such ready-to-use functionality. You may enable fulfillment for the intent and try developing your own custom business logic in the fulfillment code to process the parameter values and original user query text from the request sent from Dialogflow and send results back to Dialogflow as responses.

Update 3, working solution here.

In dialogflow intent -> training phrases

There are 2 different training model here, "Example model" & "Template model".

What we need is "Template model", and set a template "@sys.any:search-term @intent-action:intent-action @sys.any:search-term "

Done.

1
sry, don't have enough reputation to post image here.Kangning Wan
did you try system entity to capture anything - @sys.any ?Abhinav Tyagi
Yes, but it seems to only work for predefined search-terms.Kangning Wan
Try to use Default-Fallback and in webhook see if you are capturing user query using regex else respond back with the fallback message.Abhinav Tyagi
Yes, I think this is only solution here. Thanks for helpKangning Wan

1 Answers

1
votes

Yes, you can make the "diabetes" and "copd" terms of entity type @sys.any. To do this, you can select the word in your test phrases and type in or select @sys.any. It should look something like this when you're done:

enter image description here

If you wish, you can change the parameter name from "any" to another name that makes more sense.

Update 1

You need to manually select the phrase, so for the one in your updated example, you need to select it and set it to @sys.any.

Keep in mind that your sample phrases are just that - samples. They won't be what it specifically looks for. By marking it for the @sys.any Entity type, you're saying that anything will match for that parameter.

You might also need to select "required" for your case.

Typically, @sys.any works best when there are other words that are also excluded from it, but are part of the phrase. Trying to capture "everything else" is difficult, and usually not what you want. Do you really want to capture the "of" part of the phrase? Should "article" or "book" be their own Entity type and the subject be the @sys.any parameter?