You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2021/04/15 09:33:17 UTC

[incubator-nlpcraft] branch NLPCRAFT-287 updated (1440cfd -> 0387d2e)

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

sergeykamov pushed a change to branch NLPCRAFT-287
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git.


    from 1440cfd  WIP.
     new 2b8bef5  WIP.
     new 32117c1  WIP.
     new 0387d2e  WIP.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/nlpcraft/common/util/NCUtils.scala  |   6 +-
 .../apache/nlpcraft/probe/mgrs/NCProbeModel.scala  |   7 +-
 .../nlpcraft/probe/mgrs/NCProbeSynonym.scala       |  29 ++--
 .../mgrs/nlp/enrichers/model/NCModelEnricher.scala | 175 +++++++++++----------
 .../model/NCEnricherNestedModelSpec2.scala         |   2 +-
 5 files changed, 124 insertions(+), 95 deletions(-)

[incubator-nlpcraft] 01/03: WIP.

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 2b8bef53b14aa3821ea3323a639f292dd0cfe5bf
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Thu Apr 15 11:42:20 2021 +0300

    WIP.
---
 .../org/apache/nlpcraft/common/util/NCUtils.scala  |  6 ++-
 .../nlpcraft/probe/mgrs/NCProbeSynonym.scala       | 10 +----
 .../mgrs/nlp/enrichers/model/NCModelEnricher.scala | 51 ++++++++--------------
 3 files changed, 24 insertions(+), 43 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/util/NCUtils.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/util/NCUtils.scala
index 5d25c25..636878b 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/util/NCUtils.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/util/NCUtils.scala
@@ -2131,10 +2131,12 @@ object NCUtils extends LazyLogging {
     def isContinuous(idxs: Seq[Int]): Boolean = {
         require(idxs.nonEmpty)
 
-        idxs.size match {
+        val list = idxs.view
+
+        list.size match {
             case 0 ⇒ throw new AssertionError()
             case 1 ⇒ true
-            case _ ⇒  idxs.zip(idxs.tail).forall { case (x, y) ⇒ x + 1 == y }
+            case _ ⇒  list.zip(list.tail).forall { case (x, y) ⇒ x + 1 == y }
         }
     }
 
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala
index 207bc02..b944ccc 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala
@@ -134,15 +134,7 @@ class NCProbeSynonym(
                     state = -1
             }
 
-            if (
-                state != -1 &&
-                all.size == res.size
-                    &&
-                (
-                    !shouldBeNeighbors ||
-                    U.isIncreased(res.map(getIndex).sorted)
-                )
-            )
+            if (state != -1 && all.size == res.size && (!shouldBeNeighbors || U.isIncreased(res.map(getIndex).sorted)))
                 Some(res)
             else
                 None
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala
index d85f429..353687b 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala
@@ -156,16 +156,14 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
       * @param toks
       * @param direct
       * @param syn
-      * @param metaOpt
       * @param parts
-      * @param continuous
+      * @param metaOpt
       */
     private def mark(
         ns: NCNlpSentence,
         elem: NCElement,
         toks: Seq[NlpToken],
         direct: Boolean,
-        continuous: java.lang.Boolean,
         syn: Option[Synonym] = None,
         parts: Seq[TokType] = Seq.empty,
         metaOpt: Option[Map[String, Object]] = None
@@ -175,10 +173,6 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
         // For system elements.
         params += "direct" → direct.asInstanceOf[AnyRef]
 
-        // Internal usage.
-        params += "sortedTokensIndexes" → toks.map(_.index).sorted.asJava
-        params += "continuous" → continuous
-
         syn match {
             case Some(s) ⇒
                 if (s.isValueSynonym)
@@ -287,15 +281,12 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
                         )
 
                         // Checks element's tokens.
-                        val idxs = matchedToks.map(_.index).sorted
-
-                        if (!alreadyMarked(ns, elemId, matchedToks, idxs))
+                        if (!alreadyMarked(ns, elemId, matchedToks, matchedToks.map(_.index).sorted))
                             mark(
                                 ns,
                                 elem = mdl.elements.getOrElse(elemId, throw new NCE(s"Custom model parser returned unknown element ID: $elemId")),
                                 toks = matchedToks,
                                 direct = true,
-                                U.isContinuous(idxs),
                                 metaOpt = Some(e.getMetadata.asScala)
                             )
                     })
@@ -443,9 +434,7 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
     : Unit = {
         val resIdxs = res.map(_.index)
 
-        val continuous = U.isContinuous(resIdxs.sorted)
-
-        if (continuous && resIdxs == allToksIdxs)
+        if (U.isContinuous(resIdxs.sorted) && resIdxs == allToksIdxs)
             contCache(elm.getId) += allToksIdxs
 
         val ok = !alreadyMarked(ns, elm.getId, res, allToksIdxs)
@@ -453,7 +442,7 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
         if (ok) {
             val direct = syn.isDirect && U.isIncreased(resIdxs)
 
-            mark(ns, elm, res, direct, continuous, syn = Some(syn), parts)
+            mark(ns, elm, res, direct, syn = Some(syn), parts)
         }
 
         if (DEEP_DEBUG)
@@ -464,7 +453,6 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
                     s"text='${res.map(_.origText).mkString(" ")}', " +
                     s"indexes=${resIdxs.mkString("[", ",", "]")}, " +
                     s"allTokensIndexes=${allToksIdxs.mkString("[", ",", "]")}, " +
-                    s"continuous=$continuous, " +
                     s"synonym=$syn" +
                     s"]"
             )
@@ -572,27 +560,26 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
 
     /**
       *
-      * @param ns
       * @param elemId
       * @param toks
       * @param allSortedSliceIdxs
       */
     private def alreadyMarked(ns: NCNlpSentence, elemId: String, toks: Seq[NlpToken], allSortedSliceIdxs: Seq[Int]): Boolean = {
         lazy val toksIdxsSorted = toks.map(_.index).sorted
-        lazy val isCont = U.isContinuous(toksIdxsSorted)
-
-        ns.flatten.exists(
-            n ⇒
-                n.noteType == elemId &&
-                {
-                    lazy val nToksIdxsSorted = n.data[JList[Int]]("sortedTokensIndexes").asScala
-
-                    n.data[Boolean]("continuous") && allSortedSliceIdxs.containsSlice(nToksIdxsSorted) ||
-                        {
-                            nToksIdxsSorted == toksIdxsSorted ||
-                            isCont && U.isContinuous(nToksIdxsSorted) && nToksIdxsSorted.containsSlice(toksIdxsSorted)
-                        }
-                }
-        )
+
+        allSortedSliceIdxs.map(ns).forall(_.exists(n ⇒ n.noteType == elemId && n.isContiguous)) ||
+        toks.exists(_.exists(n ⇒
+            n.noteType == elemId &&
+            (
+                (n.isContiguous &&
+                    (allSortedSliceIdxs.containsSlice(n.tokenIndexes) || n.tokenIndexes.containsSlice(toksIdxsSorted))
+                )
+                    ||
+                (
+                    n.tokenIndexes == toksIdxsSorted ||
+                    n.tokenIndexes.containsSlice(toksIdxsSorted) && U.isContinuous(toksIdxsSorted) && U.isContinuous(n.tokenIndexes)
+                )
+            )
+        ))
     }
 }
\ No newline at end of file

[incubator-nlpcraft] 03/03: WIP.

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 0387d2e157b0b6d189d9e439bdbc8c30c484c9c1
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Thu Apr 15 12:33:07 2021 +0300

    WIP.
---
 .../apache/nlpcraft/probe/mgrs/NCProbeModel.scala  |   7 +-
 .../nlpcraft/probe/mgrs/NCProbeSynonym.scala       |  19 +++-
 .../mgrs/nlp/enrichers/model/NCModelEnricher.scala | 126 +++++++++++++--------
 3 files changed, 100 insertions(+), 52 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeModel.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeModel.scala
index 2670fb7..03c5cb3 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeModel.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeModel.scala
@@ -48,7 +48,10 @@ case class NCProbeModel(
     elements: Map[String /*Element ID*/ , NCElement],
     samples: Set[(String, Seq[Seq[String]])]
 ) {
+    lazy val hasIdlSynonyms: Boolean = idlSynonyms.nonEmpty
+    lazy val hasNoIdlSynonyms: Boolean = continuousSynonyms.nonEmpty || sparseSynonyms.nonEmpty
+    lazy val hasSparseSynonyms: Boolean = sparseSynonyms.nonEmpty || idlSynonyms.exists(_._2.exists(_.sparse))
+    lazy val hasContinuousSynonyms: Boolean = continuousSynonyms.nonEmpty || idlSynonyms.exists(_._2.exists(!_.sparse))
+
     def hasIdlSynonyms(elemId: String): Boolean = idlSynonyms.contains(elemId)
-    def hasIdlSynonyms: Boolean = idlSynonyms.nonEmpty
-    def hasNoIdlSynonyms: Boolean = continuousSynonyms.nonEmpty || sparseSynonyms.nonEmpty
 }
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala
index b944ccc..d5361f8 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/NCProbeSynonym.scala
@@ -186,6 +186,23 @@ class NCProbeSynonym(
 
     /**
       *
+      * @param tows
+      * @param req
+      * @return
+      */
+    def isMatch(tows: Seq[NCIdlContent], req: NCRequest): Boolean = {
+        require(tows != null)
+
+        if (tows.length == length && tows.count(_.isLeft) >= idlChunks)
+            tows.zip(this).sortBy(p ⇒ getSort(p._2.kind)).forall { case (tow, chunk) ⇒ isMatch(tow, chunk, req) }
+        else
+            false
+    }
+
+
+
+    /**
+      *
       * @param toks
       */
     def sparseMatch(toks: NCNlpSentenceTokenBuffer): Option[Seq[NCNlpSentenceToken]] = {
@@ -200,7 +217,7 @@ class NCProbeSynonym(
       * @param tows
       * @param req
       */
-    def idlMatch(tows: Seq[NCIdlContent], req: NCRequest): Option[Seq[NCIdlContent]] = {
+    def sparseMatch(tows: Seq[NCIdlContent], req: NCRequest): Option[Seq[NCIdlContent]] = {
         require(tows != null)
         require(req != null)
         require(hasIdl)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala
index 353687b..120d8d0 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCModelEnricher.scala
@@ -402,7 +402,7 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
       * @param h
       * @param toks
       */
-    private def mkComplexCombinations(h: ComplexHolder, toks: Seq[NlpToken], cache: Set[Seq[Complex]]): Seq[Seq[Complex]] = {
+    private def mkCombinations(h: ComplexHolder, toks: Seq[NlpToken], cache: Set[Seq[Complex]]): Seq[Seq[Complex]] = {
         val idxs = toks.flatMap(_.wordIndexes).toSet
 
         h.complexes.par.
@@ -423,9 +423,9 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
     }
 
     private def add(
+        dbgType: String,
         ns: NCNlpSentence,
-        contCache: mutable.Map[String, ArrayBuffer[Seq[Int]]],
-        typ: String,
+        contCache: Cache,
         elm: NCElement,
         res: Seq[NlpToken],
         allToksIdxs: Seq[Int],
@@ -449,7 +449,7 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
             logger.trace(
                 s"${if (ok) "Added" else "Skipped"} element [" +
                     s"id=${elm.getId}, " +
-                    s"type=$typ, " +
+                    s"type=$dbgType, " +
                     s"text='${res.map(_.origText).mkString(" ")}', " +
                     s"indexes=${resIdxs.mkString("[", ",", "]")}, " +
                     s"allTokensIndexes=${allToksIdxs.mkString("[", ",", "]")}, " +
@@ -462,85 +462,110 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
     override def enrich(mdl: NCProbeModel, ns: NCNlpSentence, senMeta: Map[String, Serializable], parent: Span = null): Unit = {
         require(isStarted)
 
-        startScopedSpan("enrich", parent, "srvReqId" → ns.srvReqId, "mdlId" → mdl.model.getId, "txt" → ns.text) { span ⇒
+        startScopedSpan(
+            "enrich", parent, "srvReqId" → ns.srvReqId, "mdlId" → mdl.model.getId, "txt" → ns.text
+        ) { span ⇒
             val req = NCRequestImpl(senMeta, ns.srvReqId)
             val combToks = combos(ns)
             lazy val ch = mkComplexes(mdl, ns)
 
             def execute(simpleEnabled: Boolean, idlEnabled: Boolean): Unit =
-                startScopedSpan("execute", parent, "srvReqId" → ns.srvReqId, "mdlId" → mdl.model.getId, "txt" → ns.text) { _ ⇒
+                startScopedSpan(
+                    "execute", span, "srvReqId" → ns.srvReqId, "mdlId" → mdl.model.getId, "txt" → ns.text
+                ) { _ ⇒
                     if (DEEP_DEBUG)
                         logger.trace(s"Execution started [simpleEnabled=$simpleEnabled, idlEnabled=$idlEnabled]")
 
-                    val contCache = mutable.HashMap.empty ++ mdl.elements.keys.map(k ⇒ k → mutable.ArrayBuffer.empty[Seq[Int]])
+                    val contCache = mutable.HashMap.empty ++
+                        mdl.elements.keys.map(k ⇒ k → mutable.ArrayBuffer.empty[Seq[Int]])
                     lazy val idlCache = mutable.HashSet.empty[Seq[Complex]]
 
                     for (
                         toks ← combToks;
-                        tokIdxs = toks.map(_.index);
-                        elm ← mdl.elements.values;
-                        elemId = elm.getId
+                        idxs = toks.map(_.index);
+                        e ← mdl.elements.values;
+                        eId = e.getId
                         if
-                            !contCache(elemId).exists(_.containsSlice(tokIdxs)) &&
-                            !alreadyMarked(ns, elemId, toks, tokIdxs)
+                            !contCache(eId).exists(_.containsSlice(idxs)) &&
+                            !alreadyMarked(ns, eId, toks, idxs)
                     ) {
                         // 1. SIMPLE.
-                        if (simpleEnabled && (if (idlEnabled) mdl.hasIdlSynonyms(elemId) else !mdl.hasIdlSynonyms(elemId))) {
+                        if (simpleEnabled && (if (idlEnabled) mdl.hasIdlSynonyms(eId) else !mdl.hasIdlSynonyms(eId))) {
                             lazy val tokStems = toks.map(_.stem).mkString(" ")
 
                             // 1.1 Continuous.
                             var found = false
 
-                            fastAccess(mdl.continuousSynonyms, elemId, toks.length) match {
-                                case Some(h) ⇒
-                                    def tryMap(syns: Map[String, Synonym], notFound: () ⇒ Unit): Unit =
-                                        syns.get(tokStems) match {
-                                            case Some(s) ⇒
-                                                found = true
-                                                add(ns, contCache,"simple continuous", elm, toks, tokIdxs, s)
-                                            case None ⇒ notFound()
-                                        }
-
-                                    def tryScan(syns: Seq[Synonym]): Unit =
-                                        for (s ← syns if !found)
-                                            if (s.isMatch(toks)) {
-                                                found = true
-                                                add(ns, contCache, "simple continuous scan", elm, toks, tokIdxs, s)
+                            if (mdl.hasContinuousSynonyms)
+                                fastAccess(mdl.continuousSynonyms, eId, toks.length) match {
+                                    case Some(h) ⇒
+                                        def tryMap(syns: Map[String, Synonym], notFound: () ⇒ Unit): Unit =
+                                            syns.get(tokStems) match {
+                                                case Some(s) ⇒
+                                                    found = true
+                                                    add("simple continuous", ns, contCache, e, toks, idxs, s)
+                                                case None ⇒ notFound()
                                             }
 
-                                    tryMap(
-                                        h.txtDirectSynonyms,
-                                        () ⇒ {
-                                            tryScan(h.notTxtDirectSynonyms)
+                                        def tryScan(syns: Seq[Synonym]): Unit =
+                                            for (s ← syns if !found)
+                                                if (s.isMatch(toks)) {
+                                                    found = true
+                                                    add("simple continuous scan", ns, contCache, e, toks, idxs, s)
+                                                }
 
-                                            if (!found)
-                                                tryMap(h.txtNotDirectSynonyms, () ⇒ tryScan(h.notTxtNotDirectSynonyms))
-                                        }
-                                    )
-                                case None ⇒ // No-op.
-                            }
+                                        tryMap(
+                                            h.txtDirectSynonyms,
+                                            () ⇒ {
+                                                tryScan(h.notTxtDirectSynonyms)
+
+                                                if (!found)
+                                                    tryMap(h.txtNotDirectSynonyms, () ⇒ tryScan(h.notTxtNotDirectSynonyms))
+                                            }
+                                        )
+                                    case None ⇒ // No-op.
+                                }
 
                             // 1.2 Sparse.
-                            if (!found)
-                                for (s ← get(mdl.sparseSynonyms, elemId))
+                            if (!found && mdl.hasSparseSynonyms)
+                                for (s ← get(mdl.sparseSynonyms, eId))
                                     s.sparseMatch(toks) match {
-                                        case Some(res) ⇒ add(ns, contCache, "simple sparse", elm, res, tokIdxs, s)
+                                        case Some(res) ⇒ add("simple sparse", ns, contCache, e, res, idxs, s)
                                         case None ⇒ // No-op.
                                     }
                         }
 
                         // 2. IDL.
-                        if (idlEnabled)
-                            for (s ← get(mdl.idlSynonyms, elemId); comb ← mkComplexCombinations(ch, toks, idlCache.toSet))
-                                s.idlMatch(comb.map(_.data), req) match {
-                                    case Some(res) ⇒
-                                        val typ = if (s.sparse) "IDL sparse" else "IDL continuous"
+                        if (idlEnabled) {
+                            if (mdl.hasSparseSynonyms)
+                                for (s ← get(mdl.idlSynonyms, eId); comb ← mkCombinations(ch, toks, idlCache.toSet))
+                                    s.sparseMatch(comb.map(_.data), req) match {
+                                        case Some(res) ⇒
+                                            val typ = if (s.sparse) "IDL sparse" else "IDL continuous"
+
+                                            add(typ, ns, contCache, e, toTokens(res, ns), idxs, s, toParts(res, s))
 
-                                        add(ns, contCache, typ, elm, toTokens(res, ns), tokIdxs, s, toParts(res, s))
+                                            idlCache += comb
+                                        case None ⇒ // No-op.
+                                    }
+                            else {
+                                var found = false
+
+                                for (
+                                    s ← get(mdl.idlSynonyms, eId);
+                                    comb ← mkCombinations(ch, toks, idlCache.toSet);
+                                    data = comb.map(_.data)
+                                    if !found
+                                )
+                                    if (s.isMatch(data, req)) {
+                                        add("IDL continuous", ns, contCache, e, toks, idxs, s, toParts(data, s))
 
                                         idlCache += comb
-                                    case None ⇒ // No-op.
+
+                                        found = true
                                 }
+                            }
+                        }
                     }
                 }
 
@@ -559,6 +584,7 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
     }
 
     /**
+      * TODO: simplify, add tests, check model properties (sparse etc) for optimization.
       *
       * @param elemId
       * @param toks
@@ -577,7 +603,9 @@ object NCModelEnricher extends NCProbeEnricher with DecorateAsScala {
                     ||
                 (
                     n.tokenIndexes == toksIdxsSorted ||
-                    n.tokenIndexes.containsSlice(toksIdxsSorted) && U.isContinuous(toksIdxsSorted) && U.isContinuous(n.tokenIndexes)
+                        n.tokenIndexes.containsSlice(toksIdxsSorted) &&
+                        U.isContinuous(toksIdxsSorted) &&
+                        U.isContinuous(n.tokenIndexes)
                 )
             )
         ))

[incubator-nlpcraft] 02/03: WIP.

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 32117c129744207b1a24bf21affa97d0a23d4c8e
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Thu Apr 15 11:48:25 2021 +0300

    WIP.
---
 .../probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec2.scala     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec2.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec2.scala
index 7b81473..a27a5b4 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec2.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/probe/mgrs/nlp/enrichers/model/NCEnricherNestedModelSpec2.scala
@@ -29,7 +29,7 @@ import java.util
 class NCNestedTestModel21 extends NCModelAdapter("nlpcraft.nested2.test.mdl", "Nested Test Model", "1.0") {
     override def getElements: util.Set[NCElement] = {
         // Note - it defines one simple and one DSL synonyms.
-        // But it should be caught by long (DSL) variant (for `10 word`)
+        // But it should be caught by long (IDL) variant (for `10 word`)
         Set(NCTestElement("e1", "{^^{tok_id() == 'nlpcraft:num'}^^|_} word"))
     }