2

In this example, Microsoft shows "tuesday to thursday" being recognized by LUIS, which responds with a start and date time. However, when I use the same example with my LUIS, it doesn't send me start or end dates. it just sends me a timex string, which I don't see any documentation on how to convert it to start and end dates in C#, unless I create my own parser, which is like a whole different project for me that I'm sure Microsoft's already done. This is what LUIS returns

{
  "$instance": {
    "datetime": [
      {
        "startIndex": 17,
        "endIndex": 41,
        "text": "from tuesday to thursday",
        "type": "builtin.datetimeV2.daterange"
      }
    ]
  },
  "datetime": [
    {
      "type": "daterange",
      "timex": [
        "(XXXX-WXX-2,XXXX-WXX-4,P2D)"
      ]
    }
  ]
}

On the last line, it gives a string with a bunch of Xs. Why didn't they give start and end time like in the demo? How can I get that? Microsoft also mentions there's a resolution property. I don't receive that resolution property by LUIS.

H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
AskYous
  • 4,332
  • 9
  • 46
  • 82
  • Have you tried the *exact* phrase as given in the example? "Tuesday to Thursday" can be interpreted differently than "FROM Tuesday to Thursday". – user1969177 Jun 27 '19 at 02:08

2 Answers2

1

What is the entire entity section of the response? You should ensure that you are using a datetimev2 entity in your LUIS model, and that it is trained. If all that is done, I'm not sure why it is not responding with a resolution. It should. Does it fail in the test panel? Like you linked here, it should come back with an entity of type datetimev2.daterange, and then should have the resolution.

The timex format only shows the portions that are resolved. It shows that it is a range (P2D. period, two days) from Tuesday (2) to Thursday (4). That's how the timex value should look. You, can find an example on how to use the resolvers in the timex sample here.

Dana V
  • 1,327
  • 1
  • 5
  • 10
0

The LUIS response should contain the resolution you need. But if you really need to manipulate the timex expression to re-resolve, you can re-use the same library as LUIS uses to recognize/resolve datetimes.

https://github.com/microsoft/Recognizers-Text

You can use it's timex resolver or re-interpret the entity in the original sentence.

tellarin
  • 1
  • 3