wingbot 3.67.20 → 3.67.21
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 +1 -1
- package/src/AiMatching.js +5 -1
- package/src/Request.js +4 -1
package/package.json
CHANGED
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
|
|
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, [
|
|
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()) {
|