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 b5079f8 WIP.
b5079f8 is described below
commit b5079f82201bebf5f9046ad2d8dad800ec352266
Author: Aaron Radzinski <[email protected]>
AuthorDate: Sat Jan 30 18:37:01 2021 -0800
WIP.
---
_scss/misc.scss | 8 +++
blogs/quick_intro_apache_nlpcraft.html | 4 +-
blogs/short_term_memory.html | 2 +-
cheat-sheet.html | 93 +++++---------------------
download.html | 18 +++---
examples/alarm_clock.html | 6 +-
examples/light_switch.html | 10 +--
examples/sql_model.html | 8 +--
examples/weather_bot.html | 6 +-
first-example.html | 115 ++++++++++++---------------------
integrations.html | 26 ++++----
metrics-and-tracing.html | 2 +-
server-and-probe.html | 6 +-
tools/embedded_probe.html | 2 +-
tools/script.html | 2 +-
tools/sql_model_gen.html | 2 +-
tools/syn_tool.html | 11 ++--
tools/test_framework.html | 4 +-
18 files changed, 118 insertions(+), 207 deletions(-)
diff --git a/_scss/misc.scss b/_scss/misc.scss
index 4f8ccd9..9bede67 100644
--- a/_scss/misc.scss
+++ b/_scss/misc.scss
@@ -458,3 +458,11 @@ i.fa.output {
border-color: #fff #fff $color-blue3 !important;
}
}
+
+code.script {
+ border: 1px solid $color-blue3;
+ padding: 1px 6px 2px 6px;
+ border-radius: 4px;
+ color: #fb51b1;
+ background-color: #f3f9ff;
+}
diff --git a/blogs/quick_intro_apache_nlpcraft.html
b/blogs/quick_intro_apache_nlpcraft.html
index 92f2449..14ddfbd 100644
--- a/blogs/quick_intro_apache_nlpcraft.html
+++ b/blogs/quick_intro_apache_nlpcraft.html
@@ -263,7 +263,7 @@ publish_date: November 16, 2020
</p>
<ul>
<li>
- Synonyms can be easily developed, extended and tested using many
tools that NLPCraft provides like
+ Synonyms can be developed, extended and tested using many tools
that NLPCraft provides like
macros, Synonym DSL and synonym suggester (that uses Google’ BERT
and Facebook fastText models).
</li>
<li>
@@ -387,7 +387,7 @@ publish_date: November 16, 2020
<li><code>"No lights in the bedroom, please."</code></li>
</ul>
<p>
- You can also easily extend this model and support different locations
or actions like dimming or brightening
+ You can also extend this model and support different locations or
actions like dimming or brightening
the lights, etc. Model-as-a-code approach enables you to iterate on
this in the matter of minutes without
heavy re-training cycles.
</p>
diff --git a/blogs/short_term_memory.html b/blogs/short_term_memory.html
index 62ab0e5..6deee19 100644
--- a/blogs/short_term_memory.html
+++ b/blogs/short_term_memory.html
@@ -64,7 +64,7 @@ publish_date: July 26, 2019
</ul>
<p>
Sometimes we can use default values like the current user's location
and the current time (if they are missing).
- However, this can easily lead to the wrong interpretation if the
conversation has an existing context.
+ However, this can lead to the wrong interpretation if the conversation
has an existing context.
</p>
<p>
In real life, as well as in NLP-based systems, we always try to start
a conversation with a fully defined
diff --git a/cheat-sheet.html b/cheat-sheet.html
index f6c58a2..06c493d 100644
--- a/cheat-sheet.html
+++ b/cheat-sheet.html
@@ -37,6 +37,21 @@ id: cheat_sheet
<a href="#cs7">Testing with REST</a><br/>
</div>
</div>
+ <div class="bq success">
+ <p>
+ <b>NOTES:</b>
+ </p>
+ <ul>
+ <li>
+ <a href="/tools/script.html">NLPCraft CLI</a> is available
as <code>nlpcraft.sh</code> for
+ <i class="fab fa-fw fa-linux"></i> and
<code>nlpcraft.cmd</code>
+ for <i class="fab fa-fw fa-windows"></i>.
+ </li>
+ <li>
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=xxx</code> to get a full help on <code>xxx</code> command.
+ </li>
+ </ul>
+ </div>
</section>
<section id="cs1">
<h2 class="section-title">Quick Install</h2>
@@ -143,19 +158,6 @@ id: cheat_sheet
$ bin/nlpcraft.sh stop-server # Stop server.
$ bin/nlpcraft.sh stop # Stop both server and probe.
</pre>
- <p>
- <b>NOTES:</b>
- </p>
- <ul>
- <li>
- <a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for
- <i class="fab fa-fw fa-linux"></i> and
<code>nlpcraft.cmd</code>
- for <i class="fab fa-fw fa-windows"></i>.
- </li>
- <li>
- Run <code>bin/nlpcraft.sh help --cmd=xxx</code> to get
a full help on <code>xxx</code> command.
- </li>
- </ul>
</div>
<div class="tab-pane fade show" id="nav-srv-class" role="tabpanel">
<p></p>
@@ -245,19 +247,6 @@ id: cheat_sheet
$ bin/nlpcraft.sh stop-probe # Stop probe.
$ bin/nlpcraft.sh stop # Stop server and probe.
</pre>
- <p>
- <b>NOTES:</b>
- </p>
- <ul>
- <li>
- <a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for
- <i class="fab fa-fw fa-linux"></i> and
<code>nlpcraft.cmd</code>
- for <i class="fab fa-fw fa-windows"></i>.
- </li>
- <li>
- Run <code>bin/nlpcraft.sh help --cmd=xxx</code> to get
a full help on <code>xxx</code> command.
- </li>
- </ul>
</div>
<div class="tab-pane fade show" id="nav-probe-class"
role="tabpanel">
<p></p>
@@ -330,19 +319,6 @@ id: cheat_sheet
$ bin/nlpcraft.sh test-model # All default parameters.
$ bin/nlpcraft.sh test-model --mdls=my.package.Model
--cp=~/myapp/target/classes --jmvOpts="-ea -Xms2048m"
</pre>
- <p>
- <b>NOTES:</b>
- </p>
- <ul>
- <li>
- <a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for
- <i class="fab fa-fw fa-linux"></i> and
<code>nlpcraft.cmd</code>
- for <i class="fab fa-fw fa-windows"></i>.
- </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: bash">
@@ -379,19 +355,6 @@ id: cheat_sheet
$ bin/nlpcraft.sh gen-project -n=MyProject -l=scala -b=sbt
# Scala/SBT project stub.
$ bin/nlpcraft.sh gen-project -n=MyProject -l=kotlin
-p=com.mycompany.nlp -o # Kotlin/Maven project stub.
</pre>
- <p>
- <b>NOTES:</b>
- </p>
- <ul>
- <li>
- <a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for
- <i class="fab fa-fw fa-linux"></i> and
<code>nlpcraft.cmd</code>
- for <i class="fab fa-fw fa-windows"></i>.
- </li>
- <li>
- Run <code>bin/nlpcraft.sh help
--cmd=gen-project</code> to get a full help on this command.
- </li>
- </ul>
</div>
</div>
</section>
@@ -408,19 +371,6 @@ id: cheat_sheet
$ bin/nlpcraft.sh gen-model
--filePath=~/myapp/myModel.json --mdlId=my.model.id # JSON model stub.
$ bin/nlpcraft.sh gen-model -f=c:/tmp/myModel.yaml
-m=my.model.id -o # YAML model stub.
</pre>
- <p>
- <b>NOTES:</b>
- </p>
- <ul>
- <li>
- <a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for
- <i class="fab fa-fw fa-linux"></i> and
<code>nlpcraft.cmd</code>
- for <i class="fab fa-fw fa-windows"></i>.
- </li>
- <li>
- Run <code>bin/nlpcraft.sh help --cmd=gen-model</code>
to get a full help on this command.
- </li>
- </ul>
</div>
</div>
</section>
@@ -442,19 +392,6 @@ id: cheat_sheet
$ bin/nlpcraft.sh rest -p=signin -j='{"email":
"[email protected]", "passwd": "admin"}' # Linux/Unix/MacOS REST call.
$ bin/nlpcraft.cmd rest --path=signin --json='{\"email\":
\"[email protected]\", \"passwd\": \"admin\"}' # Window REST call.
</pre>
- <p>
- <b>NOTES:</b>
- </p>
- <ul>
- <li>
- <a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for
- <i class="fab fa-fw fa-linux"></i> and
<code>nlpcraft.cmd</code>
- for <i class="fab fa-fw fa-windows"></i>.
- </li>
- <li>
- Run <code>bin/nlpcraft.sh help --cmd=xxx</code> to get
a full help on <code>xxx</code> command.
- </li>
- </ul>
</div>
</div>
</section>
diff --git a/download.html b/download.html
index 742a99b..6c6bd1e 100644
--- a/download.html
+++ b/download.html
@@ -252,10 +252,10 @@ layout: interior
</p>
<nav>
<div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-maven" role="tab" aria-controls="nav-home"
aria-selected="true">Maven <img src="/images/java2.png" height="20px"
alt=""></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-grape" role="tab" aria-controls="nav-profile"
aria-selected="false">Grape <img src="/images/groovy.png" height="18px"
alt=""></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-gradle" role="tab" aria-controls="nav-profile"
aria-selected="false">Gradle <img src="/images/kotlin.png" height="18px"
alt=""></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-sbt" role="tab" aria-controls="nav-contact"
aria-selected="false">SBT <img src="/images/scala-logo.png" height="16px"
alt=""></a>
+ <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-maven" role="tab">Maven <img src="/images/java2.png" height="20px"
alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-grape" role="tab">Grape <img src="/images/groovy.png" height="18px"
alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-gradle" role="tab">Gradle <img src="/images/kotlin.png"
height="18px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-sbt" role="tab">SBT <img src="/images/scala-logo.png" height="16px"
alt=""></a>
</div>
</nav>
<div class="tab-content">
@@ -286,7 +286,7 @@ layout: interior
</pre>
</div>
</div>
- <div class="bq success">
+ <div class="bq info">
<p>
<b>Latest Version</b>
</p>
@@ -330,10 +330,10 @@ layout: interior
</p>
<nav>
<div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-java-client-maven" role="tab" aria-controls="nav-home"
aria-selected="true">Maven <img src="/images/java2.png" height="20px"
alt=""></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-java-client-grape" role="tab" aria-controls="nav-profile"
aria-selected="false">Grape <img src="/images/groovy.png" height="18px"
alt=""></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-java-client-gradle" role="tab" aria-controls="nav-profile"
aria-selected="false">Gradle <img src="/images/kotlin.png" height="18px"
alt=""></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-java-client-sbt" role="tab" aria-controls="nav-contact"
aria-selected="false">SBT <img src="/images/scala-logo.png" height="16px"
alt=""></a>
+ <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-java-client-maven" role="tab">Maven <img src="/images/java2.png"
height="20px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-java-client-grape" role="tab">Grape <img src="/images/groovy.png"
height="18px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-java-client-gradle" role="tab">Gradle <img src="/images/kotlin.png"
height="18px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-java-client-sbt" role="tab">SBT <img src="/images/scala-logo.png"
height="16px" alt=""></a>
</div>
</nav>
<div class="tab-content">
diff --git a/examples/alarm_clock.html b/examples/alarm_clock.html
index bf666d2..633ea07 100644
--- a/examples/alarm_clock.html
+++ b/examples/alarm_clock.html
@@ -63,7 +63,7 @@ id: alarm_clock
<code>gen-project</code> command defaults to Java and
Maven as its built tool.
</li>
<li>
- Run <code>bin/nlpcraft.sh help
--cmd=gen-project</code> to get a full help on <code>gen-project</code> command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=gen-project</code> to get a full help on <code>gen-project</code> command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for
@@ -304,7 +304,7 @@ public class AlarmClock extends NCModelFileAdapter {
<i style="color: #F39C12" class="fa
fa-exclamation-triangle"></i> REST server is a "fire-and-forget" component that
you generally needs to start only once.
</li>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=start-server</code> to
get a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=start-server</code> to get a full help on this command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
@@ -343,7 +343,7 @@ public class AlarmClock extends NCModelFileAdapter {
</p>
<ul>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=test-model</code> to get
a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=test-model</code> to get a full help on this command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
diff --git a/examples/light_switch.html b/examples/light_switch.html
index 260c88b..8f63838 100644
--- a/examples/light_switch.html
+++ b/examples/light_switch.html
@@ -27,7 +27,7 @@ id: light_switch
<p>
This example provides very simple implementation for NLI-powered
light switch. You can say something like
"Turn the lights off in the entire house" or "Switch on the
illumination in the master bedroom closet".
- You can easily modify intent callbacks to perform the actual light
switching using HomeKit or Arduino-based
+ You can modify intent callbacks to perform the actual light
switching using HomeKit or Arduino-based
controllers.
</p>
<p>
@@ -63,7 +63,7 @@ id: light_switch
<code>gen-project</code> command defaults to Java and
Maven as its built tool.
</li>
<li>
- Run <code>bin/nlpcraft.sh help
--cmd=gen-project</code> to get a full help on <code>gen-project</code> command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=gen-project</code> to get a full help on <code>gen-project</code> command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for
@@ -193,7 +193,7 @@ class LightSwitch extends
NCModelFileAdapter("light_switch.yaml") {
</pre>
<p>
The intent callback logic is very simple - we simply return a
descriptive confirmation message
- back (explaining what lights were changed). With action and
location detected - you can easily add
+ back (explaining what lights were changed). With action and
location detected - you can add
the actual light switching using HomeKit or Arduino devices. Let's
review this implementation step by step:
</p>
<ul>
@@ -265,7 +265,7 @@ class LightSwitch extends
NCModelFileAdapter("light_switch.yaml") {
<i style="color: #F39C12" class="fa
fa-exclamation-triangle"></i> REST server is a "fore-and-forget" component that
you generally need to start only once.
</li>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=start-server</code> to
get a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=start-server</code> to get a full help on this command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
@@ -304,7 +304,7 @@ class LightSwitch extends
NCModelFileAdapter("light_switch.yaml") {
</p>
<ul>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=test-model</code> to get
a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=test-model</code> to get a full help on this command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
diff --git a/examples/sql_model.html b/examples/sql_model.html
index a6c3618..df2c228 100644
--- a/examples/sql_model.html
+++ b/examples/sql_model.html
@@ -65,8 +65,8 @@ id: sql_model
match the user input against a defined set of intents. If it finds
the matching intent - it guarantees that
match for a given intent. If no matching intent can be found - it
returns the negative
result without any ambiguity. In other words, if the answer is
given, it is deterministically guaranteed to be correct.
- Another positive side-effect of this approach is the fact that
such matching logic is easily traceable, i.e.
- the user can easily see why given user input was matched against a
certain intent (and not any other). Such
+ Another positive side-effect of this approach is the fact that
such matching logic is traceable, i.e.
+ the user can see why given user input was matched against a
certain intent (and not any other). Such
traceability of the comprehension logic (or explainability vs
"black box" approach resulting from deep
learning techniques) is often critical for many real-life business
applications.
</p>
@@ -200,7 +200,7 @@ id: sql_model
<i style="color: #F39C12" class="fa
fa-exclamation-triangle"></i> REST server is a "fore-and-forget" component that
you generally need to start only once.
</li>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=start-server</code> to
get a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=start-server</code> to get a full help on this command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
@@ -235,7 +235,7 @@ id: sql_model
</p>
<ul>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=test-model</code> to get
a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=test-model</code> to get a full help on this command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
diff --git a/examples/weather_bot.html b/examples/weather_bot.html
index 2c02ac3..8ab0292 100644
--- a/examples/weather_bot.html
+++ b/examples/weather_bot.html
@@ -62,7 +62,7 @@ id: weather_bot
<code>gen-project</code> command defaults to Java and
Maven as its built tool.
</li>
<li>
- Run <code>bin/nlpcraft.sh help
--cmd=gen-project</code> to get a full help on <code>gen-project</code> command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=gen-project</code> to get a full help on <code>gen-project</code> command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is
available as <code>nlpcraft.sh</code> for
@@ -413,7 +413,7 @@ public class Weather extends NCModelFileAdapter {
<i style="color: #F39C12" class="fa
fa-exclamation-triangle"></i> REST server is a "fore-and-forget" component that
you generally need to start only once.
</li>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=start-server</code> to
get a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=start-server</code> to get a full help on this command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
@@ -452,7 +452,7 @@ public class Weather extends NCModelFileAdapter {
</p>
<ul>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=test-model</code> to get
a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=test-model</code> to get a full help on this command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
diff --git a/first-example.html b/first-example.html
index 751528d..229658e 100644
--- a/first-example.html
+++ b/first-example.html
@@ -25,23 +25,18 @@ id: first_example
<section id="setup">
<h2 class="section-title">Overview</h2>
<p>
- Let's develop a prototypical light switch that can be controlled
through the natural language.
+ Let's develop a light switch prototype that can be controlled
through the natural language.
We'll keep <a target=_
href="https://cloud.google.com/speech-to-text/">speech-to-text conversion</a>
and integration
with <a target=_
href="https://developer.apple.com/homekit/">HomeKit</a> or
- <a href="https://www.arduino.cc/" target=_>Ardunio</a> outside of
this example - and concentrate only on understanding the natural
- language commands. At the end, we should be able to say
<code>"Turn the lights off in the guest bedroom"</code>
- or <code>"Could you please switch off all the lights?"</code>.
- </p>
- <p>
- NOTE: for this example we'll use Scala and Linux, however, the
example works exactly the same
- way with any other JVM language or operating system.
+ <a href="https://www.arduino.cc/" target=_>Ardunio</a> outside of
this example - and concentrate on understanding the natural
+ language commands.
</p>
</section>
<section id="new_project">
<h3 class="section-title">New Project</h3>
<p>
We'll use <a href="/tools/script.html">NLPCraft CLI</a> to perform
all management operations.
- Run <code>bin/nlpcraft.sh</code> script from NLPCraft installation
directory to create a new project stub (the script is located in
<code>bin</code> sub-directory):
+ Run <code>bin/nlpcraft.sh</code> script to create a new project
stub:
</p>
<nav>
<div class="nav nav-tabs" role="tablist">
@@ -73,7 +68,7 @@ id: first_example
<code>gen-project</code> command defaults to Maven as its
built tool.
</li>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=gen-project</code> to get
a full help on <code>gen-project</code> command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=gen-project</code> to get a full help on <code>gen-project</code> command.
</li>
<li>
<a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
@@ -85,17 +80,16 @@ id: first_example
<section id="data_model">
<h2 class="section-title">Data Model</h2>
<p>
- In NLPCraft a data model is simply an implementation of <a
target="javadoc"
href="/apis/latest/org/apache/nlpcraft/model/NCModel.html">NCModel</a>
+ In NLPCraft a data model is an implementation of <a
target="javadoc"
href="/apis/latest/org/apache/nlpcraft/model/NCModel.html">NCModel</a>
interface. You can move most of the model configuration out to an
external JSON or YAML file and use
<a target="javadoc"
href="/apis/latest/org/apache/nlpcraft/model/NCModelFileAdapter.html">NCModelFileAdapter</a>
to
- load this external configuration when creating a new model. Note
that this is a canonical pattern to build
- models in NLPCraft and it allows you cleanly separate the logic of
the model from its declarative configuration.
+ load this external configuration when creating a new model.
</p>
<p>
- Open <code>src/main/resources/<b>light_switch.yaml</b></code> file
and replace its default content with
+ Open <code>src/main/resources/<b>light_switch.yaml</b></code> file
and replace its content with
the following model declaration:
</p>
- <pre class="brush: js, highlight: [16, 23, 31]">
+ <pre class="brush: js, highlight: [16, 23, 31, 42]">
id: "nlpcraft.lightswitch.ex"
name: "Light Switch Example Model"
version: "1.0"
@@ -140,7 +134,7 @@ id: first_example
- "intent=ls term(act)={groups @@ 'act'} term(loc)={id ==
'ls:loc'}*"
</pre>
<p>
- Notice three model elements that we'll use later in our intent
definition (lines 16, 23, and 31):
+ Notice three model elements at lines 16, 23, and 31:
</p>
<ul>
<li><code>ls:loc</code></li>
@@ -150,10 +144,10 @@ id: first_example
<p>
Model element <code>ls:loc</code> defines a location where we want
to control the lights. Model
elements <code>ls:on</code> and <code>ls:off</code> define
corresponding "on" and "off" lights
- actions. We'll use these elements in our model's intent-based
matching logic.
+ actions. We use these elements in our model's intent definition at
line 42 as well as in intent callback below.
</p>
<p>
- Next, let's go ahead and add model's logic which we'll write in
Scala (with Java and Kotlin versions attached for reference).
+ Next, let's go ahead and add model's logic which we'll write in
Scala wtih Java and Kotlin versions provided for reference.
Open <code>src/main/scala/demo/<b>LightSwitch.scala</b></code>
file and replace its content with the following
code:
</p>
@@ -313,15 +307,14 @@ class LightSwitchKotlinModel :
NCModelFileAdapter("lightswitch_model.yaml") {
<ul>
<li>
Line 6 uses <a target="javadoc"
href="/apis/latest/org/apache/nlpcraft/model/NCIntentRef.html">@NCIntentRef</a>
- annotation to reference the intent defined in our
model (it can also be defined in place).
+ annotation to reference the intent defined in our
model (<code>light_switch.yaml</code>, line 42).
The intent matches
two parts: first should be any token belonging to
<code>act</code> group (i.e. "on" or "off" action),
and the second should be a zero or more tokens with ID
equal to <code>ls:loc</code> (i.e. optional list of locations).
</li>
<li>
Line 7 uses <a target="javadoc"
href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a>
- annotation that is used for auto-testing of the
model. See below the <a href="#test">testing</a>
- section for details.
+ annotation that is used for <a
href="#test">auto-testing</a> of the model.
</li>
</ul>
</li>
@@ -330,11 +323,10 @@ class LightSwitchKotlinModel :
NCModelFileAdapter("lightswitch_model.yaml") {
annotations to connect the matched result with a callback
method formal parameters.
</li>
<li>
- When our intent is selected as a matching winner the method
<code>onMatch(...)</code> on line 20 is invoked. It simply
+ When our intent is selected as a matching winner the method
<code>onMatch(...)</code> on line 20 is invoked. It
returns a text response that indicates the light status at a
requested location. That's where you can
also add <a target=_
href="https://developer.apple.com/homekit/">HomeKit</a>,
- <a href="https://www.arduino.cc/" target=_>Ardunio</a> or
other integrations to make a real
- lightswitch in your home.
+ <a href="https://www.arduino.cc/" target=_>Ardunio</a> or
other integrations to finish this implementation.
</li>
<li>
Chapter <a href="/data-model.html">Data Model</a> provides
detailed explanation on how data models work.
@@ -344,20 +336,17 @@ class LightSwitchKotlinModel :
NCModelFileAdapter("lightswitch_model.yaml") {
<section id="build_project">
<h3 class="section-title">Build Project</h3>
<p>
- Once we have our model ready let's go to
<code>~/LightSwitch</code> directory and run the Maven build:
+ Once the model ready, run the Maven build:
</p>
<pre class="brush: bash">
$ cd ~/LightSwitch
$ mvn clean package
</pre>
- <p>
- At this stage we have our project built and we are ready to start
testing.
- </p>
</section>
<section id="server">
<h3 class="section-title">Start Server</h3>
<p>
- Run the following command to start local REST server, if it hasn't
been started already, from the NLPCraft installation directory:
+ Start local REST server, if it hasn't been started already:
</p>
<nav>
<div class="nav nav-tabs" role="tablist">
@@ -378,28 +367,12 @@ class LightSwitchKotlinModel :
NCModelFileAdapter("lightswitch_model.yaml") {
</p>
</div>
</div>
- <p>
- <b>NOTES:</b>
- </p>
- <ul>
- <li>
- REST server is a "fore-and-forget" component that you
generally need to start only once.
- </li>
- <li>
- Run <code>bin/nlpcraft.sh help --cmd=start-server</code> to
get a full help on this command.
- </li>
- <li>
- <a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
- <i class="fab fa-fw fa-linux"></i> and
<code>nlpcraft.cmd</code>
- for <i class="fab fa-fw fa-windows"></i>.
- </li>
- </ul>
</section>
<section id="test">
<h3 class="section-title">Testing</h3>
<p>
- Remember the <a target="javadoc"
href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a>
- annotation we have used in our Scala code next to intent
definition?
+ Recall the <a target="javadoc"
href="/apis/latest/org/apache/nlpcraft/model/NCIntentSample.html">@NCIntentSample</a>
+ annotation we have used in our code next to intent reference.
</p>
<p>
Part of the <a href="/tools/test_framework.html">test
framework</a>, the auto-validator class <a
@@ -414,35 +387,27 @@ class LightSwitchKotlinModel :
NCModelFileAdapter("lightswitch_model.yaml") {
itself.
</p>
<p>
- As always, you can launch model auto-validator as any other Java
class but we'll use <code>nlpcraft.sh</code>
- script to do it more conveniently:
- </p>
- <pre class="brush: bash">
- $ bin/nlpcraft.sh test-model --cp=~/LightSwitch/target/classes
--mdls=demo.LightSwitch
- </pre>
- <p>
- <b>NOTES:</b>
- </p>
- <ul>
- <li>
- Run <code>bin/nlpcraft.sh help --cmd=test-model</code> to get
a full help on this command.
- </li>
- <li>
- <a href="/tools/script.html">NLPCraft CLI</a> is available as
<code>nlpcraft.sh</code> for
- <i class="fab fa-fw fa-linux"></i> and
<code>nlpcraft.cmd</code>
- for <i class="fab fa-fw fa-windows"></i>.
- </li>
- </ul>
- <p>
- Look at the output of this command and you will see the test
results for all our sample utterances:
- </p>
- <p>
- <img style="max-width: 910px !important;" class="img-fluid" alt=""
src="/images/first_example_fig4.png">
- </p>
- <p>
- To play with this project change the model and/or the mode logic,
<a href="#build_project">build</a> project again,
- and run the <a href="#test">auto-test</a>.
+ Run model auto-validator:
</p>
+ <nav>
+ <div class="nav nav-tabs" role="tablist">
+ <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-test-cmd" role="tab" aria-controls="nav-home"
aria-selected="true">Command</a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-test-out" role="tab" aria-controls="nav-home"
aria-selected="true">Output <i class="fa fa-desktop output"></i></a>
+ </div>
+ </nav>
+ <div class="tab-content">
+ <div class="tab-pane fade show active" id="nav-test-cmd"
role="tabpanel">
+ <pre class="brush: bash">
+ $ bin/nlpcraft.sh test-model
--cp=~/LightSwitch/target/classes --mdls=demo.LightSwitch
+ </pre>
+ </div>
+ <div class="tab-pane fade show" id="nav-test-out" role="tabpanel">
+ <p></p>
+ <p>
+ <img style="max-width: 910px !important;"
class="img-fluid" alt="" src="/images/first_example_fig4.png">
+ </p>
+ </div>
+ </div>
</section>
<section>
<h2 class="section-title">Congratulation! 👌</h2>
diff --git a/integrations.html b/integrations.html
index 0c589a5..b87dded 100644
--- a/integrations.html
+++ b/integrations.html
@@ -466,7 +466,7 @@ id: integrations
<p>
Default <code>pom.xml</code> shipped with NLPCraft release
contains Stanford CoreNLP dependency in a separate
<code>stanford-corenlp</code> profile. To use this, you need to
enable this profile when building the project
- from sources, i.e. <code>mvn clean package -P
stanford-corenlp</code>, or enable this profile in maven
+ from sources, i.e. <code class="script">mvn clean package -P
stanford-corenlp</code>, or enable this profile in maven
configuration:
</p>
<nav>
@@ -705,10 +705,10 @@ if __name__ == '__main__':
</p>
<nav>
<div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-mysql-maven" role="tab" aria-controls="nav-home"
aria-selected="true">Maven <sup>Java</sup></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-mysql-grape" role="tab" aria-controls="nav-profile"
aria-selected="false">Grape <sup>Groovy</sup></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-mysql-gradle" role="tab" aria-controls="nav-profile"
aria-selected="false">Gradle <sup>Kotlin</sup></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-mysql-sbt" role="tab" aria-controls="nav-contact"
aria-selected="false">SBT <sup>Scala</sup></a>
+ <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-mysql-maven" role="tab">Maven <img src="/images/java2.png"
height="20px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-mysql-grape" role="tab">Grape <img src="/images/groovy.png"
height="18px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-mysql-gradle" role="tab">Gradle <img src="/images/kotlin.png"
height="18px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-mysql-sbt" role="tab">SBT <img src="/images/scala-logo.png"
height="16px" alt=""></a>
</div>
</nav>
<div class="tab-content">
@@ -768,10 +768,10 @@ if __name__ == '__main__':
</p>
<nav>
<div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-postgres-maven" role="tab" aria-controls="nav-home"
aria-selected="true">Maven <sup>Java</sup></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-postgres-grape" role="tab" aria-controls="nav-profile"
aria-selected="false">Grape <sup>Groovy</sup></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-postgres-gradle" role="tab" aria-controls="nav-profile"
aria-selected="false">Gradle <sup>Kotlin</sup></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-postgres-sbt" role="tab" aria-controls="nav-contact"
aria-selected="false">SBT <sup>Scala</sup></a>
+ <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-postgres-maven" role="tab">Maven <img src="/images/java2.png"
height="20px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-postgres-grape" role="tab">Grape <img src="/images/groovy.png"
height="18px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-postgres-gradle" role="tab">Gradle <img src="/images/kotlin.png"
height="18px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-postgres-sbt" role="tab">SBT <img src="/images/scala-logo.png"
height="16px" alt=""></a>
</div>
</nav>
<div class="tab-content">
@@ -831,10 +831,10 @@ if __name__ == '__main__':
</p>
<nav>
<div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-oracle-maven" role="tab" aria-controls="nav-home"
aria-selected="true">Maven <sup>Java</sup></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-oracle-grape" role="tab" aria-controls="nav-profile"
aria-selected="false">Grape <sup>Groovy</sup></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-oracle-gradle" role="tab" aria-controls="nav-profile"
aria-selected="false">Gradle <sup>Kotlin</sup></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-oracle-sbt" role="tab" aria-controls="nav-contact"
aria-selected="false">SBT <sup>Scala</sup></a>
+ <a class="nav-item nav-link active" data-toggle="tab"
href="#nav-oracle-maven" role="tab">Maven <img src="/images/java2.png"
height="20px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-oracle-grape" role="tab">Grape <img src="/images/groovy.png"
height="18px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-oracle-gradle" role="tab">Gradle <img src="/images/kotlin.png"
height="18px" alt=""></a>
+ <a class="nav-item nav-link" data-toggle="tab"
href="#nav-oracle-sbt" role="tab">SBT <img src="/images/scala-logo.png"
height="16px" alt=""></a>
</div>
</nav>
<div class="tab-content">
diff --git a/metrics-and-tracing.html b/metrics-and-tracing.html
index 3f8c537..9535f00 100644
--- a/metrics-and-tracing.html
+++ b/metrics-and-tracing.html
@@ -125,7 +125,7 @@ id: metrics
<p>
All built-in exporters are a simple adaptation of the standard
OpenCensus <a target=_
href="https://opencensus.io/exporters/supported-exporters/java/">exporters</a>
to life cycle components for the
- REST server or the data probe. Each exporter has just a few lines
of code and you can easily create your own
+ REST server or the data probe. Each exporter has just a few lines
of code and you can create your own
exporters for other backends.
</p>
</section>
diff --git a/server-and-probe.html b/server-and-probe.html
index 291c747..18aa084 100644
--- a/server-and-probe.html
+++ b/server-and-probe.html
@@ -58,7 +58,7 @@ id: server_and_probe
<li><a href="/data-model.html">Model API</a></li>
</ul>
<p>
- Note that if you downloaded the <a
href="/download.html#src">source</a> ZIP you need to run <code>mvn clean
package</code> to
+ Note that if you downloaded the <a
href="/download.html#src">source</a> ZIP you need to run <code
class="script">mvn clean package</code> to
get the
<code>apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar</code>
file. It will be located in <code>nlpcraft/target</code>
sub-folder.
</p>
@@ -91,7 +91,7 @@ id: server_and_probe
for <i class="fab fa-fw fa-windows"></i>.
</li>
<li>
- Run <code>bin/nlpcraft.sh help
--cmd=start-server</code> to get a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=start-server</code> to get a full help on this command.
</li>
</ul>
</div>
@@ -242,7 +242,7 @@ id: server_and_probe
for <i class="fab fa-fw fa-windows"></i>.
</li>
<li>
- Run <code>bin/nlpcraft.sh help
--cmd=start-probe</code> to get a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=start-probe</code> to get a full help on this command.
</li>
</ul>
</div>
diff --git a/tools/embedded_probe.html b/tools/embedded_probe.html
index 21b5019..aaf653f 100644
--- a/tools/embedded_probe.html
+++ b/tools/embedded_probe.html
@@ -74,7 +74,7 @@ id: embedded_probe
</li>
</ul>
<p>
- Here's an code snippet from <a
href="/examples/alarm_clock.html">Alarm Clock</a>
+ Here's Java code snippet from <a
href="/examples/alarm_clock.html">Alarm Clock</a>
example illustrating the usage of embedded probe together with
NLPCraft test framework and JUnit 5:
</p>
<pre class="brush: java, highlight: [6, 18]">
diff --git a/tools/script.html b/tools/script.html
index 6dfcd84..f99cd07 100644
--- a/tools/script.html
+++ b/tools/script.html
@@ -196,7 +196,7 @@ id: script
<img class="img-fluid" src="/images/cli9.png" alt="">
</p>
<p>
- You can easily parse these JSON responses for your own needs in
your scripts. For example, here's the
+ You can parse these JSON responses for your own needs in your
scripts. For example, here's the
code snippet to get the access token from the <code>signin</code>
command (on Linux):
</p>
<pre class="brush: bash">
diff --git a/tools/sql_model_gen.html b/tools/sql_model_gen.html
index 526a784..50210b9 100644
--- a/tools/sql_model_gen.html
+++ b/tools/sql_model_gen.html
@@ -61,7 +61,7 @@ id: sql_model_gen
for <i class="fab fa-fw fa-windows"></i>.
</li>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=gen-sql</code> to
get a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=gen-sql</code> to get a full help on this command.
</li>
</ul>
</div>
diff --git a/tools/syn_tool.html b/tools/syn_tool.html
index 9269319..a264776 100644
--- a/tools/syn_tool.html
+++ b/tools/syn_tool.html
@@ -60,7 +60,7 @@ id: syn_tool
<p>
Install necessary dependencies by running the following
commands from the NLPCraft installation
directory:<br/>
- <sub><b>NOTE: This step should only be performed
once</b></sub>
+ <b>NOTE:</b> this step should only be performed once.
</p>
<nav>
<div class="nav nav-tabs" role="tablist">
@@ -76,9 +76,10 @@ id: syn_tool
</pre>
</div>
<div class="tab-pane fade show" id="nav-win"
role="tabpanel">
- <pre class="brush: plain">
- Read
'src\main\python\ctxword\bin\WINDOWS_SETUP.md' file for manual installation
instructions.
- </pre>
+ <p></p>
+ <p>
+ Read
<code>src\main\python\ctxword\bin\WINDOWS_SETUP.md</code> file for manual
installation instructions.
+ </p>
</div>
</div>
</li>
@@ -135,7 +136,7 @@ id: syn_tool
for <i class="fab fa-fw fa-windows"></i>.
</li>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=sugsyn</code> to
get a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=sugsyn</code> to get a full help on this command.
</li>
</ul>
</div>
diff --git a/tools/test_framework.html b/tools/test_framework.html
index 02822f1..8b86c3a 100644
--- a/tools/test_framework.html
+++ b/tools/test_framework.html
@@ -25,7 +25,7 @@ id: test_framework
<section id="overview">
<h2 class="section-title">Overview</h2>
<p>
- NLPCraft comes built-in with a simple to use testing framework
that can be easily used with any
+ NLPCraft comes built-in with a simple to use testing framework
that can be used with any
popular unit testing JVM frameworks such as <a
href="https://testng.org">TestNG</a> or
<a href="https://junit.org">JUnit</a>. Test framework is
essentially a simplified implementation
of the REST client tailor made for model unit testing.
@@ -203,7 +203,7 @@ public class AlarmModel extends NCModelFileAdapter {
for <i class="fab fa-fw fa-windows"></i>.
</li>
<li>
- Run <code>bin/nlpcraft.sh help --cmd=test-model</code>
to get a full help on this command.
+ Run <code class="script">bin/nlpcraft.sh help
--cmd=test-model</code> to get a full help on this command.
</li>
</ul>
</div>