Natural Language Understanding (NLU) Tutorial - Discussion

Greetings,
I loved the presentation that was given in this webinar. The engine looks to be very intuitive and elegant. The example given though of flights & hotels did leave me begging a question. Rather than digging in and burning cycles I figured I’d ask to see if anyone knew the answer to my question, before seeking it out myself.

Given this statement:

I would like to reserve a flight and a hotel for phoenix

It output exactly what I thought would happen:

[
    {
        "Input": "I would like to reserve a flight and a hotel for phoenix",
        "NLParse": {
            "book": "air",
            "city": "phoenix"
        },
        "heuristic_score": 23,
        "index": 0
    }
]

The problem being that the wildcard “$*” in between the flight and location would gobble up the hotel bit and only the flight would show. This problem is interesting to me, because it presents a situation that I feel occurs frequently and naturally in human speech.

Does jibo support some sort of syntax to combine the set of both rules? Something like an & operator or something? If so is it expressive / smart enough to know that the order of these rules is inconsequential? Would be nice to not have to write to separate rules to handle both circumstances.

Good work! Loving it so far!

One of the easiest ways to account for variability like this is to use ? to declare an optional section that references the same or similar subrule. I added an optional section to the hotel/flight example here that illustrates that:

TopRule = $* (
    $flight {book='air'} |
    $hotel  {book='lodging'}
) $*

?(
    $flighttwo {booktwo='air'} |
    $hoteltwo  {booktwo='lodging'}
)

for my friend $person{name=person._name};

flight = reserve $* flight;
hotel = reserve $* hotel;
flighttwo = flight;
hoteltwo = hotel;

person @= (+$w){_name = _parsed};

Using that you can account for someone saying “I would like to reserve a flight for my friend John Smith” or “I would like to reserve a hotel and flight for my friend John Smith.” Ultimately that can be used to account for situations where someone might provide more data/answers to Jibo but you don’t want the parsing of the rule to depend on it.

3 Likes