Socket
Socket
Sign inDemoInstall

@telefonica/language-model-converter

Package Overview
Dependencies
Maintainers
11
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@telefonica/language-model-converter - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

17

lib/parser.js

@@ -38,2 +38,3 @@ "use strict";

.filter(intentName => !intentName.startsWith('phraselist'))
.filter(intentName => !intentName.startsWith('builtin'))
.map(intentName => {

@@ -66,10 +67,15 @@ if (intentName.length > 50) {

let name = String(value[0]);
let words = value[1].words || {};
let activated = value[1].activated == null ? true : value[1].activated;
let mode = value[1].mode == null ? true : value[1].mode;
let words = (value[1].words || [])
.map((word) => this.tokenize(word).join(' '))
.join(',');
return {
activated: true,
mode: true,
name: name,
words: words.map(word => this.tokenize(word).join(' ')).join(',')
activated,
mode,
name,
words
};
});
let bingEntities = this.doc.builtin || [];
luisModel.utterances = Array.from(utterances.values());

@@ -79,2 +85,3 @@ luisModel.entities = Array.from(entitiesMap.values());

luisModel.model_features = features;
luisModel.bing_entities = bingEntities;
return luisModel;

@@ -81,0 +88,0 @@ }

@@ -331,3 +331,20 @@ "use strict";

});
it('should parse builtin', function () {
let parser = new parser_1.LanguageModelParser();
let luisModel = parser.parse(['./test/fixtures/builtin.yaml'], 'en-us');
let expectedBingEntities = [
"age",
"datetime",
"dimension",
"encyclopedia",
"geography",
"money",
"number",
"ordinal",
"percentage",
"temperature"
];
chai_1.expect(luisModel.bing_entities).to.eql(expectedBingEntities);
});
});
//# sourceMappingURL=parser.spec.js.map
{
"name": "@telefonica/language-model-converter",
"version": "2.3.0",
"version": "2.4.0",
"description": "Language model converter for yot-bot",

@@ -5,0 +5,0 @@ "license": "UNLICENSED",

@@ -36,5 +36,36 @@ # language-model-converter

- home
builtin: # LUIS builtin entities that should be used
- age
- datetime
- dimension
- encyclopedia
- geography
- money
- number
- ordinal
- percentage
- temperature
```
The list of **builtin** entities can be found in the [LUIS Help](https://www.luis.ai/Help#PreBuiltEntities) and/or the [Cognitive Services Help](https://www.microsoft.com/cognitive-services/en-us/luis-api/documentation/pre-builtentities)
Please, read carefully about what entities are available for the target language you are writting utterances to, as
> Unless otherwise noted, each pre-built entity is available in all LUIS application locales (cultures).
_Note: maybe the doc page [is not actualized with all the entities](https://github.com/Microsoft/Cognitive-Documentation/issues/96)_
You dont need to declare with brackets the builtin entities. They are recognized by default on LUIS. I.E:
```yaml
# DONT DO THIS
tef.intent.money:
- It's worth [$30:builtin.money]
# DO THIS
builtin:
- money
tef.intent.money:
- It's worth $30
```
### Limitations

@@ -41,0 +72,0 @@ As of writing this doc, the following limitations apply in LUIS Service

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc