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 4923dc0 Fixing test docs.
4923dc0 is described below
commit 4923dc0021430b56a6241abd0f0efc5c3ab6e404
Author: Aaron Radzinski <[email protected]>
AuthorDate: Mon Jan 11 14:46:17 2021 -0800
Fixing test docs.
---
integrations.html | 4 ++-
server-and-probe.html | 4 +--
tools/test_framework.html | 73 ++++++++++++++++++++++++++++++++++-------------
3 files changed, 58 insertions(+), 23 deletions(-)
diff --git a/integrations.html b/integrations.html
index 1acc8ba..a5d7567 100644
--- a/integrations.html
+++ b/integrations.html
@@ -306,7 +306,9 @@ id: integrations
</tr>
</tbody>
</table>
- <p>Notes:</p>
+ <p>
+ <b>NOTES:</b>
+ </p>
<ul>
<li>
See <a href="data-model.html#meta">token metadata</a>
documentation for detailed information
diff --git a/server-and-probe.html b/server-and-probe.html
index 6a76952..1c3acee 100644
--- a/server-and-probe.html
+++ b/server-and-probe.html
@@ -244,13 +244,13 @@ id: server_and_probe
If using just executable JAR:
</p>
<pre class="brush: plain">
- $ java -Xms1024m -jar
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar -probe
+ $ java -jar
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar -probe
</pre>
<p>
If specifying additional classpath components and need
<code>-cp</code> parameter:
</p>
<pre class="brush: plain">
- java -Xms1024m -cp
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar:/my/project/classes
org.apache.nlpcraft.NCStart -probe -config=/my/project/probe.conf
+ java -cp
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar:/my/project/classes
org.apache.nlpcraft.NCStart -probe -config=/my/project/probe.conf
</pre>
<p>
<b>NOTES:</b>
diff --git a/tools/test_framework.html b/tools/test_framework.html
index 488ce83..ffc955a 100644
--- a/tools/test_framework.html
+++ b/tools/test_framework.html
@@ -118,7 +118,7 @@ public class AlarmTest {
}
</pre>
<p>
- Notes:
+ <b>NOTES:</b>
</p>
<ul>
<li>
@@ -172,33 +172,66 @@ public class AlarmModel extends NCModelFileAdapter {
}
</pre>
<p>
- Auto model validator
- will scan the model for its callback methods, collect all samples
from <code>@NCIntentSample</code> annotations, and
- will submit each sample and check that correct intent is selected
as the winning match. Notice that this auto validation
- does not require any additional code to be written - the tool
gathers all required information from the model
- itself.
+ Auto mode 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
+ <code>@NCIntentSample</code> annotations and their corresponding
callback methods, submitting each
+ sample input sentences from <code>@NCIntentSample</code>
annotation and checking that resulting
+ intent matches the intent the sample was attached to.
</p>
+ <h3 class="section-sub-title">Running</h3>
<p>
- Add necessary classpath to and run:
+ Auto mode validator can be executed in several ways:
</p>
- <pre class="brush: plain">
-java -ea -DNLPCRAFT_TEST_MODELS=org.apache.nlpcraft.examples.alarm.AlarmModel
org.apache.nlpcraft.model.tools.test.NCTestAutoModelValidator
- </pre>
- <p>
- Notes:
- </p>
- <ul>
- <li>
- When running auto validator from command line you set models
to test via <code>NLPFaFCRAFT_TEST_MODELS</code>
- system property that should contain comma separate list of the
data model classes.
- </li>
- </ul>
+ <nav>
+ <div class="nav nav-tabs" role="tablist">
+ <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-script" role="tab" aria-controls="nav-home"
aria-selected="true">NLPCraft CLI</a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-class" role="tab" aria-controls="nav-home" aria-selected="true">Java
Class</a>
+ </div>
+ </nav>
+ <div class="tab-content">
+ <div class="tab-pane fade show active" id="nav-script"
role="tabpanel">
+ <pre class="brush: plain">
+ $ bin/nlpcraft.sh test-model
+ </pre>
+ <p>
+ <b>NOTES:</b>
+ </p>
+ <ul>
+ <li>
+ Use <code>nlpcraft.sh</code> for Unix/Linux/MacOS and
<code>nlpcraft.cmd</code> for Windows.
+ </li>
+ <li>
+ Run <code>bin/nlpcraft.sh help --cmd=test-model</code>
to get a full help on this command.
+ </li>
+ </ul>
+ </div>
+ <div class="tab-pane fade show" id="nav-class" role="tabpanel">
+ <pre class="brush: plain">
+ java -cp
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar
-DNLPCRAFT_TEST_MODELS=org.apache.nlpcraft.examples.alarm.AlarmModel
org.apache.nlpcraft.model.tools.test.NCTestAutoModelValidator
+ </pre>
+ <p>
+ <b>NOTES:</b>
+ </p>
+ <ul>
+ <li>
+ Make sure to add necessary classpath components.
+ </li>
+ <li>
+ <code>NLPCRAFT_TEST_MODELS</code> system property that
should contain comma separate list of the data model classes to test.
+ </li>
+ <li>
+ You can also use
<code>org.apache.nlpcraft.model.tools.test.NCTestAutoModelValidator</code> class
+ directly to call it programmatically from the code or
from IDE.
+ </li>
+ </ul>
+ </div>
+ </div>
<p>
In the log output you should see the following validation results:
</p>
<figure>
<img class="img-fluid-no-border" src="/images/auto_validation.png"
alt="">
- <figcaption><b>Fig 1.</b> Model Auto-Validation
Result.</figcaption>
+ <figcaption><b>Fig 1.</b> Model auto-validation
result.</figcaption>
</figure>
<p>
See <a target="javadoc"
href="/apis/latest/org/apache/nlpcraft/model/tools/test/NCTestAutoModelValidator.html">NCTestAutoModelValidator</a>