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 <[email protected]> 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 {
