英文:
Better way to get entities from new CLU in Bot Framework Composer?
问题
Exploring cutting over from LUIS to CLU in BotFramework Composer.
In general hooking it up was easy which is nice.
Just want to check in on the best / easiest way to set properties from entities detected:
- for LUIS,
@myEntity
was the way - for CLU it seems we need
=first(turn.recognized.entities.myEntity).text
for a normal entity and=first(first(turn.recognized.entities.myEntity).extraInformation).key
for a phrase list item.
If you know a shortcut, love to hear it.
I tried @myEntity
and it did not work
I tried
=first(turn.recognized.entities.myEntity).text
for a normal entity and=first(first(turn.recognized.entities.myEntity).extraInformation).key
for a phrase list item.
This works but is long. I would be happy to hear if someone found a better way.
英文:
Exploring cutting over from LUIS to CLU in BotFramework Composer.
In general hooking it up was easy which is nice.
Just want to check in on the best / easiest way to set properties from entities detected:
- for LUIS,
@myEntity
was the way - for CLU it seems we need
=first(turn.recognized.entities.myEntity).text
for a normal entity and=first(first(turn.recognized.entities.myEntity).extraInformation).key
for a phrase list item.
If you know a shortcut, love to hear it.
I tried @myEntity
and it did not work
I tried
=first(turn.recognized.entities.myEntity).text
for a normal entity and=first(first(turn.recognized.entities.myEntity).extraInformation).key
for a phrase list item.
This works but is long. I would be happy to hear if someone found a better way.
答案1
得分: 0
Ok. 以下意味着我现在可以用dialog.e替换@,而旧的LUIS代码将起作用:
对话SetEntities只是循环遍历返回的每个实体,确定它是否是短语列表项,然后将其作为对象返回到原始对话,其中它将被设置为dialog.e。为什么是e?简洁。如果BFC能直接这样做会更好。
英文:
Ok. The following means I can now replace @ with dialog.e. and old LUIS code will work:
- make a new dialog called SetEntities
- call it at each intent
- pass it indicesAndValues(turn.recognized.entities)
The dialog SetEntities just loops through each entity returned, works out whether it's a phrase list item or not, and then returns it as an object to the original dialog where it gets set in dialog.e. Why e? Short. Preferrable if BFC did this out of the box.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论