You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by ar...@apache.org on 2021/07/10 16:26:38 UTC

[incubator-nlpcraft-website] branch master updated: Fix for NLPCRAFT-362

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

aradzinski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft-website.git


The following commit(s) were added to refs/heads/master by this push:
     new 65ee3ef  Fix for NLPCRAFT-362
65ee3ef is described below

commit 65ee3efe1dace4ad37a6e2bbe9e2574dde734d91
Author: Aaron Radzinzski <ar...@datalingvo.com>
AuthorDate: Sat Jul 10 09:26:27 2021 -0700

    Fix for NLPCRAFT-362
---
 cheat-sheet.html           |  5 +++--
 examples/alarm_clock.html  |  6 +++---
 examples/light_switch.html |  6 +++---
 examples/sql_model.html    |  6 +++---
 examples/weather_bot.html  |  6 +++---
 first-example.html         |  6 +++---
 intent-matching.html       | 12 ++++++++++++
 tools/syn_tool.html        |  9 ++++-----
 tools/test_framework.html  | 12 +++++++-----
 9 files changed, 41 insertions(+), 27 deletions(-)

diff --git a/cheat-sheet.html b/cheat-sheet.html
index bc7fe44..85c48b9 100644
--- a/cheat-sheet.html
+++ b/cheat-sheet.html
@@ -342,8 +342,9 @@ id: cheat_sheet
                         <p>
                             Auto model validation consists
                             of starting an <a href="/tools/embedded_probe.html">embedded probe</a>, scanning for
-                            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotations and their corresponding callback methods, submitting each
-                            sample input sentences from <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotation and checking that resulting
+                            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> and
+                            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a> annotations and their corresponding callback methods, submitting each
+                            sample input sentences from these annotation and checking that resulting
                             intent matches the intent the sample was attached to.
                         </p>
                         <nav>
diff --git a/examples/alarm_clock.html b/examples/alarm_clock.html
index 46adcc6..347f270 100644
--- a/examples/alarm_clock.html
+++ b/examples/alarm_clock.html
@@ -326,10 +326,10 @@ public class AlarmClock extends NCModelFileAdapter {
                 target="javadoc"
                 href="/apis/latest/org/apache/nlpcraft/model/tools/test/NCTestAutoModelValidator.html">NCTestAutoModelValidator</a> takes one or more model IDs
             (or class names) and performs validation. Validation consists of starting an  <a href="/tools/embedded_probe.html">embedded probe</a> with a given model,
-            scanning for <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotations
+            scanning for <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> and
+            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a> annotations
             and their corresponding callback methods, submitting each sample input
-            sentences from <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a>
-            annotation and checking that resulting intent matches the intent the sample was attached to.
+            sentences from these annotations and checking that resulting intent matches the intent the sample was attached to.
             Note that auto-testing does not require any additional code to be written - the class gathers all required information from the model
             itself.
         </p>
diff --git a/examples/light_switch.html b/examples/light_switch.html
index d52b48b..18fd4a7 100644
--- a/examples/light_switch.html
+++ b/examples/light_switch.html
@@ -288,10 +288,10 @@ class LightSwitch extends NCModelFileAdapter("light_switch.yaml") {
                 target="javadoc"
                 href="/apis/latest/org/apache/nlpcraft/model/tools/test/NCTestAutoModelValidator.html">NCTestAutoModelValidator</a> takes one or more model IDs
             (or class names) and performs validation. Validation consists of starting an  <a href="/tools/embedded_probe.html">embedded probe</a> with a given model,
-            scanning for <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotations
+            scanning for <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> and
+            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a> annotations
             and their corresponding callback methods, submitting each sample input
-            sentences from <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a>
-            annotation and checking that resulting intent matches the intent the sample was attached to.
+            sentences from these annotations and checking that resulting intent matches the intent the sample was attached to.
             Note that auto-testing does not require any additional code to be written - the class gathers all required information from the model
             itself.
         </p>
diff --git a/examples/sql_model.html b/examples/sql_model.html
index e2dbb61..7027eca 100644
--- a/examples/sql_model.html
+++ b/examples/sql_model.html
@@ -214,10 +214,10 @@ fa_icon: fa-cube
                 target="javadoc"
                 href="/apis/latest/org/apache/nlpcraft/model/tools/test/NCTestAutoModelValidator.html">NCTestAutoModelValidator</a> takes one or more model IDs
             (or class names) and performs validation. Validation consists of starting an  <a href="/tools/embedded_probe.html">embedded probe</a> with a given model,
-            scanning for <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotations
+            scanning for <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> and
+            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a> annotations
             and their corresponding callback methods, submitting each sample input
-            sentences from <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a>
-            annotation and checking that resulting intent matches the intent the sample was attached to.
+            sentences from these annotations and checking that resulting intent matches the intent the sample was attached to.
             Note that auto-testing does not require any additional code to be written - the class gathers all required information from the model
             itself.
         </p>
diff --git a/examples/weather_bot.html b/examples/weather_bot.html
index 244bf41..0b4b573 100644
--- a/examples/weather_bot.html
+++ b/examples/weather_bot.html
@@ -443,10 +443,10 @@ public class Weather extends NCModelFileAdapter {
                 target="javadoc"
                 href="/apis/latest/org/apache/nlpcraft/model/tools/test/NCTestAutoModelValidator.html">NCTestAutoModelValidator</a> takes one or more model IDs
             (or class names) and performs validation. Validation consists of starting an  <a href="/tools/embedded_probe.html">embedded probe</a> with a given model,
-            scanning for <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotations
+            scanning for <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> and
+            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a> annotations
             and their corresponding callback methods, submitting each sample input
-            sentences from <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a>
-            annotation and checking that resulting intent matches the intent the sample was attached to.
+            sentences from these annotations and checking that resulting intent matches the intent the sample was attached to.
             Note that auto-testing does not require any additional code to be written - the class gathers all required information from the model
             itself.
         </p>
diff --git a/first-example.html b/first-example.html
index 98a48e6..3b661da 100644
--- a/first-example.html
+++ b/first-example.html
@@ -378,10 +378,10 @@ class LightSwitchKotlinModel : NCModelFileAdapter("lightswitch_model.yaml") {
                 target="javadoc"
                 href="/apis/latest/org/apache/nlpcraft/model/tools/test/NCTestAutoModelValidator.html">NCTestAutoModelValidator</a> takes one or more model IDs
             (or class names) and performs validation. Validation consists of starting an  <a href="/tools/embedded_probe.html">embedded probe</a> with a given model,
-            scanning for <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotations
+            scanning for <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> and
+            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a> annotations
             and their corresponding callback methods, submitting each sample input
-            sentences from <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a>
-            annotation and checking that resulting intent matches the intent the sample was attached to.
+            sentences from these annotation and checking that resulting intent matches the intent the sample was attached to.
             Note that auto-testing does not require any additional code to be written - the class gathers all required information from the model
             itself.
         </p>
diff --git a/intent-matching.html b/intent-matching.html
index 6940ed3..cdb0c7d 100644
--- a/intent-matching.html
+++ b/intent-matching.html
@@ -1090,6 +1090,18 @@ id: intent_matching
                         and and <a href="/tools/syn_tool.html">synonym suggesting</a> tools.
                     </td>
                 </tr>
+                <tr>
+                    <td><a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a></td>
+                    <td>Callback method</td>
+                    <td>
+                        Annotation that allows to load samples of the input that associated intent should match on from the external
+                        sources like local file, classpath resource or URL.
+                        Although this annotation is optional it's <b>highly recommended</b> to provide at least several samples per intent. There's no upper
+                        limit on how many examples can be provided and typically the more examples the better for the built-in tools.
+                        These samples serve documentation purpose as well as used in built-in model <a href="/tools/test_framework.html">auto-validation</a>
+                        and and <a href="/tools/syn_tool.html">synonym suggesting</a> tools.
+                    </td>
+                </tr>
             </tbody>
         </table>
         <p>
diff --git a/tools/syn_tool.html b/tools/syn_tool.html
index b338db5..9519929 100644
--- a/tools/syn_tool.html
+++ b/tools/syn_tool.html
@@ -31,9 +31,9 @@ fa_icon: fa-tools
         </p>
         <p>
             This tool is accessed via REST call. It is based on Google's BERT and Facebook fasttext
-            models. It requires <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotations present on intent
-            callbacks. When invoked, the tool scans the given data model for intents and their
-            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotations, and based on these samples tries to determine
+            models. It requires <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> or
+            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a> annotations present on intent
+            callbacks. When invoked, the tool scans the given data model for intents and these annotations, and based on these samples tries to determine
             which synonyms are missing in the model.
         </p>
     </section>
@@ -276,8 +276,7 @@ fa_icon: fa-tools
             <p>
                 It is a good idea to run this tool periodically if you are actively changing the model. With dozens or hundreds
                 of model elements it is very hard to manually maintain quality set of synonyms. With a good list of
-                <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a>
-                samples for each intent this tool can be indispensable for easy maintenance of the synonyms.
+                user input samples for each intent this tool can be indispensable for easy maintenance of the synonyms.
             </p>
         </div>
     </section>
diff --git a/tools/test_framework.html b/tools/test_framework.html
index 32defb7..472ee46 100644
--- a/tools/test_framework.html
+++ b/tools/test_framework.html
@@ -43,7 +43,8 @@ fa_icon: fa-tools
                             target="javadoc"
                             href="/apis/latest/org/apache/nlpcraft/model/tools/test/NCTestAutoModelValidator.html">
                             NCTestAutoModelValidator
-                        </a> - auto-runner for model tests based on <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotation.
+                        </a> - auto-runner for model tests based on <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a>
+                        and <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a> annotations.
                     </li>
                 </ul>
             </li>
@@ -154,7 +155,8 @@ public class AlarmTest {
         <p>
             The same model from <a href="/examples/alarm_clock.html">Alarm Clock</a> example can be auto validated using
             <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/tools/test/NCTestAutoModelValidator.html">NCTestAutoModelValidator</a>
-            class and the <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotation from the model's callback method:
+            class and user defined <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> and
+            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a> annotations from the model's callback method:
         </p>
         <pre class="brush: java, highlight: [4, 5, 6]">
 public class AlarmModel extends NCModelFileAdapter {
@@ -175,9 +177,9 @@ public class AlarmModel extends NCModelFileAdapter {
         <p>
             Auto model validator takes one or more model IDs (or class names) and performs validation. Validation consists
             of starting an <a href="/tools/embedded_probe.html">embedded probe</a> with a given model, scanning for
-            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotations and their corresponding callback methods, submitting each
-            sample input sentences from <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> annotation and checking that resulting
-            intent matches the intent the sample was attached to.
+            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a> and
+            <a target="javadoc" href="/apis/latest/org/apache/nlpcraft/model/NCIntentSampleRef.html">@NCIntentSampleRef</a> annotations and their corresponding callback methods, submitting each
+            sample input sentences from these annotation and checking that resulting intent matches the intent the sample was attached to.
         </p>
         <h2 class="section-sub-title">Running <a href="#"><i class="top-link fas fa-fw fa-angle-double-up"></i></a></h2>
         <p>