botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[LUIS] Pre-built Entities builtin.datetimeV2.daterange doesn’t exist in the selected application.

Open mukeshps25 opened this issue 9 years ago • 4 comments

System Information

  • SDK Language: node.js, LUIS, cognitive-services
  • SDK Version: [email protected]
  • Development Environment: LOCALHOST, production

Issue Description

I'm working on add utterance to LUIS application using cognitive services (LUIS Programmatic API) Add label.

If you check my luis.ai I have already added the pre built entity called datetimeV2 prebuilt

Code Example

curl -v -X POST "https://westus.api.cognitive.microsoft.com/luis/api/v2.0/apps/{appId}/versions/{versionId}/example"
-H "Content-Type: application/json"
-H "Ocp-Apim-Subscription-Key: {subscription key}"
--data-ascii "{body}"

Steps to Reproduce the Issue

  1. Enter the utterance text label to my skype client. (Give me cxxxxxxr order xxxxxx for xxx xxx Chxxse from 02/05 to 05/06)
  2. Pass to end point URL to know the best match intent and entity.
  3. Validate required data and again pass to LUIS Programmatic API Add label
{ "text":"Give me cxxxxxxr order report for xxx xxx Chxxse from 02/05 to 05/06",
  "intentName":"showxxxxxx",
  "entityLabels" :[
    {"entityName":"hierarchy",
    "startCharIndex":8,
    "endCharIndex":21},
    {"entityName":"builtin.datetimeV2.daterange",
    "startCharIndex":49,
    "endCharIndex":67},
    {"entityName":"builtin.number",
    "startCharIndex":54,
    "endCharIndex":58},
    {"entityName":"builtin.number",
    "startCharIndex":63,
    "endCharIndex":67},
    {"entityName":"comxxxyxxx",
    "startCharIndex":34,
    "endCharIndex":47}
  ]
}
  1. When I send request it return me an error.

Expected Behavior

It should add the utterance for showxxxxxx intent and assign the entity.

Actual Results

error message showing me with status code 400

Error: The entity extractor builtin.datetimeV2.daterange doesn’t exist in the selected application

mukeshps25 avatar Jul 26 '17 10:07 mukeshps25

Can you try doing this GET request just to verify that the entity is on the model via the authoring API? That aside, I haven't repro'd this yet, but I'm wondering if it might be an issue with assigning its child, "daterange". Have you tried just using "builtin.datetimeV2"?

stevengum avatar Jul 26 '17 16:07 stevengum

@stevengum97 Thanks for your reply. I was surprised because It was working previously but suddenly it is giving me an error.

I followed your mentioned steps and results are follows:

I have made two request one which you mention GET request and another one to know project Assign pre built Entity

  1. GET request it returns me all the pre built entity. allprebuilt

  2. Assign pre built Entity This API returns me my project assign entity only onlyprebuilt

  3. As you mention I pass the builtin.datetimeV2


{ "text":"Give me cxxxxxxr order report for xxx xxx Chxxse from 02/05 to 05/06",
  "intentName":"showxxxxxx",
  "entityLabels" :[
    {"entityName":"hierarchy",
    "startCharIndex":8,
    "endCharIndex":21},
    {"entityName":"builtin.datetimeV2",
    "startCharIndex":49,
    "endCharIndex":67},
    {"entityName":"builtin.number",
    "startCharIndex":54,
    "endCharIndex":58},
    {"entityName":"builtin.number",
    "startCharIndex":63,
    "endCharIndex":67},
    {"entityName":"comxxxyxxx",
    "startCharIndex":34,
    "endCharIndex":47}
  ]
}

Still showing me the same error.

Error: The entity extractor builtin.datetimeV2 doesn’t exist in the selected application

enitityerror

mukeshps25 avatar Jul 27 '17 04:07 mukeshps25

So this was a mistake on my part, but when labeling via Authoring API users are not to use "prebuilt" when using prebuilt entities. Instead you should just label as "datetimeV2", "number", etc.

Here is an example using the JSON you provided in your last comment:

{ "text":"Give me cxxxxxxr order report for xxx xxx Chxxse from 02/05 to 05/06",
  "intentName":"showxxxxxx",
  "entityLabels" :[
    {"entityName":"hierarchy",
    "startCharIndex":8,
    "endCharIndex":21},
    {"entityName":"datetimeV2",
    "startCharIndex":49,
    "endCharIndex":67},
    {"entityName":"number",
    "startCharIndex":54,
    "endCharIndex":58},
    {"entityName":"number",
    "startCharIndex":63,
    "endCharIndex":67},
    {"entityName":"comxxxyxxx",
    "startCharIndex":34,
    "endCharIndex":47}
  ]
}

stevengum avatar Jul 28 '17 16:07 stevengum

@stevengum97 It works :+1:

Thanks for your reply. I'm going to close this issue.

mukeshps25 avatar Jul 31 '17 03:07 mukeshps25