microsoft / botframework-cli

CLI Tools for the Microsoft Bot Framework
Other
176 stars 129 forks source link

bf luis:generate:cs generate entity type in C# code not match with the luis predicted result #699

Closed xhr0804 closed 4 years ago

xhr0804 commented 4 years ago

Versions

@microsoft/botframework-cli/4.9.0-preview.113642 win32-x64 node-v12.14.1

Describe the bug

I have a luis model in schema 6.0.0, I use bf luis:convert to convert it to .json, and then use bf luis:generate:cs to generate a C# source code. But when I use a luis recognizer to recognize a query from luis service, I get an error. Seems it is because the "genre" field in C# source code is string[] image but the luis predicted result is "genre":[["genre_list"]] image

After I change the string[] to string[][] manually, it is resolved.

To Reproduce

Steps to reproduce the behavior:

  1. Use this .lu file
> LUIS application information
> !# @app.name = MusicSkill
> !# @app.versionId = 0.1
> !# @app.culture = en-us
> !# @app.luis_schema_version = 6.0.0

> # Intent definitions

## PlayMusic
- {@MusicParent={@beforeMusic=play} {@music=adeles} {@afterMusic=latest album}}
- {@MusicParent={@beforeMusic=play} {@music=prince}}
- {@MusicParent={@beforeMusic=play} {@genre=schlager}}
- {@MusicParent={@beforeMusic=can you play} {@inBetweenMusic=rihanna} {@afterMusic=please?}}
- {@MusicParent={@beforeMusic=can you play} {@genre=boi}
- {@MusicParent={@beforeMusic=can you play} {@music=crazy beautiful}}

> # Entity definitions

@ ml MusicParent 
    - @ ml beforeMusic
    - @ ml afterMusic
    - @ ml music
    - @ ml inBetweenMusic
    - @ GenreList genre

> # PREBUILT Entity definitions

> # Phrase list definitions

> # List entities

@ list GenreList = 
    - genre_list :
        - schlager
        - deathrash metal
        - boi
        - drill music

> # RegEx entities
  1. use bf luis:convert to convert it to .json
  2. use bf luis:generate:cs to get a C# resource code, named as "MusicSkillLuis"
  3. use a luis recognizer to recognize the luis result from the luis service. luisrecognizer.RecognizeAsync<MusicSkillLuis>

Expected behavior

Give a clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

[bug]

axelsrz commented 4 years ago

Thanks @xhr0804 for submitting this issue, we will triage a potential fix for next release