从新的 Bot Framework Composer 中获取实体的更好方法?

huangapple go评论45阅读模式
英文:

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:

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.

huangapple
  • 本文由 发表于 2023年3月23日 08:33:17
  • 转载请务必保留本文链接:https://go.coder-hub.com/75818363.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定