wingbot 3.52.2-alpha.5 → 3.52.2-alpha.6
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 +25 -5
package/package.json
CHANGED
package/src/AiMatching.js
CHANGED
|
@@ -499,8 +499,6 @@ class AiMatching {
|
|
|
499
499
|
? score - noIntentHandicap
|
|
500
500
|
: (regexpScore + score) / 2;
|
|
501
501
|
|
|
502
|
-
// console.log({ baseScore, score, allOptional, entities, reqEntities });
|
|
503
|
-
|
|
504
502
|
const matchedEntitiesTextLength = matched.reduce((tot, entity) => (
|
|
505
503
|
typeof entity.end === 'number' && typeof entity.start === 'number' && tot !== null
|
|
506
504
|
? (tot + (entity.end - entity.start))
|
|
@@ -520,6 +518,19 @@ class AiMatching {
|
|
|
520
518
|
finalScore -= (matchedEntitiesTextLength / textLength) * remainingScore;
|
|
521
519
|
}
|
|
522
520
|
|
|
521
|
+
// eslint-disable-next-line no-console
|
|
522
|
+
console.log({
|
|
523
|
+
finalScore,
|
|
524
|
+
rule,
|
|
525
|
+
baseScore,
|
|
526
|
+
score,
|
|
527
|
+
allOptional,
|
|
528
|
+
entities,
|
|
529
|
+
reqEntities,
|
|
530
|
+
matchedEntitiesTextLength,
|
|
531
|
+
countOfAdditionalItems
|
|
532
|
+
});
|
|
533
|
+
|
|
523
534
|
if (finalScore <= 0) {
|
|
524
535
|
return null;
|
|
525
536
|
}
|
|
@@ -602,7 +613,10 @@ class AiMatching {
|
|
|
602
613
|
: (x) => x
|
|
603
614
|
);
|
|
604
615
|
|
|
605
|
-
// console
|
|
616
|
+
// eslint-disable-next-line no-console
|
|
617
|
+
console.log({
|
|
618
|
+
wantedEntities, entitiesScore, handicap, matched, minScore, requestIntent
|
|
619
|
+
});
|
|
606
620
|
|
|
607
621
|
const allOptional = wantedEntities.every((e) => e.optional
|
|
608
622
|
&& (!e.op || useEntities.every((n) => n.entity !== e.entity)));
|
|
@@ -616,7 +630,10 @@ class AiMatching {
|
|
|
616
630
|
|
|
617
631
|
const score = Math.round((scoreWithHandicap * multiMatchGain) * 10000) / 10000;
|
|
618
632
|
|
|
619
|
-
// console
|
|
633
|
+
// eslint-disable-next-line no-console
|
|
634
|
+
console.log({
|
|
635
|
+
IMS: score, normalizedScore, scoreWithHandicap, multiMatchGain, wantedEntities
|
|
636
|
+
});
|
|
620
637
|
|
|
621
638
|
return {
|
|
622
639
|
score,
|
|
@@ -735,7 +752,10 @@ class AiMatching {
|
|
|
735
752
|
}
|
|
736
753
|
}
|
|
737
754
|
|
|
738
|
-
// console
|
|
755
|
+
// eslint-disable-next-line no-console
|
|
756
|
+
console.log({
|
|
757
|
+
wantedEntities, sum, handicap, rl: requestEntities.length, ml: matched.length
|
|
758
|
+
});
|
|
739
759
|
|
|
740
760
|
// @todo - neni mozne, by doslo k negativnimu handicapu
|
|
741
761
|
handicap += (requestEntities.length + fromState - matched.length)
|