Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@telefonica/language-model-converter

Package Overview
Dependencies
Maintainers
18
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.4.1 to 2.4.2

.npmignore

6

lib/index.js
"use strict";
const commander = require('commander');
const glob = require('glob');
const parser_1 = require('./parser');
const commander = require("commander");
const glob = require("glob");
const parser_1 = require("./parser");
const cli = commander

@@ -6,0 +6,0 @@ .description('Convert language files defined to LUIS format')

"use strict";
const fs = require('fs');
const yaml = require('js-yaml');
const _ = require('lodash');
const fs = require("fs");
const yaml = require("js-yaml");
const _ = require("lodash");
class LanguageModelParser {

@@ -10,11 +10,11 @@ constructor() {

parse(files, culture) {
try {
files.forEach(file => {
files.forEach(file => {
try {
let yamlFileContents = fs.readFileSync(file, 'utf8');
mergeDeep(this.doc, yaml.safeLoad(yamlFileContents));
});
}
catch (err) {
throw new Error('Not able to parse language model: ' + err);
}
}
catch (err) {
throw new Error('File "' + file + '": ' + err.message);
}
});
this.culture = culture;

@@ -163,3 +163,6 @@ let luisModel = {

tokenize(sentence) {
return String(sentence)
if (sentence === '') {
return [];
}
let tokenized = String(sentence)
.replace(/[^\w\u00C0-\u017F]/g, capture => ` ${capture} `)

@@ -172,2 +175,3 @@ .replace(/_/g, capture => ` ${capture} `)

.split(' ');
return tokenized;
}

@@ -174,0 +178,0 @@ buildUtterance(sentence, intent) {

{
"name": "@telefonica/language-model-converter",
"version": "2.4.1",
"description": "Language model converter for yot-bot",
"license": "UNLICENSED",
"version": "2.4.2",
"description": "Language model converter yaml <-> json for LUIS",
"license": "Apache-2.0",
"repository": "https://github.com/Telefonica/yot-bot/tree/master/language-model-converter",

@@ -11,9 +11,4 @@ "author": "TDAF <tdaf@tid.es>",

},
"files": [
"lib",
"bin"
],
"keywords": [
"luis",
"fourth platform"
"luis"
],

@@ -20,0 +15,0 @@ "main": "lib/index.js",

# language-model-converter
This is a tool to convert language files defined in yaml language model into the (LUIS)(http://luis.ai) internal JSON representation.
This is a tool to convert language files defined in yaml language model into the [LUIS](http://luis.ai) internal JSON representation.

@@ -99,4 +99,18 @@ ### The language model

Notice that you can use [luis-cli](../luis-cli) to import or update the generated LUIS models.
Notice that you can use [luis-cli](https://github.com/Telefonica/luis-cli) to import or update the generated LUIS models.
## LICENSE
Copyright 2016 [Telefónica I+D](http://www.tid.es)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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