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 2020/09/13 13:28:55 UTC

[incubator-nlpcraft] branch NLPCRAFT-120 created (now 604707b)

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

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


      at 604707b  WIP.

This branch includes the following new commits:

     new 604707b  WIP.

The 1 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.



[incubator-nlpcraft] 01/01: 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-120
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git

commit 604707bd0982d9eac02f4bda675c449d418363a5
Author: Sergey Kamov <se...@apache.org>
AuthorDate: Sun Sep 13 16:28:46 2020 +0300

    WIP.
---
 .../apache/nlpcraft/examples/weather/WeatherModel.java   |  1 -
 .../nlpcraft/probe/mgrs/deploy/NCDeployManager.scala     | 16 ++++++++++++++--
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java
index 5bc0734..b392175 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/weather/WeatherModel.java
@@ -132,7 +132,6 @@ public class WeatherModel extends NCModelFileAdapter {
     )
     @NCIntentSample({
         "What's the local weather forecast?",
-        "What's the local weather forecast?",
         "What's the weather in Moscow?",
         "What is the weather like outside?",
         "How's the weather?",
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
index fc760f2..44ff6d8 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
@@ -1467,7 +1467,7 @@ object NCDeployManager extends NCService with DecorateAsScala {
                             None
                         }
                         else {
-                            val samples = smpAnn.value().toList
+                            var samples = smpAnn.value().toList
 
                             if (samples.isEmpty) {
                                 logger.warn(s"@NCTestSample annotation is empty [" +
@@ -1477,8 +1477,20 @@ object NCDeployManager extends NCService with DecorateAsScala {
 
                                 None
                             }
-                            else
+                            else {
+                                if (U.containsDups(samples)) {
+                                    logger.warn(s"@NCTestSample annotation has duplicates [" +
+                                        s"mdlId=$mdlId, " +
+                                        s"callback=$mkMethodName, " +
+                                        s"duplicates=${samples.groupBy(p ⇒ p).filter(_._2.size > 1).map(_._1).mkString(", ")}" +
+                                        s"]"
+                                    )
+
+                                    samples = samples.distinct
+                                }
+
                                 Some(mkIntentId() → samples)
+                            }
                         }
                     }
                     else {