Watson Conversation Service using slots with operators

ぐ巨炮叔叔 提交于 2019-12-11 03:43:46

问题


I'm using slots for some situations, and for one of this I need to check if slot recognized a entity or a context variable.

To do it I wrote @myEntity || $MyVar into the "Check" column, and put $MyVar into "Save it as" column.

The problem is, when the WCS goes to this slot, my variable$MyVar is being populated with || as a prefix, resulting in || ValueFromMyVar.

I did not find any restrictions to use variables on slots and also did not find restrictions about operators usage '|| &&'.

Can I use these operators as a slock check condition?

If there is no restriction, Why am I getting the wrong value?

Example Screen:


回答1:


The short answer is what you have above won't work. Slots does not process conditions, as it is trying to match a value.

Also you are checking for a variable, that if it has a value will just put the value back into itself.

If that is your intended action, then you can overload the variable with multiple slots. For example.

This will take the current value if it exists and leave it in the variable. Otherwise it will see if the entity was typed in and then assign it to the variable.

This will work with intents as well, but not conditions.

Disclaimer: This is observed behaviour, but I found no documentation on it. Depending on what development come back to me on it, this may either be a side effect, or a feature.



来源:https://stackoverflow.com/questions/45843805/watson-conversation-service-using-slots-with-operators

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!