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 2022/03/28 11:30:45 UTC
[incubator-nlpcraft] 02/02: Ask validation client method added.
This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch master-ask-validate
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
commit 19c23866d41029274a31b8ddf338ac9365b82dd1
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Mon Mar 28 14:30:29 2022 +0300
Ask validation client method added.
---
nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelClient.java | 4 ++--
.../scala/org/apache/nlpcraft/internal/impl/NCModelClientImpl.scala | 2 +-
.../scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec.scala | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelClient.java b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelClient.java
index 3924812..7b98fd9 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelClient.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCModelClient.java
@@ -100,7 +100,7 @@ public class NCModelClient implements AutoCloseable {
impl.validateSamples();
}
- public List<List<NCEntity>> validateAsk(String txt, Map<String, Object> data, String usrId) {
- return impl.validateAsk(txt, data, usrId);
+ public List<List<NCEntity>> validateIntentArguments(String txt, Map<String, Object> data, String usrId) {
+ return impl.validateIntentArguments(txt, data, usrId);
}
}
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelClientImpl.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelClientImpl.scala
index 06887a0..dfc321a 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelClientImpl.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelClientImpl.scala
@@ -191,5 +191,5 @@ class NCModelClientImpl(mdl: NCModel) extends LazyLogging:
dlgMgr.close()
convMgr.close()
- def validateAsk(txt: String, data: JMap[String, AnyRef], usrId: String): JList[JList[NCEntity]] =
+ def validateIntentArguments(txt: String, data: JMap[String, AnyRef], usrId: String): JList[JList[NCEntity]] =
ask0(txt, data, usrId, true).getBody.asInstanceOf[JList[JList[NCEntity]]]
\ No newline at end of file
diff --git a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec.scala b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec.scala
index 72928aa..9168b8b 100644
--- a/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec.scala
+++ b/nlpcraft/src/test/scala/org/apache/nlpcraft/internal/impl/NCModelClientSpec.scala
@@ -40,7 +40,7 @@ class NCModelClientSpec:
println(s"Body: ${res.getBody}")
client.validateSamples()
- val entities = client.validateAsk("Lights on at second floor kitchen", null, "userId")
+ val entities = client.validateIntentArguments("Lights on at second floor kitchen", null, "userId")
println("Entities: \n" + entities.asScala.map(p => p.asScala.map(s).mkString(", ")).mkString("\n"))
}