Skip to content
This repository was archived by the owner on Jan 15, 2025. It is now read-only.

Commit dc620e8

Browse files
Vishwac Sena KannanVishwac Sena Kannan
authored andcommitted
machine-learned -> ml
1 parent fc3f357 commit dc620e8

File tree

10 files changed

+438
-456
lines changed

10 files changed

+438
-456
lines changed

packages/luis/src/parser/lufile/LUFileLexer.g4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ HAS_FEATURES_LABEL
100100
;
101101

102102
NEW_ENTITY_TYPE_IDENTIFIER
103-
: 'simple'|'list'|'regex'|'prebuilt'|'composite'|'machine-learned'|'patternany'|'phraselist'|'intent'
103+
: 'simple'|'list'|'regex'|'prebuilt'|'composite'|'ml'|'patternany'|'phraselist'|'intent'
104104
;
105105

106106
NEW_ENTITY_IDENTIFIER

packages/luis/src/parser/lufile/enums/luisEntityTypeNameMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
'list': 'closedLists',
99
'regex': 'regex_entities',
1010
'composite': 'composites',
11-
'machine-learned': 'entities',
11+
'ml': 'entities',
1212
'patternany':'patternAnyEntities',
1313
'phraselist': 'model_features'
1414
};

packages/luis/src/parser/lufile/enums/luisEntityTypes.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
REGEX: 'regex',
99
PREBUILT: 'prebuilt',
1010
COMPOSITE: 'composite',
11-
ML: 'machine-learned',
11+
ML: 'ml',
1212
PATTERNANY:'patternany',
1313
PHRASELIST: 'phraselist'
1414
};

packages/luis/src/parser/lufile/enums/luisobjenum.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ module.exports = {
1212
PATTERNS: "patterns",
1313
REGEX: "regex_entities",
1414
COMPOSITES: "composites",
15-
MACHINELEARNED: "machine-learned"
15+
MACHINELEARNED: "ml"
1616
};

packages/luis/src/parser/lufile/generated/LUFileLexer.interp

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/luis/src/parser/lufile/generated/LUFileLexer.js

Lines changed: 365 additions & 373 deletions
Large diffs are not rendered by default.

packages/luis/src/parser/lufile/parseFileContents.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const DiagnosticSeverity = require('./diagnostic').DiagnosticSeverity;
2626
const BuildDiagnostic = require('./diagnostic').BuildDiagnostic;
2727
const EntityTypeEnum = require('./enums/luisEntityTypes');
2828
const luisEntityTypeMap = require('./enums/luisEntityTypeNameMap');
29-
const plAllowedTypes = ["simple", "composite", "machine-learned"];
29+
const plAllowedTypes = ["composite", "ml"];
3030
const featureTypeEnum = {
3131
featureToModel: 'modelName',
3232
modelToFeature: 'featureName'
@@ -171,16 +171,12 @@ const validateNDepthEntities = function(collection, entitiesAndRoles, intentsCol
171171
let errorMsg = `[Error] line ${child.context.line}: Invalid child entity definition found. No definition for "${child.instanceOf}" in child entity definition "${child.context.definition}".`;
172172
throw (new exception(retCode.errorCode.INVALID_INPUT, errorMsg));
173173
}
174-
// base type cannot be a phrase list
175-
if (baseEntityFound.type === EntityTypeEnum.PHRASELIST) {
176-
let errorMsg = `[Error] line ${child.context.line}: Invalid child entity definition found. "${child.instanceOf}" is of type "${EntityTypeEnum.PHRASELIST}" in child entity definition "${child.context.definition}". Child cannot be an instance of a "${EntityTypeEnum.PHRASELIST}".`;
177-
throw (new exception(retCode.errorCode.INVALID_INPUT, errorMsg));
178-
}
179-
// base type cannot be pattern.any
180-
if (baseEntityFound.type == EntityTypeEnum.PATTERNANY) {
181-
let errorMsg = `[Error] line ${child.context.line}: Invalid child entity definition found. "${child.instanceOf}" is of type "${EntityTypeEnum.PATTERNANY}" in child entity definition "${child.context.definition}". Child cannot be an instance of a "${EntityTypeEnum.PATTERNANY}".`;
174+
// base type can only be a list or regex or prebuilt.
175+
if (![EntityTypeEnum.LIST, EntityTypeEnum.REGEX, EntityTypeEnum.PREBUILT].includes(baseEntityFound.type)) {
176+
let errorMsg = `[Error] line ${child.context.line}: Invalid child entity definition found. "${child.instanceOf}" is of type "${baseEntityFound.type}" in child entity definition "${child.context.definition}". Child cannot be only be an instance of "${EntityTypeEnum.LIST}, ${EntityTypeEnum.REGEX} or ${EntityTypeEnum.PREBUILT}.`;
182177
throw (new exception(retCode.errorCode.INVALID_INPUT, errorMsg));
183178
}
179+
184180
}
185181

186182
if (child.features) {

packages/luis/test/fixtures/verified/nDepthEntity.lu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111

1212
> # Entity definitions
1313

14-
@ machine-learned nDepth usesFeatures intent1,phraselist1
14+
@ ml nDepth usesFeatures intent1,phraselist1
1515
- @ age nDepth_child1
16-
- @ machine-learned nDepth_child2 usesFeatures intent1,phraselist1
16+
- @ ml nDepth_child2 usesFeatures intent1,phraselist1
1717
- @ simple nDepth_child2.1
1818

1919

packages/luis/test/fixtures/verified/nDepthEntityInUtterance.lu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
> # Entity definitions
1515

16-
@ machine-learned nDepth
16+
@ ml nDepth
1717
- @ age nDepth_child1
18-
- @ machine-learned nDepth_child2
18+
- @ ml nDepth_child2
1919
- @ simple nDepth_child2.1
2020

2121

0 commit comments

Comments
 (0)