wingbot 3.52.2-alpha.6 → 3.52.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/AiMatching.js +9 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wingbot",
3
- "version": "3.52.2-alpha.6",
3
+ "version": "3.52.2",
4
4
  "description": "Enterprise Messaging Bot Conversation Engine",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/AiMatching.js CHANGED
@@ -518,18 +518,8 @@ class AiMatching {
518
518
  finalScore -= (matchedEntitiesTextLength / textLength) * remainingScore;
519
519
  }
520
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
- });
521
+ // eslint-disable-next-line no-console,max-len,object-curly-newline
522
+ // console.log({ finalScore, rule, baseScore, score, allOptional, entities, reqEntities, matchedEntitiesTextLength, countOfAdditionalItems });
533
523
 
534
524
  if (finalScore <= 0) {
535
525
  return null;
@@ -574,7 +564,7 @@ class AiMatching {
574
564
  }
575
565
 
576
566
  _getMultiMatchGain (entitiesScore, matchedCount, fromState = 0) {
577
- return (this.multiMatchGain * entitiesScore) ** (matchedCount - fromState);
567
+ return (this.multiMatchGain * entitiesScore) ** Math.max(matchedCount - fromState, 0);
578
568
  }
579
569
 
580
570
  /**
@@ -613,10 +603,8 @@ class AiMatching {
613
603
  : (x) => x
614
604
  );
615
605
 
616
- // eslint-disable-next-line no-console
617
- console.log({
618
- wantedEntities, entitiesScore, handicap, matched, minScore, requestIntent
619
- });
606
+ // eslint-disable-next-line no-console,max-len,object-curly-newline
607
+ // console.log({ wantedEntities, entitiesScore, handicap, matched, minScore, requestIntent });
620
608
 
621
609
  const allOptional = wantedEntities.every((e) => e.optional
622
610
  && (!e.op || useEntities.every((n) => n.entity !== e.entity)));
@@ -630,10 +618,8 @@ class AiMatching {
630
618
 
631
619
  const score = Math.round((scoreWithHandicap * multiMatchGain) * 10000) / 10000;
632
620
 
633
- // eslint-disable-next-line no-console
634
- console.log({
635
- IMS: score, normalizedScore, scoreWithHandicap, multiMatchGain, wantedEntities
636
- });
621
+ // eslint-disable-next-line no-console,max-len,object-curly-newline
622
+ // console.log({ IMS: score, normalizedScore, scoreWithHandicap, multiMatchGain, wantedEntities });
637
623
 
638
624
  return {
639
625
  score,
@@ -752,10 +738,8 @@ class AiMatching {
752
738
  }
753
739
  }
754
740
 
755
- // eslint-disable-next-line no-console
756
- console.log({
757
- wantedEntities, sum, handicap, rl: requestEntities.length, ml: matched.length
758
- });
741
+ // eslint-disable-next-line no-console,max-len
742
+ // console.log({ wantedEntities, sum, handicap, rl: requestEntities.length, ml: matched.length });
759
743
 
760
744
  // @todo - neni mozne, by doslo k negativnimu handicapu
761
745
  handicap += (requestEntities.length + fromState - matched.length)