How to pupulate a slot of type list

@Arno - if you have already configured the slot as type: list, you should simply be able to annotate your training examples in a very straightforward way.

Let’s say the slot that you’re using is topicList. I would annotate your example as -

I would like to subscribe to [topic_1](topicList) and [topic_2](topicList)

If you do so, you’ll get a single list object called topicList that contains both ‘topic_1’ and ‘topic_2’.

topicList:['topic_1', 'topic_2']

In effect, you can use more training examples to let the entity recognition itself add the slots to a list.

To remove a list item from a list however, you would need to run a custom action after you identify the right intent. So if the user says -

Could you replace topic_2 with topic_3?

You can annotate it under a new intent as “replace_topic” as

Could you replace [topic_2](topicToBeRemoved) with [topic_3](topicList)?

You can then use a custom action after replace_topic to remove topicToBeRemoved from topicList.

Does this help?

1 Like