wingbot 3.67.10 → 3.67.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +22 -0
- package/package.json +11 -10
- package/src/wingbot/CachedModel.js +2 -4
- package/src/wingbot/CustomEntityDetectionModel.js +12 -7
package/.babelrc
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"presets": [
|
|
3
|
+
"@babel/preset-react",
|
|
4
|
+
[
|
|
5
|
+
"@babel/preset-env",
|
|
6
|
+
{
|
|
7
|
+
"targets": {
|
|
8
|
+
"node": "current",
|
|
9
|
+
"browsers": [
|
|
10
|
+
"last 2 versions",
|
|
11
|
+
"ie >= 11"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"@babel/preset-typescript"
|
|
17
|
+
],
|
|
18
|
+
"plugins": [
|
|
19
|
+
"@babel/plugin-proposal-class-properties"
|
|
20
|
+
],
|
|
21
|
+
"sourceType": "unambiguous"
|
|
22
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wingbot",
|
|
3
|
-
"version": "3.67.
|
|
3
|
+
"version": "3.67.11",
|
|
4
4
|
"description": "Enterprise Messaging Bot Conversation Engine",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"type": "commonjs",
|
|
6
7
|
"scripts": {
|
|
7
8
|
"tsd:update": "jsdoc -t ./node_modules/tsd-jsdoc/dist/ -r ./src",
|
|
8
9
|
"doc:gql": "graphql-markdown ./src/graphApi/schema.gql > doc/api/graphqlSchema.md",
|
|
@@ -36,20 +37,20 @@
|
|
|
36
37
|
},
|
|
37
38
|
"homepage": "https://github.com/wingbot.ai/wingbot#readme",
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"cpy-cli": "^
|
|
40
|
-
"eslint": "^8.
|
|
40
|
+
"cpy-cli": "^5.0.0",
|
|
41
|
+
"eslint": "^8.56.0",
|
|
41
42
|
"eslint-config-airbnb": "^19.0.4",
|
|
42
|
-
"eslint-plugin-import": "^2.
|
|
43
|
-
"eslint-plugin-jsdoc": "^
|
|
44
|
-
"eslint-plugin-jsx-a11y": "^6.
|
|
45
|
-
"eslint-plugin-mocha": "^10.
|
|
46
|
-
"eslint-plugin-react": "^7.
|
|
43
|
+
"eslint-plugin-import": "^2.29.1",
|
|
44
|
+
"eslint-plugin-jsdoc": "^48.0.2",
|
|
45
|
+
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
46
|
+
"eslint-plugin-mocha": "^10.2.0",
|
|
47
|
+
"eslint-plugin-react": "^7.33.2",
|
|
47
48
|
"graphql-markdown": "^7.0.0",
|
|
48
49
|
"jsdoc-to-markdown": "^8.0.0",
|
|
49
50
|
"mocha": "^10.2.0",
|
|
50
51
|
"nyc": "^15.1.0",
|
|
51
|
-
"rimraf": "^
|
|
52
|
-
"sinon": "^
|
|
52
|
+
"rimraf": "^5.0.5",
|
|
53
|
+
"sinon": "^17.0.1",
|
|
53
54
|
"tsd-jsdoc": "^2.5.0"
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
@@ -120,15 +120,13 @@ class CachedModel extends CustomEntityDetectionModel {
|
|
|
120
120
|
|
|
121
121
|
return {
|
|
122
122
|
...i,
|
|
123
|
-
entities: expectedEntities
|
|
124
|
-
? this.nonOverlapping(ents, expectedEntities)
|
|
125
|
-
: ents
|
|
123
|
+
entities: this.nonOverlapping(ents, expectedEntities || [], !expectedEntities)
|
|
126
124
|
};
|
|
127
125
|
});
|
|
128
126
|
|
|
129
127
|
return [
|
|
130
128
|
retIntents,
|
|
131
|
-
|
|
129
|
+
this.nonOverlapping(retEntities, expectedEntities || [], !expectedEntities)
|
|
132
130
|
];
|
|
133
131
|
}
|
|
134
132
|
|
|
@@ -287,9 +287,10 @@ class CustomEntityDetectionModel {
|
|
|
287
287
|
*
|
|
288
288
|
* @param {DetectedEntity[]} entities
|
|
289
289
|
* @param {string[]} [expectedEntities]
|
|
290
|
+
* @param {boolean} [justDuplicates]
|
|
290
291
|
* @returns {DetectedEntity[]}
|
|
291
292
|
*/
|
|
292
|
-
nonOverlapping (entities, expectedEntities = []) {
|
|
293
|
+
nonOverlapping (entities, expectedEntities = [], justDuplicates = false) {
|
|
293
294
|
// longest first
|
|
294
295
|
entities.sort(({ start: a, end: b }, { start: z, end: y }) => {
|
|
295
296
|
const aLen = b - a;
|
|
@@ -308,18 +309,22 @@ class CustomEntityDetectionModel {
|
|
|
308
309
|
|
|
309
310
|
const isExpected = expectedEntities.includes(entity.entity);
|
|
310
311
|
|
|
311
|
-
|
|
312
|
-
.
|
|
312
|
+
const duplicate = res
|
|
313
|
+
.find((e) => e.start === entity.start && e.end === entity.end);
|
|
313
314
|
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
let overlapping = justDuplicates
|
|
316
|
+
? !!duplicate
|
|
317
|
+
: res
|
|
318
|
+
.some((e) => e.start < entity.end && e.end > entity.start);
|
|
317
319
|
|
|
320
|
+
if (overlapping) {
|
|
318
321
|
if (duplicate) {
|
|
319
322
|
overlapping = !isExpected && expectedEntities.includes(duplicate.entity);
|
|
320
323
|
}
|
|
321
324
|
|
|
322
|
-
if (
|
|
325
|
+
if (duplicate && duplicate.entity === entity.entity) {
|
|
326
|
+
overlapping = true;
|
|
327
|
+
} else if (isExpected) {
|
|
323
328
|
overlapping = false;
|
|
324
329
|
res = res.filter((e) => {
|
|
325
330
|
const isOverlapping = e.start < entity.end && e.end > entity.start;
|