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

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


The following commit(s) were added to refs/heads/NLPCRAFT-70_NEW by this push:
     new d0a8fd8  WIP.
d0a8fd8 is described below

commit d0a8fd8fcd1eb0cc7b868a5271e080e41addc90c
Author: Sergey Kamov <[email protected]>
AuthorDate: Mon Jun 28 00:43:46 2021 +0300

    WIP.
---
 .../server/nlp/enrichers/ctxword/NCContextWordEnricher.scala     | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/ctxword/NCContextWordEnricher.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/ctxword/NCContextWordEnricher.scala
index a3dba51..eda1c9e 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/ctxword/NCContextWordEnricher.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/ctxword/NCContextWordEnricher.scala
@@ -234,15 +234,13 @@ object NCContextWordEnricher extends NCServerEnricher {
                 if (nounToks.nonEmpty) {
                     val key = ModelProbeKey(cfg.probeId, cfg.modelId)
 
-
+                    // 1. Values. Direct.
                     val valuesData = getValuesData(cfg, key)
 
-                    for (
-                        nounTok <- nounToks;
-                        elemId <- valuesData.getOrElse(nounTok.stem, Set.empty)
-                    )
+                    for (nounTok <- nounToks; elemId <- 
valuesData.getOrElse(nounTok.stem, Set.empty))
                         add(nounTok, elemId, 1, 1, 1)
 
+                    // 2. Via examples.
                     val mdlSamples = getSamplesData(cfg, key)
 
                     for (
@@ -253,6 +251,7 @@ object NCContextWordEnricher extends NCServerEnricher {
                     )
                         add(nounTok, elemId, score, score, score)
 
+                    // 3. Ask for sentence.
                     val idxs = ns.tokens.flatMap(p => if 
(p.pos.startsWith("N")) Some(p.index) else None).toSeq
                     val reqs = idxs.map(idx => 
NCSuggestionRequest(ns.tokens.map(_.origText).mkString(" "), idx))
 

Reply via email to