You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2022/03/30 20:20:16 UTC

[incubator-nlpcraft] branch NLPCRAFT-490 updated: WIP codereview.

This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch NLPCRAFT-490
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-490 by this push:
     new 21e4ecf  WIP codereview.
21e4ecf is described below

commit 21e4ecf6e7d5c80e371e1a43e743b3d1cb5b3a9a
Author: Aaron Radzinski <ar...@datalingvo.com>
AuthorDate: Wed Mar 30 13:20:11 2022 -0700

    WIP codereview.
---
 .../scala/org/apache/nlpcraft/NCCallbackData.java  | 11 ++++++++-
 .../scala/org/apache/nlpcraft/NCModelClient.java   |  4 ++--
 .../internal/conversation/NCConversationData.scala | 22 +++++++++---------
 .../nlpcraft/internal/impl/NCModelClientImpl.scala | 20 +++++++++++++++--
 .../intent/matcher/NCIntentSolverManager.scala     | 26 +++++++++++-----------
 .../internal/conversation/NCConversationSpec.scala |  8 ++++++-
 .../conversation/NCConversationTimeoutSpec.scala   |  8 ++++++-
 .../internal/impl/NCModelCallbacksSpec.scala       |  2 +-
 .../nlpcraft/internal/impl/NCModelClientSpec.scala | 20 +++++++++++++++--
 .../internal/impl/NCModelClientSpec2.scala         |  9 +++++---
 .../internal/impl/NCModelPingPongSpec.scala        |  2 +-
 .../internal/impl/NCPipelineManagerSpec.scala      |  2 +-
 .../semantic/NCSemanticEntityParserJsonSpec.scala  |  2 +-
 .../semantic/NCSemanticEntityParserSpec.scala      |  2 +-
 .../semantic/NCSemanticEntityParserYamlSpec.scala  |  2 +-
 .../org/apache/nlpcraft/nlp/util/NCTestUtils.scala |  7 +++---
 16 files changed, 100 insertions(+), 47 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCCallbackData.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCCallbackData.java
index 154ade9..96941ff 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCCallbackData.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCCallbackData.java
@@ -20,9 +20,18 @@ package org.apache.nlpcraft;
 import java.util.List;
 
 /**
- * TODO:
+ *
  */
 public interface NCCallbackData {
+    /**
+     *
+     * @return
+     */
     String getIntentId();
+
+    /**
+     *
+     * @return
+     */
     List<List<NCEntity>> getCallbackArguments();
 }
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelClient.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelClient.java
index 957d316..6b8ca1f 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelClient.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelClient.java
@@ -113,7 +113,7 @@ public class NCModelClient implements AutoCloseable {
      *                    if false that found intent is not saved in STM and dialog flow.
      * @return
      */
-    public NCCallbackData findCallback(String txt, Map<String, Object> data, String usrId, boolean saveHistory) {
-        return impl.findCallback(txt, data, usrId, saveHistory);
+    public NCCallbackData debugAsk(String txt, Map<String, Object> data, String usrId, boolean saveHistory) {
+        return impl.debugAsk(txt, data, usrId, saveHistory);
     }
 }
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/conversation/NCConversationData.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/conversation/NCConversationData.scala
index d2a2231..3092964 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/conversation/NCConversationData.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/conversation/NCConversationData.scala
@@ -201,19 +201,17 @@ case class NCConversationData(
       *
       * @return
       */
-    def getEntities: Seq[NCEntity] =
-        stm.synchronized {
-            val reqIds = ctx.map(_.getRequestId).distinct.zipWithIndex.toMap
-            ctx.groupBy(_.getRequestId).toSeq.sortBy(p => reqIds(p._1)).reverse.flatMap(_._2)
-        }
+    def getEntities: Seq[NCEntity] = stm.synchronized {
+        val reqIds = ctx.map(_.getRequestId).distinct.zipWithIndex.toMap
+        ctx.groupBy(_.getRequestId).toSeq.sortBy(p => reqIds(p._1)).reverse.flatMap(_._2)
+    }
 
     /**
       *
       */
-    def clear(): Unit =
-        stm.synchronized {
-            ctx.clear()
-            stm.clear()
-            lastEnts.clear()
-            data.clear()
-        }
+    def clear(): Unit = stm.synchronized {
+        ctx.clear()
+        stm.clear()
+        lastEnts.clear()
+        data.clear()
+    }
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelClientImpl.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelClientImpl.scala
index df8e0a7..a417479 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelClientImpl.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelClientImpl.scala
@@ -75,6 +75,14 @@ class NCModelClientImpl(mdl: NCModel) extends LazyLogging:
         dlgMgr.start()
         plMgr.start()
 
+    /**
+      *
+      * @param txt
+      * @param data
+      * @param usrId
+      * @param typ
+      * @return
+      */
     private def ask0(txt: String, data: JMap[String, AnyRef], usrId: String, typ: NCIntentSolveType): Either[NCResult, NCCallbackData] =
         val plData = plMgr.prepare(txt, data, usrId)
 
@@ -193,6 +201,14 @@ class NCModelClientImpl(mdl: NCModel) extends LazyLogging:
         dlgMgr.close()
         convMgr.close()
 
-    def findCallback(txt: String, data: JMap[String, AnyRef], usrId: String, saveHistory: Boolean): NCCallbackData =
+    /**
+      *
+      * @param txt
+      * @param data
+      * @param usrId
+      * @param saveHist
+      * @return
+      */
+    def debugAsk(txt: String, data: JMap[String, AnyRef], usrId: String, saveHist: Boolean): NCCallbackData =
         import NCIntentSolveType.*
-        ask0(txt, data, usrId, if saveHistory then SEARCH else SEARCH_NO_HISTORY).toOption.get
\ No newline at end of file
+        ask0(txt, data, usrId, if saveHist then SEARCH else SEARCH_NO_HISTORY).toOption.get
\ No newline at end of file
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/matcher/NCIntentSolverManager.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/matcher/NCIntentSolverManager.scala
index 3471963..95956f7 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/matcher/NCIntentSolverManager.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/intent/matcher/NCIntentSolverManager.scala
@@ -33,13 +33,14 @@ import scala.jdk.CollectionConverters.*
 import scala.language.postfixOps
 
 /**
-  * REGULAR - regular request.
-  * SEARCH - if callback is trying to be found. STM and dialog flow processed as usual.
-  * SEARCH_NO_HISTORY - if callback is trying to be found. STM and dialog processing skipped.
+  *
   */
 enum NCIntentSolveType:
     case REGULAR, SEARCH, SEARCH_NO_HISTORY
 
+/**
+  *
+  */
 object NCIntentSolverManager:
     /**
       * Sentence variant & its weight.
@@ -410,7 +411,6 @@ class NCIntentSolverManager(
         val opts = intent.options
         val flow = dialog.getDialogFlow(ctx.getRequest.getUserId)
         val varStr = s"(variant #${varIdx + 1})"
-        val flowRegex = intent.flowRegex
 
         // Check dialog flow regex first, if any.
         val flowMatched: Boolean =
@@ -472,7 +472,6 @@ class NCIntentSolverManager(
                 None
             else
                 val usedSenEnts = senEnts.filter(_.used)
-                val unusedSenEnts = senEnts.filter(!_.used)
                 val usedConvEnts = convEnts.filter(_.used)
                 val usedToks = usedSenEnts.flatMap(_.entity.getTokens.asScala)
                 val unusedToks = ctx.getTokens.asScala.filter(p => !usedToks.contains(p))
@@ -698,18 +697,20 @@ class NCIntentSolverManager(
                     typ match
                         case REGULAR =>
                             val cbRes = intentRes.fn(im)
-                            // Store won intent match in the input.
+                            // Store winning intent match in the input.
                             if cbRes.getIntentId == null then
                                 cbRes.setIntentId(intentRes.intentId)
                             logger.info(s"Intent '${intentRes.intentId}' for variant #${intentRes.variantIdx + 1} selected as the <|best match|>")
-
                             saveHistory(cbRes)
 
                             Loop.finish(IterationResult(Left(cbRes), im))
+
                         case SEARCH =>
-                            saveHistory(new NCResult()) // // Added dummy result. TODO: is it ok?
+                            saveHistory(new NCResult()) // Added dummy result.
+                            finishHistory()
+
+                        case SEARCH_NO_HISTORY =>
                             finishHistory()
-                        case SEARCH_NO_HISTORY => finishHistory()
                 else
                     logger.info(s"Model '${ctx.getModelConfig.getId}' triggered rematching of intents by intent '${intentRes.intentId}' on variant #${intentRes.variantIdx + 1}.")
                     Loop.finish()
@@ -735,14 +736,13 @@ class NCIntentSolverManager(
         val mdlCtxRes = mdl.onContext(ctx)
 
         if mdlCtxRes != null then
-            if typ != REGULAR then E("`onContext` method overriden, intents cannot be found.") // TODO: test
-            if intents.nonEmpty then logger.warn("`onContext` method overrides existed intents. They are ignored.") // TODO: text.
+            if typ != REGULAR then E("'onContext()' method is overridden, intents cannot be found.")
+            if intents.nonEmpty then logger.warn("'onContext()' method overrides existing intents - they are ignored.")
 
             Left(mdlCtxRes)
         else
             if intents.isEmpty then
-                // TODO: text.
-                throw NCRejection("Intent solver has no registered intents and model's `onContext` method returns null result.")
+                throw NCRejection("There are no registered intents and model's 'onContext()' method returns 'null' result.")
 
             var loopRes: IterationResult = null
 
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationSpec.scala
index 4b7cc44..112c01a 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationSpec.scala
@@ -26,9 +26,15 @@ import org.junit.jupiter.api.Assertions.{assertFalse, assertTrue}
 import scala.jdk.CollectionConverters.*
 import scala.util.Using
 
+/**
+  *
+  */
 class NCConversationSpec:
     private val usrId = "userId"
 
+    /**
+      *
+      */
     @Test
     def test(): Unit =
         val mdl: NCModel =
@@ -36,7 +42,7 @@ class NCConversationSpec:
                 import NCSemanticTestElement as TE
                 override val getPipeline: NCPipeline =
                     val pl = mkEnPipeline
-                    pl.getEntityParsers.add(NCTestUtils.mkENSemanticParser(TE("e1"), TE("e2")))
+                    pl.getEntityParsers.add(NCTestUtils.mkEnSemanticParser(TE("e1"), TE("e2")))
                     pl
 
                 @NCIntent("intent=i1 term(t1)~{# == 'e1'} term(t2)~{# == 'e2'}?")
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationTimeoutSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationTimeoutSpec.scala
index 72282ee..99a4499 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationTimeoutSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/conversation/NCConversationTimeoutSpec.scala
@@ -26,11 +26,17 @@ import org.junit.jupiter.api.Test
 import scala.jdk.CollectionConverters.*
 import scala.util.Using
 
+/**
+  *
+  */
 class NCConversationTimeoutSpec:
     private val TIMEOUT = 200
     private val VALUE = "value"
     private val EMPTY = "empty"
 
+    /**
+      *
+      */
     @Test
     def test(): Unit =
         val mdl: NCModel =
@@ -43,7 +49,7 @@ class NCConversationTimeoutSpec:
                 override val getPipeline: NCPipeline =
                     val pl = mkEnPipeline
                     import NCSemanticTestElement as TE
-                    pl.getEntityParsers.add(NCTestUtils.mkENSemanticParser(TE("test")))
+                    pl.getEntityParsers.add(NCTestUtils.mkEnSemanticParser(TE("test")))
                     pl
 
                 @NCIntent("intent=i term(e)~{# == 'test'}")
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelCallbacksSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelCallbacksSpec.scala
index 6da1b1d..6fea886 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelCallbacksSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelCallbacksSpec.scala
@@ -62,7 +62,7 @@ class NCModelCallbacksSpec:
             override def onRejection(ctx: NCIntentMatch, e: NCRejection): NCResult = getOrElse(RejectionNotNull, RESULT_REJECTION, null)
             override def onError(ctx: NCContext, e: Throwable): NCResult = getOrElse(ErrorNotNull, RESULT_ERROR, null)
 
-    MDL.getPipeline.getEntityParsers.add(NCTestUtils.mkENSemanticParser(Seq(NCSemanticTestElement("x")).asJava))
+    MDL.getPipeline.getEntityParsers.add(NCTestUtils.mkEnSemanticParser(Seq(NCSemanticTestElement("x")).asJava))
 
     /**
       *
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec.scala
index 0dbd4f7..5140d7b 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec.scala
@@ -26,12 +26,24 @@ import org.junit.jupiter.api.Test
 import scala.jdk.CollectionConverters.*
 import scala.util.Using
 
+/**
+  *
+  */
 class NCModelClientSpec:
+    /**
+      *
+      * @param e
+      * @return
+      */
     private def s(e: NCEntity): String =
         s"Entity [id=${e.getId}, text=${e.mkText()}, properties={${e.keysSet().asScala.map(k => s"$k=${e.get(k)}")}}]"
 
+    /**
+      *
+      * @param mdl
+      */
     private def test0(mdl: NCTestModelAdapter): Unit =
-        mdl.getPipeline.getEntityParsers.add(NCTestUtils.mkENSemanticParser("models/lightswitch_model.yaml"))
+        mdl.getPipeline.getEntityParsers.add(NCTestUtils.mkEnSemanticParser("models/lightswitch_model.yaml"))
 
         Using.resource(new NCModelClient(mdl)) { client =>
             val res = client.ask("Lights on at second floor kitchen", null, "userId")
@@ -41,10 +53,11 @@ class NCModelClientSpec:
 
             client.validateSamples()
 
-            val winner = client.findCallback("Lights on at second floor kitchen", null, "userId", true)
+            val winner = client.debugAsk("Lights on at second floor kitchen", null, "userId", true)
             println(s"Winner intent: ${winner.getIntentId}")
             println("Entities: \n" + winner.getCallbackArguments.asScala.map(p => p.asScala.map(s).mkString(", ")).mkString("\n"))
         }
+
     /**
       *
       */
@@ -57,6 +70,9 @@ class NCModelClientSpec:
                 def onMatch(@NCIntentTerm("act") act: NCEntity, @NCIntentTerm("loc") locs: List[NCEntity]): NCResult = new NCResult()
         )
 
+    /**
+      * 
+      */
     @Test
     def test2(): Unit =
         test0(
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec2.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec2.scala
index b2cda88..01194a2 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec2.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec2.scala
@@ -29,6 +29,9 @@ import scala.collection.mutable
 import scala.jdk.CollectionConverters.*
 import scala.util.Using
 
+/**
+  * 
+  */
 class NCModelClientSpec2:
     @Test
     def test(): Unit =
@@ -37,7 +40,7 @@ class NCModelClientSpec2:
         val mdl = new NCTestModelAdapter:
             override val getPipeline: NCPipeline =
                 val pl = mkEnPipeline
-                pl.getEntityParsers.add(NCTestUtils.mkENSemanticParser(TE("e1"), TE("e2")))
+                pl.getEntityParsers.add(NCTestUtils.mkEnSemanticParser(TE("e1"), TE("e2")))
                 pl.getTokenEnrichers.add(EN_TOK_LEMMA_POS_ENRICHER)
                 pl
 
@@ -47,7 +50,7 @@ class NCModelClientSpec2:
 
         Using.resource(new NCModelClient(mdl)) { client =>
             case class Result(txt: String):
-                private val wi = client.findCallback(txt, null, "userId", true)
+                private val wi = client.debugAsk(txt, null, "userId", true)
                 private val allArgs: JList[JList[NCEntity]] = wi.getCallbackArguments
 
                 val intentId: String = wi.getIntentId
@@ -87,7 +90,7 @@ class NCModelClientSpec2:
 
             // 3. No winners.
             try
-                client.findCallback("x", null, "userId", false)
+                client.debugAsk("x", null, "userId", false)
 
                 require(false)
             catch
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelPingPongSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelPingPongSpec.scala
index 3428ab6..7428b3f 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelPingPongSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelPingPongSpec.scala
@@ -61,7 +61,7 @@ class NCModelPingPongSpec:
             def onOther(im: NCIntentMatch, @NCIntentTerm("other") other: NCEntity): NCResult =
                 R(ASK_RESULT, s"Some request by: ${other.mkText()}")
 
-    MDL.getPipeline.getEntityParsers.add(NCTestUtils.mkENSemanticParser(Seq(STE("command"), STE("confirm"), STE("other")).asJava))
+    MDL.getPipeline.getEntityParsers.add(NCTestUtils.mkEnSemanticParser(Seq(STE("command"), STE("confirm"), STE("other")).asJava))
 
     @BeforeEach
     def setUp(): Unit = client = new NCModelClient(MDL)
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCPipelineManagerSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCPipelineManagerSpec.scala
index 5c50dd2..85c3e85 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCPipelineManagerSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCPipelineManagerSpec.scala
@@ -43,7 +43,7 @@ class NCPipelineManagerSpec:
         def test(txt: String, variantCnt: Int, elements: NCSemanticElement*): Unit =
             val pipeline = mkEnPipeline
 
-            pipeline.getEntityParsers.add(NCTestUtils.mkENSemanticParser(elements.asJava))
+            pipeline.getEntityParsers.add(NCTestUtils.mkEnSemanticParser(elements.asJava))
 
             val res = new NCModelPipelineManager(CFG, pipeline).prepare(txt, null, "userId")
 
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserJsonSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserJsonSpec.scala
index b11bcf5..00de5ab 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserJsonSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserJsonSpec.scala
@@ -34,7 +34,7 @@ import scala.jdk.OptionConverters.RichOptional
   *
   */
 class NCSemanticEntityParserJsonSpec:
-    private val semParser = NCTestUtils.mkENSemanticParser("models/alarm_model.json")
+    private val semParser = NCTestUtils.mkEnSemanticParser("models/alarm_model.json")
 
     /**
       * 
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserSpec.scala
index 71935ea..6e5ed77 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserSpec.scala
@@ -36,7 +36,7 @@ import scala.jdk.OptionConverters.RichOptional
 class NCSemanticEntityParserSpec:
     import NCSemanticTestElement as E
     private val semParser: NCSemanticEntityParser =
-        NCTestUtils.mkENSemanticParser(
+        NCTestUtils.mkEnSemanticParser(
             Seq(
                 // Standard.
                 E("t1", synonyms = Set("t1")),
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserYamlSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserYamlSpec.scala
index 541c4e5..89f3ddd 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserYamlSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParserYamlSpec.scala
@@ -32,7 +32,7 @@ import scala.jdk.OptionConverters.RichOptional
   *
   */
 class NCSemanticEntityParserYamlSpec:
-    private val semParser: NCSemanticEntityParser = NCTestUtils.mkENSemanticParser("models/lightswitch_model.yaml")
+    private val semParser: NCSemanticEntityParser = NCTestUtils.mkEnSemanticParser("models/lightswitch_model.yaml")
 
     /**
       * 
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/util/NCTestUtils.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/util/NCTestUtils.scala
index da731fc..b444cf9 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/util/NCTestUtils.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/nlp/util/NCTestUtils.scala
@@ -138,16 +138,15 @@ object NCTestUtils:
       * @param macros
       * @return
       */
-    def mkENSemanticParser(elms: JList[NCSemanticElement], macros: JMap[String, String] = null): NCSemanticEntityParser =
+    def mkEnSemanticParser(elms: JList[NCSemanticElement], macros: JMap[String, String] = null): NCSemanticEntityParser =
         new NCSemanticEntityParser(mkSemanticStemmer, EN_TOK_PARSER, macros, elms)
 
     /**
       *
       * @param elms
-      * @param macros
       * @return
       */
-    def mkENSemanticParser(elms: NCSemanticElement*): NCSemanticEntityParser =
+    def mkEnSemanticParser(elms: NCSemanticElement*): NCSemanticEntityParser =
         new NCSemanticEntityParser(mkSemanticStemmer, EN_TOK_PARSER, null, elms.asJava)
 
     /**
@@ -155,5 +154,5 @@ object NCTestUtils:
       * @param src
       * @return
       */
-    def mkENSemanticParser(src: String): NCSemanticEntityParser =
+    def mkEnSemanticParser(src: String): NCSemanticEntityParser =
         new NCSemanticEntityParser(mkSemanticStemmer, EN_TOK_PARSER, src)
\ No newline at end of file