-
Notifications
You must be signed in to change notification settings - Fork 123
bf luis:convert wrongly assigns features found on ml entities in the input to intents in the output #874
Description
Versions
What CLI version are you using: 4.9.1
What Nodejs version are you using: 12.18.2
What command-line interpreters are you using: bash, powershell
What OS are you using: Windows, Ubuntu
Describe the bug
bf luis:convert does not convert from .lu to .json correctly if the model use machine learned entities that have features. Any features that are attached (separately) to ml entities in the source model, get grouped together and then are attached to all the intents after conversion.
For example:
In the .lu, each child entity of the weather-request ml entity uses a feature:
> # Entity definitions
...
@ ml weather-request
- @ ml GeographicPoi usesFeature geographyV2
- @ ml Country usesFeatures geographyV2,CountryPL
- @ ml ConditionDescription usesFeature ConditionDescriptionPL
- @ ml ConditionTemperature usesFeature ConditionTemperaturePL
- @ ml CurrentLocation usesFeature CurrentLocationPL
- @ ml TimeRange usesFeature datetimeV2
- @ ml City usesFeature geographyV2
- @ ml State usesFeature StatesList
- @ ml SpatialRelation usesFeature SpatialRelationPL
...After converting to JSON, it should look like this:
{
"luis_schema_version": "7.0.0",
"intents": [
{
"name": "GetWeather",
"features": []
},
{
"name": "None",
"features": []
}
],
"entities": [
{
"name": "weather-request",
"children": [
{
"name": "GeographicPoi",
"children": [],
"features": [
{
"modelName": "geographyV2",
"isRequired": false
}
]
},
{
"name": "Country",
"children": [],
"features": [
{
"modelName": "geographyV2",
"isRequired": false
},
{
"featureName": "CountryPL",
"isRequired": false
}
]
},
...But after converting to JSON using the bf cli tool, all of those features are erroneously attached to all of the intents:
{
"intents": [
{
"name": "GetWeather",
"features": [
{
"featureName": "ConditionTemperaturePL",
"isRequired": false
},
{
"featureName": "CurrentLocationPL",
"isRequired": false
},
{
"featureName": "ConditionDescriptionPL",
"isRequired": false
},
{
"featureName": "SpatialRelationPL",
"isRequired": false
},
{
"featureName": "CountryPL",
"isRequired": false
}
]
},
{
"name": "None",
"features": [
{
"featureName": "ConditionTemperaturePL",
"isRequired": false
},
{
"featureName": "CurrentLocationPL",
"isRequired": false
},
{
"featureName": "ConditionDescriptionPL",
"isRequired": false
},
{
"featureName": "SpatialRelationPL",
"isRequired": false
},
{
"featureName": "CountryPL",
"isRequired": false
}
]
}
],
"entities": [
{
"name": "weather-request",
"roles": [],
"children": [
{
"name": "GeographicPoi",
"children": [],
"features": [
{
"modelName": "geographyV2",
"isRequired": false
}
]
},
{
"name": "Country",
"children": [],
"features": [
{
"modelName": "geographyV2",
"isRequired": false
},
{
"featureName": "CountryPL",
"isRequired": false
}
]
},To Reproduce
Steps to reproduce the behavior:
- Extract the files in the attached zip bf luisconvert Bug.zip
- enter
bf luis:convert -i WeatherStudy-working.lu -o convertedmodel.json - [the JSON output from this is also in the zip as converted.json]
- Examine the JSON output - see how the features that are only added separately to specific ml entities in the source, have now been attached to all the intents, and to all the entities.
Expected behavior
.lu -> .json should result in a functionally equivalent model.
Screenshots
If applicable, add screenshots to help explain your problem.
Additional context
Add any other context about the problem here.
[bug]