This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-468
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-468 by this push:
new 14c0777 WIP.
14c0777 is described below
commit 14c0777902c41018e0585174c09937d2bf26e080
Author: Sergey Kamov <[email protected]>
AuthorDate: Mon Oct 11 15:54:52 2021 +0300
WIP.
---
.../main/scala/org/apache/nlpcraft/NCNlpcraft.java | 28 ++++++++++++++++++++++
.../scala/org/apache/nlpcraft/model/NCVariant.java | 2 ++
2 files changed, 30 insertions(+)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCNlpcraft.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCNlpcraft.java
index d96c4c7..0ef9098 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCNlpcraft.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCNlpcraft.java
@@ -47,4 +47,32 @@ public interface NCNlpcraft {
void clearDialog(String userId);
void clearDialog();
+
+ // TODO: for discussion
+ /**
+ * Confirmation and curation - maximum direct, simple and straight way.
+ * a) add to intents property `need_confirm` (boolean, default false)
+ * b) add to models property `need_curation` (boolean, default false)
+ * c) add to NCResult 3 fields:
+ * - variants (sorted from best to worst, first is winner)
List<NCVariant>, mandatory.
+ * - `need_confirm` (boolean, optional, omitted processed as false)
+ * - `need_curation` (boolean, optional, omitted processed as false)
+
+ * 1. Confirmation
+ * - add 'need_confirm' = true flag to intents, which require
confirmations.
+ * - set NCResult `need_confirm` = true if such intent fired.
+ * - add new API method
+ * `void confirm(String srvReqId, boolean confirm)`;
+ *
+ * 2. Curation.
+ * - add 'need_curation' = true flag to model, which supports curation.
+ * - set `need_curation` = true in NCResult if there isn't intent found.
+ * - add new API method
+ * - `String curateText(String srvReqId)`; - which returns fixes
request text
+ * or
+ * - `NCVariant curateVariant(String srvReqId)`; - which returns
created winner variant.
+ *
+ * Curated request cached most easiest way - by stems without stopwords.
+ *
+ */
}
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCVariant.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCVariant.java
index 3eb8c11..4f76d56 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCVariant.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCVariant.java
@@ -21,6 +21,8 @@ import java.util.List;
import java.util.stream.Collectors;
/**
+ * TODO: Let's drop list extending.
+ *
* A parsing variant is a list of tokens representing one possible parsing
variant of the user input.
* <p>
* Note that a given user input can have one or more possible different
parsing variants. Depending on model