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 ba06e99  WIP.
ba06e99 is described below

commit ba06e991fa58abb1871c02c9fefa4d163bad52d7
Author: Sergey Kamov <[email protected]>
AuthorDate: Tue Jul 6 18:40:58 2021 +0300

    WIP.
---
 .../enrichers/ctxword/NCContextWordCategoriesEnricher.scala    | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/ctxword/NCContextWordCategoriesEnricher.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/ctxword/NCContextWordCategoriesEnricher.scala
index 50658fe..e19c30f 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/ctxword/NCContextWordCategoriesEnricher.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/server/nlp/enrichers/ctxword/NCContextWordCategoriesEnricher.scala
@@ -92,11 +92,11 @@ object NCContextWordCategoriesEnricher extends 
NCServerEnricher {
     // Service which responsible for all confidences calculations.
     private object ConfMath {
         /**
+          * Squeeze confidences values of some words to one value.
           *
-          * @param confs
-          * @return
+          * @param confs Confidences values for some word. It is result of 
corpus processing.
           */
-        def calculate(confs: Seq[Double]): Option[Double] =
+        def squeeze(confs: Seq[Double]): Option[Double] =
              // Drops if there is not enough data.
             if (confs.length < 3)
                 None
@@ -110,10 +110,10 @@ object NCContextWordCategoriesEnricher extends 
NCServerEnricher {
             }
 
         /**
+          * Calculates confidence values based on suggested confidence and 
corpus confidence.
           *
           * @param suggConf Suggestion confidence for noun of given sentence.
           * @param corpusConf Corpus confidence which found via suggestion, 
co-reference.
-          * @return
           */
         def calculate(suggConf: Double, corpusConf: Double): Double =
             // Corpus data is more important. Empirical factors configured.
@@ -437,7 +437,7 @@ object NCContextWordCategoriesEnricher extends 
NCServerEnricher {
 
                         def squeeze(map: Map[String, Seq[Double]]): 
Map[String, Double] =
                             map.flatMap { case (wordKey, confs) =>
-                                ConfMath.calculate(confs) match {
+                                ConfMath.squeeze(confs) match {
                                     case Some(conf) => Some(wordKey -> conf)
                                     case None => None
                                 }

Reply via email to