For partners that build or integrate commercially available applications and service solutions with the Oracle Cloud Platform
For partners that provide implementation or managed services around Oracle Cloud Applications
Hi,
I have a question regarding entities. I have 2 entities, each containing a list of hotels. The entities are called hotelsAreaOne and hotelsAreaTwo. They are all connected to an intent called "staying". When the user types: I am staying at hotel "hotelInAreaOne" the intent resolves correctly to "staying". The expression ${iResult.value.entityMatches['hotelsAreaOne'][0]} returns 'hotelInAreaOne' which is just fine. In the JSON I can also see this works fine:
"entityMatches": {
"hotelsAreaOne": [
"hotelInAreaOne"
]
}
However, what I would like to get hold of, is the actual value of the entity itself, in this case 'hotelsAreaOne'. Not sure if this is possible, but curious to know how to do this.
Thanks
Comment
i think that you can use here the component: "System.MatchEntity"
Be the first to rate this
|
Sign in to rate this
Hi Ameur,
Thanks for your reply. I know that as an alternative I could use 2 individual System.matchEntity states. And this does work, and I used it as a workaround.
However, in the real life bot I have currently 5 "hotelsArea" entities, which results in 5 ocurences of System.SetVariable followed by System.MatchEntity. Because for every nomatch I need to do a new ${iResult.value.entityMatches['hotelsArea<X>'][0]} and a new system.MatchEntity.
So this is getting a bit ugly. Thats why I rather have direct access to the Entityname itself, and use one System.SetVariable followed by a system.Switch.
Don't know if this makes sense, but to me it seems like something one would like to do?
Thanks
Average Rating:



1 rating
|
Sign in to rate this
if i get you it will better to use an entity with a list of your entities names (yourhotelsentities: [hotelsArea1,hotelsArea2.....]).
After that use the ${iResult.value.entityMatches['yourhotelsentities'][0]} to get the name and you can after that use the switch like you wish.
Be the first to rate this
|
Sign in to rate this
Hmmm,
still no success. Here is what happens when I use an entity (Hotels) with a list of entities like this:
HotelsEntity: "HotelsAreaOneEntity": "hotelInAreaOne", "anotherHotelInAreaOne" "HotelsAreaTwoEntity": "hotelInAreaTwo", "anotherHotelInAreaTwo" "HotelsAreaThreeEntity": "hotelInAreaThree", "anotherHotelInAreaThree"
When the user types: I am staying at hotel "anotherHotelInAreaTwo" --> ${iResult.value.entityMatches['HotelsEntity'][0]} it still returns me "anotherHotelInAreaTwo" where I would expect "HotelsAreaTwoEntity".
Looks like I am a tricked here.
Any explanation?
Thanks
Be the first to rate this
|
Sign in to rate this
can you please share the payload here ?
Be the first to rate this
|
Sign in to rate this
Here you go. It says it all. Resolves to entities content, and even child entities content:
"messagePayload": {
"layout": "vertical",
"cards": [<<OMITTED>>],
"type": "card",
"channelExtensions": {
"debugInfo": {
"variables": {
"profile.updatedOn": "2018-08-27T08:14:14.374Z",
"system.invalidUserInput": false,
"profile.lastName": "myName",
"theDate": {
"date": 1535364854000,
"entityName": "DATE",
"originalString": "Aug 27, 2018 10:14:14 AM"
},
"greeting": null,
"iResult": {
"timeStamp": 1535357654441,
"intentMatches": {
"summary": [
{
"score": 1,
"intent": "Staying"
}
],
"detail": {
"final_norm": [
{
"sentence": [],
"score": 1,
"intent": "Staying"
}
]
}
},
"trainingDataUnit": null,
"botName": "Hotels bot",
"appId": "XXXXXX",
"query": "I am staying at hotel at area two",
"entityMatches": {
"HotelsAreaTwoEntity": [
"hotel at area two"
],
"HotelsEntity": [
"hotel at area two"
]
}
},
"user.botsUserError": false,
"profile.locale": "en-US",
"rb": null,
"theHotelArea": "hotel at area two",
"profile.timezoneOffset": -7200000,
"hotels": null,
"profile.firstName": "myFirstName",
"name": null,
"defaultDateInput": "Aug 27, 2018 10:14:14 AM",
"system.processedUserMessage": false
},
"currentDialogState": "acOtherHotels",
"executedStates": [
"setHotelsArea",
"printYourNowVar",
"switchHotelArea",
"acOtherHotels"
]
}
}
},
"userId": "<omitted>"
}
Be the first to rate this
|
Sign in to rate this
can i have your mail i will send you a working example.
Be the first to rate this
|
Sign in to rate this
Hi Ameur,
sure, here you are:
luc dot bors at eproseed dot com.
Thanks for your effort.
Luc
Be the first to rate this
|
Sign in to rate this
Ah very nice,
that might just work. I will try that later today and let you know.
Thanks
Average Rating:



1 rating
|
Sign in to rate this
you are welcome
Be the first to rate this
|
Sign in to rate this
Hi Ameur,
Thanks for your help. It works. It uses a different approach.
I was expecting entity with list of entities. The working solution uses a value list entity with canonical names and synonyms. So as listed below:
HotelsEntity: --> value --> "HotelsAreaOne" --> synonyms --> "hotelInAreaOne", "anotherHotelInAreaOne"
--> value --> "HotelsAreaTwo" --> synonyms --> "hotelInAreaTwo", "anotherHotelInAreaTwo"
--> value --> "HotelsAreaThree" --> synonyms --> "hotelInAreaThree", "anotherHotelInAreaThree"
When the user types: I am staying at hotel "anotherHotelInAreaTwo" --> ${iResult.value.entityMatches['HotelsEntity'][0]} returns "HotelsAreaTwo"
Thanks
Average Rating:



1 rating
|
Sign in to rate this
Be the first to rate this
|
Sign in to rate this