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 002c2e8 WIP.
002c2e8 is described below
commit 002c2e83ccac166e03939f0ba8021685326cf1f8
Author: Aaron Radzinski <[email protected]>
AuthorDate: Sun Aug 29 14:37:21 2021 -0700
WIP.
---
.../model/intent/solver/NCIntentSolverEngine.scala | 17 +++++++++--------
.../probe/mgrs/dialogflow/NCDialogFlowManager.scala | 2 +-
2 files changed, 10 insertions(+), 9 deletions(-)
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 710b9f0..b2ac6d4 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
@@ -37,6 +37,7 @@ import scala.jdk.CollectionConverters.{CollectionHasAsScala,
MapHasAsScala, SeqH
* Intent solver that finds the best matching intent given user sentence.
*/
object NCIntentSolverEngine extends LazyLogging with NCOpenCensusTrace {
+ private final val DNM = r("did not match")
/**
* NOTE: not thread-safe.
@@ -437,7 +438,7 @@ object NCIntentSolverEngine extends LazyLogging with
NCOpenCensusTrace {
}
if (!flowRegex.get.matcher(str).find(0)) {
- x(s"${bo(r("did not match"))}")
+ x(DNM)
flowMatched = false
}
@@ -470,7 +471,7 @@ object NCIntentSolverEngine extends LazyLogging with
NCOpenCensusTrace {
}
if (!res) {
- x(s"${bo(r("did not match"))}")
+ x(DNM)
flowMatched = false
}
@@ -532,12 +533,12 @@ object NCIntentSolverEngine extends LazyLogging with
NCOpenCensusTrace {
s"${y("<")}${w.head}, ${w(1)}, ${w(2)},
${w(3)}, ${w(4)}, ${w(5)}${y(">")}"
)
- tbl.info(logger, Some("Term match found:"))
+ tbl.debug(logger, Some("Term match found:"))
}
case None =>
// Term is missing. Stop further processing for this
intent. This intent cannot be matched.
- logger.info(s"Intent '$intentId' ${bo(r("did not
match"))} because of unmatched term '${term.toAnsiString}' $varStr.")
+ logger.debug(s"Intent '$intentId' $DNM because of
unmatched term '${term.toAnsiString}' $varStr.")
abort = true
}
@@ -556,7 +557,7 @@ object NCIntentSolverEngine extends LazyLogging with
NCOpenCensusTrace {
if (!opts.allowStmTokenOnly && usedSenToks.isEmpty &&
usedConvToks.nonEmpty)
logger.info(
- s"Intent '$intentId' ${bo(r("did not match"))} because
all its matched tokens came from STM $varStr. " +
+ s"Intent '$intentId' $DNM because all its matched
tokens came from STM $varStr. " +
s"See intent '${c(JSON_ALLOW_STM_ONLY)}' option."
)
else if (!opts.ignoreUnusedFreeWords &&
unusedSenToks.exists(_.token.isFreeWord))
@@ -566,7 +567,7 @@ object NCIntentSolverEngine extends LazyLogging with
NCOpenCensusTrace {
info(
logger,
Some(
- s"Intent '$intentId' ${bo(r("did not match"))}
because of unused free words $varStr. " +
+ s"Intent '$intentId' $DNM because of unused free
words $varStr. " +
s"See intent '${c(JSON_UNUSED_FREE_WORDS)}'
option. " +
s"Unused free words:"
)
@@ -578,7 +579,7 @@ object NCIntentSolverEngine extends LazyLogging with
NCOpenCensusTrace {
info(
logger,
Some(
- s"Intent '$intentId' ${bo(r("did not match"))}
because of unused user tokens $varStr. " +
+ s"Intent '$intentId' $DNM because of unused user
tokens $varStr. " +
s"See intent '${c(JSON_UNUSED_USR_TOKS)}' option.
" +
s"Unused user tokens:"
)
@@ -590,7 +591,7 @@ object NCIntentSolverEngine extends LazyLogging with
NCOpenCensusTrace {
info(
logger,
Some(
- s"Intent '$intentId' ${bo(r("did not match"))}
because of unused system tokens $varStr. " +
+ s"Intent '$intentId' $DNM because of unused system
tokens $varStr. " +
s"See intent '${c(JSON_UNUSED_SYS_TOKS)}' option.
" +
s"Unused system tokens:"
)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/dialogflow/NCDialogFlowManager.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/dialogflow/NCDialogFlowManager.scala
index b7e667d..c90f918 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/dialogflow/NCDialogFlowManager.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/dialogflow/NCDialogFlowManager.scala
@@ -177,7 +177,7 @@ object NCDialogFlowManager extends NCService {
}
val tbl = NCAsciiTable(
- "",
+ "#",
"Intent ID",
"Sever Request ID",
"Text",