Can we store multiple values in a single Entity Slot?

Hi, Can i extract multiple slot values from a single user phrase for e.g -

U- i want to view ticket details for ticket id’s TS78945612 & TS98745612

Here if possible how can i set these ticket id’s on my slot so that i can extract these id’s and fetch to my API for response. If yes how can i achieve it.

1 Like

Check the slot type list

but how multiple entity values will be picked from a single phrase ???

It uses the same entity names, if you put slot type as list, for the same entity name and slot name - values will be filled your NLU replies with multiple pairs of key: entity_name, value:XYZ, and for a list slot type, it will look through the entity name and store all it’s value in the list. I never need to have list slots though i suppose this is how it should be given the code

Check it out.

1 Like

thanks i will try it out :slight_smile:

hi @NikhilBansal21 i have the same question,have you solved your problem

1 Like

@Maosandian yes i followed the steps told by souvik and it works

how to train th data for the ListSlot?

Hi Nikhil,

Could you please share a sample of nlu.md where you use this list type slot? I am trying to implement the same. Here is what I have in nlu.md-

##intent: allocation what is the allocation to planning, development and implementation

then in my domail.yml, i have-

entities:

  • allocation_bucket

slots: allocation_bucket: type: list

then I trained my nlu and core model. But it is not able to extract the allocation_bucket slot values for the above example in nlu.md

Any thoughts or suggestions?

Thank you, Shruti

Sorry, my bad. I had typo in the code. Else the above stuff works. ~Shruti

Hey, How to write slot in list format? Can you Show me how to write slot in list ?

Hey Nikhil , How to write slot in list format? Can you Show me how to write slot in list ? Can you Show example here ? Thanks Buddy

“nlu.md”

intent:inform_cuisine


“domail.yml”

intents:

  • inform_cuisine

entities:

  • cuisine

slots: cuisine: type: list


Bot: What cuisine you would like to have? User: get me some ice cream and coffee

and in slots you get cuisine: [‘ice cream’, ‘coffee’]