wingbot 3.67.20 → 3.67.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.67.20",
3
+ "version": "3.67.22",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "type": "commonjs",
package/src/AiMatching.js CHANGED
@@ -123,6 +123,8 @@ const COMPARE = {
123
123
  * @prop {number} confidence
124
124
  */
125
125
 
126
+ const ENTITY_OK = 0.79; // 0.835 on NLP;
127
+
126
128
  /**
127
129
  * @class {AiMatching}
128
130
  *
@@ -709,7 +711,9 @@ class AiMatching {
709
711
  let entityExists = false;
710
712
  const index = requestEntities
711
713
  .findIndex((e, i) => {
712
- if (e.entity !== wanted.entity || usedIndexes.includes(i)) {
714
+ if (e.entity !== wanted.entity
715
+ || usedIndexes.includes(i)
716
+ || e.score < ENTITY_OK) {
713
717
  return false;
714
718
  }
715
719
  entityExists = true;
package/src/Request.js CHANGED
@@ -1649,11 +1649,14 @@ It looks like the bot isn't connected to class BotApp or the Processor is used w
1649
1649
  entity,
1650
1650
  value,
1651
1651
  score = 1,
1652
+ entityScore = Math.max(score, 0.8),
1652
1653
  timestamp = makeTimestamp()
1653
1654
  ) {
1654
1655
  const res = Request.text(senderId, text, timestamp);
1655
1656
 
1656
- return Request.addIntentToRequest(res, intent, [{ entity, value, score }], score);
1657
+ return Request.addIntentToRequest(res, intent, [
1658
+ { entity, value, score: entityScore }
1659
+ ], score);
1657
1660
  }
1658
1661
 
1659
1662
  static quickReply (senderId, action, data = {}, timestamp = makeTimestamp()) {
@@ -41,7 +41,7 @@ function getIndexesToIterate (ngrams, tfEntry) {
41
41
  function searchFnFactory (indexMap, ngramCounts, entities, maxIdf, {
42
42
  stemmer = null,
43
43
  keepMultipleValues = false,
44
- threshold = 0.5,
44
+ threshold = 0.79,
45
45
  limit = undefined
46
46
  }, hasFuzzyMultiplier = false) {
47
47
  /** @type {WordEntityDetector} */