This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-384
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-384 by this push:
new 97dd87f Fix for NLPCRAFT-424
97dd87f is described below
commit 97dd87fb9e918da9e5fe13cfe271e6b547571ddb
Author: Aaron Radzinski <[email protected]>
AuthorDate: Sun Aug 29 17:26:26 2021 -0700
Fix for NLPCRAFT-424
---
.../org/apache/nlpcraft/model/intent/solver/NCIntentSolver.scala | 3 ++-
.../apache/nlpcraft/model/intent/solver/NCIntentSolverEngine.scala | 6 ++++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolver.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolver.scala
index 88af005..573ac4c 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolver.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolver.scala
@@ -20,6 +20,7 @@ package org.apache.nlpcraft.model.intent.solver
import com.typesafe.scalalogging.LazyLogging
import io.opencensus.trace.Span
import org.apache.nlpcraft.common._
+import org.apache.nlpcraft.common.ansi.NCAnsi._
import org.apache.nlpcraft.common.debug.NCLogHolder
import org.apache.nlpcraft.common.opencensus.NCOpenCensusTrace
import org.apache.nlpcraft.common.util.NCUtils
@@ -145,7 +146,7 @@ class NCIntentSolver(intents: List[(NCIdlIntent/*Intent*/,
NCIntentMatch => NCRe
if (cbRes.getIntentId == null)
cbRes.setIntentId(res.intentId)
- logger.info(s"Intent '${res.intentId}' for variant
#${res.variantIdx + 1} selected as the ${g(bo("<|best match|>"))}.")
+ logger.info(s"Intent
${ansi256Fg(183)}'${res.intentId}'$ansiReset for variant #${res.variantIdx + 1}
selected as the ${g(bo("<|best match|>"))}.")
NCDialogFlowManager.addMatchedIntent(
intentMatch,
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolverEngine.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolverEngine.scala
index b2ac6d4..ccff087 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolverEngine.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/intent/solver/NCIntentSolverEngine.scala
@@ -353,8 +353,10 @@ object NCIntentSolverEngine extends LazyLogging with
NCOpenCensusTrace {
tbl.info(logger, Some(s"Found ${sorted.size} matching ${if
(sorted.size > 1) "intents" else "intent"} (sorted $G${BO}best$RST to worst):"))
}
- else
- logger.info("No matching intent found.")
+ else {
+ logger.info(s"No matching intent found:")
+ logger.info(s" +-- Turn on ${y("DEBUG")} log level to see
more details.")
+ }
sorted.map(m =>
NCIntentSolverResult(