question

jdallas avatar image
jdallas asked

'Or' function in utterances

Hello Folks,

I have two sample utterances:

"Find food in the county fair"

and

"Find food at the county fair".

Obviously, these are pretty much the same utterance, but I rather not junk up my model with an extra utterance. Is there a way in my Alexa model, I can have something like an 'or' operator as seen in the example below?

          "name": "FindFairFoodIntent",
          "slots": [],
          "samples": [
            "Find food in|at the county fair"
          ]
        },		<br>
alexa skills kitinteraction modeldialog modelutterances
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Flo avatar image
Flo answered

I usually build my utterances like this:

"Find food {preposition} the county fair"

and then add a slot type "LIST_OF_PREPOSITIONS" with all prpositions I can think of.

2 comments
10 |5000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Is it possible for one of the entries for preposition is nil? That is, I would like to use this approach with optional "the". Like, what is blah blah . . .. what is the blah blah

Is that possible?

0 Likes 0 ·

Hello @Bobby K. and thanks for the message.

To deal with the user not saying any proposition, you could have both samples listed under your intent. The example below doesn't make much sense, but shows the point:

"Find food {preposition} the county fair",
"Find food the county fair"

Regards,
Barry

0 Likes 0 ·