Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jan 15, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions 9 packages/lu/src/parser/luis/luConverter.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ const parseIntentsToLu = function(luisObj, luisJSON){
fileContent += parseUtterancesToLu(intent.utterances, luisJSON)
fileContent += NEWLINE + NEWLINE;
if (intent.intent.features) {
fileContent += `@ intent ${intent.intent.name}`;
fileContent += addRolesAndFeatures(intent.intent);
fileContent += NEWLINE + NEWLINE;
let rolesAndFeatures = addRolesAndFeatures(intent.intent);
if (rolesAndFeatures !== '') {
fileContent += `@ intent ${intent.intent.name}`;
fileContent += rolesAndFeatures;
fileContent += NEWLINE + NEWLINE;
}
}
});
return fileContent
Expand Down
11 changes: 9 additions & 2 deletions 11 packages/lu/test/commands/luis/convert.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,9 +467,16 @@ describe('luis:convert version 5 upgrade test', () => {

test
.stdout()
.command(['luis:convert', '--in', `${path.join(__dirname, './../../fixtures/testcases/v6WithoutPhraseLists.lu')}`, '--out', './results/root45.json'])
.command(['luis:convert', '--in', `${path.join(__dirname, './../../fixtures/testcases/emptyIntentDescriptors.json')}`, '--out', './results/root40.lu'])
.it('luis:convert successfully converts LUIS JSON model with empty intent feature descriptors', async () => {
expect(await compareLuFiles('./../../../results/root40.lu', './../../fixtures/verified/emptyIntentDescriptors.lu')).to.be.true
})

test
.stdout()
.command(['luis:convert', '--in', `${path.join(__dirname, './../../fixtures/testcases/v6WithoutPhraseLists.lu')}`, '--out', './results/root38.json'])
.it('luis:convert successfully converts LUIS JSON model with no phrase lists (output must have phraselists if any v6 concepts are present in the .lu file)', async () => {
expect(await compareLuFiles('./../../../results/root45.json', './../../fixtures/verified/v6WithoutPhraseLists.json')).to.be.true
expect(await compareLuFiles('./../../../results/root38.json', './../../fixtures/verified/v6WithoutPhraseLists.json')).to.be.true
})

test
Expand Down
87 changes: 87 additions & 0 deletions 87 packages/lu/test/fixtures/testcases/emptyIntentDescriptors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
{
"luis_schema_version": "6.0.0",
"intents": [
{
"name": "None",
"features": []
},
{
"name": "test",
"features": []
}
],
"entities": [
{
"name": "address",
"children": [
{
"name": "doorNumber",
"instanceOf": "number",
"children": [],
"features": []
},
{
"name": "streetName",
"children": [],
"features": []
},
{
"name": "city",
"instanceOf": "geographyV2",
"children": [],
"features": []
},
{
"name": "zipcode",
"instanceOf": "zipRegex",
"children": [],
"features": []
}
],
"roles": [],
"features": []
}
],
"hierarchicals": [],
"composites": [],
"closedLists": [],
"prebuiltEntities": [
{
"name": "geographyV2",
"roles": []
},
{
"name": "number",
"roles": []
}
],
"utterances": [
{
"text": "one",
"intent": "test",
"entities": []
},
{
"text": "two",
"intent": "test",
"entities": []
}
],
"versionId": "0.1",
"name": "Json 6.0.0 Full Appaaaaaaaaaa",
"desc": "test",
"culture": "en-us",
"tokenizerVersion": "1.0.0",
"patternAnyEntities": [],
"regex_entities": [
{
"name": "zipRegex",
"regexPattern": "[0-9]{5}",
"roles": []
}
],
"phraselists": [],
"regex_features": [],
"patterns": [],
"settings": []
}
45 changes: 45 additions & 0 deletions 45 packages/lu/test/fixtures/verified/emptyIntentDescriptors.lu
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

> LUIS application information
> !# @app.name = Json 6.0.0 Full Appaaaaaaaaaa
> !# @app.desc = test
> !# @app.versionId = 0.1
> !# @app.culture = en-us
> !# @app.luis_schema_version = 6.0.0


> # Intent definitions

## None


## test
- one
- two


> # Entity definitions

@ ml address
- @ number doorNumber
- @ ml streetName
- @ geographyV2 city
- @ zipRegex zipcode



> # PREBUILT Entity definitions

@ prebuilt geographyV2

@ prebuilt number


> # Phrase list definitions


> # List entities

> # RegEx entities

@ regex zipRegex = /[0-9]{5}/

Morty Proxy This is a proxified and sanitized view of the page, visit original site.