Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
239 views
in Technique[技术] by (71.8m points)

.net - LUIS Intent not returning the entire value of the entity with space

I have created a LUIS Utterance like this with a simple entity included: orders in process for customer abc

Where abc is replaced with the simple entity vf_NARCName

In the bot when I type the question like: Orders in process for customer Animal Dermatology Hospital

Here the customer name is Animal Dermatology Hospital which is separated by space then when I am fetching the data through LUIS Rest API I am getting Animal as the entity value instead of Animal Dermatology Hospital and some times also no entity value returning

 {
      "query": " orders in process for customer Animal Dermatology Service",
      "topScoringIntent": {
        "intent": "OrderDetails_2a598c9b-7cb5-4113-9aca-435b55bbe19e",
        "score": 0.7547371
      },

Return Data

{
  "query": "how many orders are currently in process for customer Animal Dermatology Service",
  "topScoringIntent": {
    "intent": "OrderDetails_2a598c9b-7cb5-4113-9aca-435b55bbe19e",
    "score": 0.6452578
  },
  "entities": []
}

But if I query it with only Animal then proper data is returning

Return Data

{
      "query": "how many orders are currently in process for customer Animal",
      "topScoringIntent": {
        "intent": "OrderDetails_2a598c9b-7cb5-4113-9aca-435b55bbe19e",
        "score": 0.8928922
      },
      "entities": [
        {
          "entity": "animal",
          "type": "vf_NARCName",
          "startIndex": 54,
          "endIndex": 59,
          "score": 0.500023663
        }
      ]
    }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your LUIS app essentially needs more utterances of how that entity can occur.

I would say stategy 1.) is probably the most useful, but list other options you may include as well to help with your entity detection.


  1. Add more utterances with valuable variations of the vf_NARCName entity

As stated in the First Tutorial in the documentation under "Build App" section, make sure that you include:

  • At least 15 utterances per intent, and within that include different ways of how the entity can appear

and the variations you should be conscious to include are:

  • differences in word order (where the entity can occur within an utterance)
  • tense (like "was", "is", "will be", as shown in this tutorial)
  • grammatical correctness
  • length of both the utterance and of the entity itself (word count)

The last bit is probably one that you should include more examples of. So check your utterances that contain vf_NARCName entities that are of not just 1 word in length, but 2 or 3 or maybe even longer if that's a possibility in your app.


  1. Adding a Phrase List

As docs describing what Phrase Lists are state,

A phrase list includes a group of values (words or phrases) that belong to the same class and must be treated similarly

This is another way you could help send another signal to LUIS to help detect your vf_NARCName entity.

Tutorial on how to add Phrase List here.


  1. Lastly, you may want to look into using Pattern.any

As the Pattern.any docs state here,

use the pattern.any entity to extract data from utterances where the utterances are well-formatted and where the end of the data may be easily confused with the remaining words of the utterance

So if you know that you may have potential vf_NARCName entities that are extremely long in word count for the entity itself, you may benefit from using Pattern.any entity.

For example maybe you had "The Department of People Who like Really Long Names, But Hate Novels" as a vf_NARCName entity. LUIS may have a hard time determining where exactly that entity ends, but can do so with the use of Pattern.any.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...