This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-513
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft-website.git
The following commit(s) were added to refs/heads/NLPCRAFT-513 by this push:
new 467bf6a WIP.
467bf6a is described below
commit 467bf6ad77537e445307e010a3e52e003fcbb35b
Author: skhdl <[email protected]>
AuthorDate: Tue Oct 25 13:42:43 2022 +0400
WIP.
---
_includes/quick-links.html | 6 -
api-review.html | 7 +-
built-components.html | 35 +--
cheat-sheet.html | 518 ------------------------------------------
examples/light_switch_fr.html | 6 +-
examples/light_switch_ru.html | 4 +-
installation.html | 12 +-
semantic.html | 42 ++++
8 files changed, 79 insertions(+), 551 deletions(-)
diff --git a/_includes/quick-links.html b/_includes/quick-links.html
index c29991d..b575e8f 100644
--- a/_includes/quick-links.html
+++ b/_includes/quick-links.html
@@ -22,15 +22,9 @@
<li>
<i class="fab fa-fw fa-java mr-2"></i><a target="_"
href="/apis/latest/index.html">Javadoc</a>
</li>
-<li>
- <i class="fas fa-fw fa-code mr-2"></i><a
href="https://app.swaggerhub.com/apis-docs/Apache-NLPCraft/apache-nlpcraft/{{site.latest_version}}"
target="swaggerhub">REST API</a>
-</li>
<li>
<i class="fas fa-fw fa-download mr-2"></i><a
href="/download.html">Download</a>
</li>
-<li>
- <i class="fas fa-fw fa-magic mr-2"></i><a href="/cheat-sheet.html">Cheat
Sheet</a>
-</li>
<li>
<i class="fas fa-fw fa-calendar-alt mr-2"></i><a
href="/resources.html">News <i class="amp">&</i> Events</a>
</li>
diff --git a/api-review.html b/api-review.html
index 8134bc4..ae557d0 100644
--- a/api-review.html
+++ b/api-review.html
@@ -26,12 +26,13 @@ id: overview
<h2 class="section-title">Library API review <a href="#"><i
class="top-link fas fa-fw fa-angle-double-up"></i></a></h2>
<p>
- NlpCraft library is based on two main base concepts
<code>Model</code> and <code>Client</code>
+ NlpCraft library is based on two main concepts <code>Model</code>
and <code>Client</code>
which have API representations
<a href="apis/latest/org/apache/nlpcraft/NCModel.html">NCModel</a>
and
<a
href="apis/latest/org/apache/nlpcraft/NCModelClient.html">NCModelClient</a>.
- When you work with the system you should prepare model by
configuring its parameters and defining its components.
- After you just communicate with this model via client's methods.
+ For work with the system you should prepare <a
href="apis/latest/org/apache/nlpcraft/NCModel.html">NCModel</a> instance
+ which is based on configuration and list of components named
<code>pipeline</code>.
+ After you just communicate with prepared model via client's
methods.
</p>
<ul>
diff --git a/built-components.html b/built-components.html
index 4e8b991..03de60f 100644
--- a/built-components.html
+++ b/built-components.html
@@ -44,7 +44,8 @@ id: overview
<ul>
<li>
- <a
href="apis/latest/org/apache/nlpcraft/NCTokenParser.html">NCTokenParser</a>.
There are provided two built implementations, both for English language.
+ <a
href="apis/latest/org/apache/nlpcraft/NCTokenParser.html">NCTokenParser</a>.
+ There are provided two built implementations, both of them are
for English language.
<ul>
<li>
<a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCOpenNLPTokenParser.html">NCOpenNLPTokenParser</a>.
@@ -60,7 +61,7 @@ id: overview
<li>
<a
href="apis/latest/org/apache/nlpcraft/NCTokenEnricher.html">NCTokenEnricher</a>.
- There are provided a number of built implementations, all of
them for English language.
+ There are provided a number of built implementations, all of
them are for English language.
<ul>
<li>
<a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCOpenNLPLemmaPosTokenEnricher.html">NCOpenNLPLemmaPosTokenEnricher</a>
-
@@ -106,14 +107,16 @@ id: overview
<li>
<a
href="apis/latest/org/apache/nlpcraft/NCEntityParser.html">NCEntityParser</a>.
- There are provided a number of built implementations, all of
them for English language.
+ There are provided a number of language independent built
implementations.
+ They use their own models which can be on different languages.
<ul>
<li>
<a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCNLPEntityParser.html">NCNLPEntityParser</a>
converts NLP tokens into entities with four mandatory properties:
<code>nlp:token:text</code>,
<code>nlp:token:index</code>, <code>nlp:token:startCharIndex</code> and
<code>nlp:token:endCharIndex</code>. However, if any
other properties were added into
- processed tokens by <code>NCTokenEnricher</code>
components, they will be copied also with names
+ processed tokens by <a
href="apis/latest/org/apache/nlpcraft/NCTokenEnricher.html">NCTokenEnricher</a>
components, they will be copied also with names
prefixed with <code>nlp:token:</code>.
+ It is language independent component.
Note that converted tokens set can be restricted by
predicate.
</li>
<li>
@@ -127,11 +130,18 @@ id: overview
<code>NCStanfordNLPEntityParser</code> is wrapper on
<a href="https://nlp.stanford.edu/">Stanford NLP</a> NER components.
For example for English language are accessible:
<code>Location</code>, <code>Money</code>,
<code>Person</code>, <code>Organization</code>,
<code>Date</code>, <code>Time</code> and <code>Percent</code>.
+ There are also accessible dome models for another
languages.
Look at the detailed information <a
href="https://nlp.stanford.edu/software/CRF-NER.shtml">here</a>.
</li>
<li>
<a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCSemanticEntityParser.html">NCSemanticEntityParser</a>
is entity parser which is based on list of synonyms elements.
It is very important component which allow to solve a
wide range of tasks.
+ If you want to use <a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCSemanticEntityParser.html">NCSemanticEntityParser</a>
+ with not English language, you have to provide custom
+ <a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCSemanticStemmer.html">NCSemanticStemmer</a>
and
+ <a
href="apis/latest/org/apache/nlpcraft/NCTokenParser.html">NCTokenParser</a>
+ implementations for required language.
+ Look at the <a
href="examples/light_switch_fr.html">Light Switch FR</a> for more details.
Separated chapter <a href="semantic.html">Semantic
parser</a> is dedicated to its detailed description.
</li>
</ul>
@@ -154,17 +164,14 @@ id: overview
<a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCSemanticEntityParser">NCSemanticEntityParser</a>
and configured language.
Currently only one language is supported - English.
It also adds following English components into pipeline:
+ <a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCOpenNLPTokenParser.html">NCOpenNLPTokenParser</a>,
+ <a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCOpenNLPLemmaPosTokenEnricher.html">NCOpenNLPLemmaPosTokenEnricher</a>,
+ <a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCEnStopWordsTokenEnricher.html">NCEnStopWordsTokenEnricher</a>,
+ <a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCEnSwearWordsTokenEnricher.html">NCEnSwearWordsTokenEnricher</a>,
+ <a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCEnQuotesTokenEnricher.html">NCEnQuotesTokenEnricher</a>,
+ <a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCEnDictionaryTokenEnricher.html">NCEnDictionaryTokenEnricher</a>,
+ <a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCEnBracketsTokenEnricher.html">NCEnBracketsTokenEnricher</a>.
</p>
-
- <ul>
- <li><a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCOpenNLPTokenParser.html">NCOpenNLPTokenParser</a></li>
- <li><a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCOpenNLPLemmaPosTokenEnricher.html">NCOpenNLPLemmaPosTokenEnricher</a></li>
- <li><a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCEnStopWordsTokenEnricher.html">NCEnStopWordsTokenEnricher</a></li>
- <li><a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCEnSwearWordsTokenEnricher.html">NCEnSwearWordsTokenEnricher</a></li>
- <li><a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCEnQuotesTokenEnricher.html">NCEnQuotesTokenEnricher</a></li>
- <li><a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCEnDictionaryTokenEnricher.html">NCEnDictionaryTokenEnricher</a></li>
- <li><a
href="apis/latest/org/apache/nlpcraft/nlp/enrichers/NCEnBracketsTokenEnricher.html">NCEnBracketsTokenEnricher</a></li>
- </ul>
</section>
<section id="examples">
diff --git a/cheat-sheet.html b/cheat-sheet.html
deleted file mode 100644
index 37bc242..0000000
--- a/cheat-sheet.html
+++ /dev/null
@@ -1,518 +0,0 @@
----
-active_crumb: Cheat Sheet
-layout: documentation
-fa_icon: fa-magic
-id: cheat_sheet
----
-
-<!--
- Licensed to the Apache Software Foundation (ASF) under one or more
- contributor license agreements. See the NOTICE file distributed with
- this work for additional information regarding copyright ownership.
- The ASF licenses this file to You under the Apache License, Version 2.0
- (the "License"); you may not use this file except in compliance with
- the License. You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
--->
-
-<div id="cheat-sheet" class="col-md-8 second-column">
- <section>
- <div class="accordion" id="cheats">
- <div class="card">
- <div class="card-header" id="q1">
- <h2 class="mb-0">
- <button class="btn btn-link btn-block text-left"
type="button" data-toggle="collapse" data-target="#cheat1">
- Quick Install
- </button>
- </h2>
- </div>
- <div id="cheat1" class="show" data-parent="#cheats">
- <div class="card-body">
- <nav>
- <div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active"
data-toggle="tab" href="#nav-install-src" role="tab">Source</a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-install-bin" role="tab">Binary</a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-install-github" role="tab">GitHub <i class="fab fa-fw
fa-github"></i></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-install-maven" role="tab">Maven <img src="/images/java2-h20.png"
alt=""></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-install-grape" role="tab" aria-controls="nav-profile"
aria-selected="false">Grape <img src="/images/groovy-h18.png" alt=""></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-install-gradle" role="tab" aria-controls="nav-profile"
aria-selected="false">Gradle <img src="/images/kotlin-h18.png" alt=""></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-install-sbt" role="tab" aria-controls="nav-contact"
aria-selected="false">SBT <img src="/images/scala-logo-h16.png" alt=""></a>
- </div>
- </nav>
- <div class="tab-content">
- <div class="tab-pane fade show active"
id="nav-install-src" role="tabpanel">
- <p></p>
- <p>
- <a href="/download.html#src">Download</a>
latest source
- release
(<code>apache-nlpcraft-incubating-<b>{{site.latest_version}}</b>.zip</code>).
Once downloaded:
- </p>
- <pre class="brush: bash">
- $ unzip -q
apache-nlpcraft-incubating-{{site.latest_version}}.zip
- $ cd
apache-nlpcraft-incubating-{{site.latest_version}}
- $ mvn clean package -P examples -DskipTests
- </pre>
- <p>
- Built JARs and Javadoc will be located in
<code>target</code> sub-folders of individual modules.
- </p>
- </div>
- <div class="tab-pane fade show"
id="nav-install-bin" role="tabpanel">
- <p></p>
- <p>
- <a href="/download.html#src">Download</a>
latest binary
- release
(<code>apache-nlpcraft-incubating-bin-<b>{{site.latest_version}}</b>.zip</code>).
Once downloaded:
- </p>
- <pre class="brush: bash">
- $ unzip -q
apache-nlpcraft-incubating-bin-{{site.latest_version}}.zip
- </pre>
- </div>
- <div class="tab-pane fade show"
id="nav-install-github" role="tabpanel">
- <pre class="brush: bash">
- $ git clone
https://github.com/apache/incubator-nlpcraft.git
- $ mvn clean package -P examples
- </pre>
- </div>
- <div class="tab-pane fade show"
id="nav-install-maven" role="tabpanel">
- <pre class="brush: xml">
- <dependency>
-
<groupId>org.apache.nlpcraft</groupId>
-
<artifactId>nlpcraft</artifactId>
-
<version>{{site.latest_version}}</version>
- </dependency>
- </pre>
- <p>
- <b>NOTE:</b> to get <a
href="/tools/script.html">NLPCraft CLI script</a> you still need to
- download <a
href="/download.html#zip">binary</a> ZIP or <a
href="/download.html#build">build</a> from <a
href="/download.html#src">source</a>.
- </p>
- </div>
- <div class="tab-pane fade" id="nav-install-grape"
role="tabpanel">
- <pre class="brush: java">
- @Grab
('org.apache.nlpcraft:nlpcraft:{{site.latest_version}}')
- </pre>
- <p>
- <b>NOTE:</b> to get <a
href="/tools/script.html">NLPCraft CLI script</a> you still need to
- download <a
href="/download.html#zip">binary</a> ZIP or <a
href="/download.html#build">build</a> from <a
href="/download.html#src">source</a>.
- </p>
- </div>
- <div class="tab-pane fade" id="nav-install-gradle"
role="tabpanel">
- <pre class="brush: java">
- dependencies {
- runtime group: 'org.apache.nlpcraft',
name: 'nlpcraft', version: '{{site.latest_version}}'
- }
- </pre>
- <p>
- <b>NOTE:</b> to get <a
href="/tools/script.html">NLPCraft CLI script</a> you still need to
- download <a
href="/download.html#zip">binary</a> ZIP or <a
href="/download.html#build">build</a> from <a
href="/download.html#src">source</a>.
- </p>
- </div>
- <div class="tab-pane fade" id="nav-install-sbt"
role="tabpanel">
- <pre class="brush: scala">
- libraryDependencies +=
"org.apache.nlpcraft" % "nlpcraft" % "{{site.latest_version}}"
- </pre>
- <p>
- <b>NOTE:</b> to get <a
href="/tools/script.html">NLPCraft CLI script</a> you still need to
- download <a
href="/download.html#zip">binary</a> ZIP or <a
href="/download.html#build">build</a> from <a
href="/download.html#src">source</a>.
- </p>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-header" id="q2">
- <h2 class="mb-0">
- <button class="btn btn-link btn-block text-left"
type="button" data-toggle="collapse" data-target="#cheat2">
- Start <span class="amp">&</span> Stop REST
Server
- </button>
- </h2>
- </div>
- <div id="cheat2" class="collapse" data-parent="#cheats">
- <div class="card-body">
- <nav>
- <div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active"
data-toggle="tab" href="#nav-srv-script" role="tab">NLPCraft CLI</a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-srv-class" role="tab">Java Class <img src="/images/java2-h20.png"
alt=""></a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-srv-docker" role="tab"><i class="fab fa-docker"></i> Docker</a>
- </div>
- </nav>
- <div class="tab-content">
- <div class="tab-pane fade show active"
id="nav-srv-script" role="tabpanel">
- <p></p>
- <p>
- Start the server:
- </p>
- <pre class="brush: bash">
- $ bin/nlpcraft.sh help -c=start-server # Get
help.
- $ bin/nlpcraft.sh start-server # Start server.
- </pre>
- <p>
- Stop the server:
- </p>
- <pre class="brush: bash">
- $ bin/nlpcraft.sh help -c=stop-server # Get
help.
- $ bin/nlpcraft.sh stop-server # Stop server.
- $ bin/nlpcraft.sh stop # Stop both server and
probe.
- </pre>
- </div>
- <div class="tab-pane fade show" id="nav-srv-class"
role="tabpanel">
- <p></p>
- <p>
- If using executable JAR:
- </p>
- <pre class="brush: bash">
- $ java -Xms1024m -jar
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar -server
- </pre>
- <p>
- If specifying additional classpath components
and need <code>-cp</code> parameter:
- </p>
- <pre class="brush: bash">
- $ java -Xms1024m -cp
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar
org.apache.nlpcraft.NCStart -server
- </pre>
- <p>
- <b>NOTES:</b>
- </p>
- <ul>
- <li>
- Make sure to provide correct path to
<code>apache-nlpcraft-incubating-<b>{{site.latest_version}}</b>-all-deps.jar</code>
file.
- </li>
- <li>
- Class
<code>org.apache.nlpcraft.NCStart</code> is a common entry point for all
NLPCraft runtime components.
- </li>
- <li>
- Class
<code>org.apache.nlpcraft.NCStart</code> should be used to star REST server
from IDE.
- </li>
- </ul>
- <p>
- Parameters:
- </p>
- <dl>
- <dt>
- <code>-server</code>
- </dt>
- <dd>
- <em>Mandatory</em> parameter to indicate
that you are starting the REST server.
- </dd>
- <dt><code>-config=path</code></dt>
- <dd>
- <em>Optional</em> parameter to provide
configuration file path.
- Server will automatically look for
<code>nlpcraft.conf</code> configuration file in the same directory
- as
<code>apache-nlpcraft-incubating-<b>{{site.latest_version}}</b>-all-deps.jar</code>
file. If the configuration
- file has different name or in different
location use <code>-config=path</code> parameter
- where <code>path</code> is an absolute
path to the configuration file. Note that the server and the data
- probe can use the same file for their
configuration (like the
- default <code>nlpcraft.conf</code>
contains configuration for both the server and the data probe).
- </dd>
- <dt><code>-igniteConfig=path</code></dt>
- <dd>
- <em>Optional</em> parameter to provide <a
target=_ href="https://ignite.apache.org/">Apache Ignite</a> configuration file
path.
- Note that Apache Ignite is used as a
cluster computing plane and a default distributed storage.
- Server will automatically look for
<code>ignite.xml</code>
- configuration file in the same directory
as
<code>apache-nlpcraft-incubating-<b>{{site.latest_version}}</b>-all-deps.jar</code>
file.
- If the configuration file has different
name or in different location use <code>-igniteConfig=path</code> parameter
- where <code>path</code> is an absolute
path to the Ignite configuration file.
- </dd>
- </dl>
- </div>
- <div class="tab-pane fade show" id="nav-srv-docker"
role="tabpanel">
- <p></p>
- <p>
- If Docker image is available for given version
you can start REST server as follows:
- </p>
- <pre class="brush: bash">
- $ docker run -m 8G -p 8081:8081 -p 8201:8201
-p 8202:8202 nlpcraftserver/server:{{site.latest_version}}
- </pre>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-header" id="q3">
- <h2 class="mb-0">
- <button class="btn btn-link btn-block text-left"
type="button" data-toggle="collapse" data-target="#cheat3">
- Start <span class="amp">&</span> Stop REST
Probe
- </button>
- </h2>
- </div>
- <div id="cheat3" class="collapse" data-parent="#cheats">
- <div class="card-body">
- <nav>
- <div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active"
data-toggle="tab" href="#nav-probe-script" role="tab">NLPCraft CLI</a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-probe-class" role="tab">Java Class <img src="/images/java2-h20.png"
alt=""></a>
- </div>
- </nav>
- <div class="tab-content">
- <div class="tab-pane fade show active"
id="nav-probe-script" role="tabpanel">
- <p></p>
- <p>
- Start the probe:
- </p>
- <pre class="brush: bash">
- $ bin/nlpcraft.sh help -c=start-probe #
Get help.
- $ bin/nlpcraft.sh start-probe
--cp=~/myapp/target/classes # Start probe with default configuration.
- $ bin/nlpcraft.sh start-probe
--cp=~/myapp/target/classes --cfg=~/myapp/nlpcraft.conf --mdls=my.package.Model
--jmvOpts="-ea -Xms2048m" --timeoutMins=5
- > restart-probe # Restart the probe with
the last set of parameters in REPL mode.
- </pre>
- <p>
- Stop the probe:
- </p>
- <pre class="brush: bash">
- $ bin/nlpcraft.sh help -c=stop-probe # Get
help.
- $ bin/nlpcraft.sh stop-probe # Stop probe.
- $ bin/nlpcraft.sh stop # Stop server and
probe.
- </pre>
- </div>
- <div class="tab-pane fade show"
id="nav-probe-class" role="tabpanel">
- <p></p>
- <p>
- If using executable JAR:
- </p>
- <pre class="brush: bash">
- $ 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: bash">
- 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>
- </p>
- <ul>
- <li>
- <code>/my/project</code> directory
contains user-defined model implementation
- </li>
- <li>
- Make sure to provide correct path to
<code>apache-nlpcraft-incubating-<b>{{site.latest_version}}</b>-all-deps.jar</code>
file.
- </li>
- <li>
- Class
<code>org.apache.nlpcraft.NCStart</code> is a common entry point for all
NLPCraft runtime components.
- </li>
- <li>
- Class
<code>org.apache.nlpcraft.NCStart</code> should be used to star data probe from
IDE.
- </li>
- </ul>
- <p>
- Parameters:
- </p>
- <dl>
- <dt>
- <code>-probe</code>
- </dt>
- <dd>
- <em>Mandatory</em> parameter to
indicate that you are starting a data probe.
- </dd>
- <dt><code>-config=path</code></dt>
- <dd>
- <p>
- <em>Optional</em> parameter to
provide probe configuration file path.
- Data probe will automatically look
for <code>nlpcraft.conf</code> configuration file in the same directory
- as
<code>apache-nlpcraft-incubating-<b>{{site.latest_version}}</b>-all-deps.jar</code>
file. If the configuration
- file has different name or in
different location use <code>-config=path</code> parameter
- where <code>path</code> is an
absolute path to the data probe configuration file. Note that the server and
the data
- probe can use the same file for
their configuration (like the
- default <code>nlpcraft.conf</code>
contains configuration for both the server and the data probe).
- </p>
- </dd>
- </dl>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-header" id="q4">
- <h2 class="mb-0">
- <button class="btn btn-link btn-block text-left"
type="button" data-toggle="collapse" data-target="#cheat4">
- Model Auto-Test
- </button>
- </h2>
- </div>
- <div id="cheat4" class="collapse" data-parent="#cheats">
- <div class="card-body">
- <p></p>
- <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>
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 annotations and
checking that resulting
- intent matches the intent the sample was attached
to.
- </p>
- <nav>
- <div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active"
data-toggle="tab" href="#nav-script" role="tab">NLPCraft CLI</a>
- <a class="nav-item nav-link" data-toggle="tab"
href="#nav-class" role="tab">Java Class <img src="/images/java2-h20.png"
alt=""></a>
- </div>
- </nav>
- <div class="tab-content">
- <div class="tab-pane fade show active"
id="nav-script" role="tabpanel">
- <pre class="brush: bash">
- $ bin/nlpcraft.sh help -c=test-model # Get
help.
- $ bin/nlpcraft.sh test-model
--cp=~/myapp/target/classes # Test all models in specified classpath.
- $ bin/nlpcraft.sh test-model
--cp=~/myapp/target/classes --mdls=my.package.Model --jmvOpts="-ea -Xms2048m"
- > retest-model # Rerun the last model test
in REPL mode.
- </pre>
- </div>
- <div class="tab-pane fade show" id="nav-class"
role="tabpanel">
- <pre class="brush: bash">
- java -cp
apache-nlpcraft-incubating-{{site.latest_version}}-all-deps.jar
-DNLPCRAFT_TEST_MODELS=my.package.Model
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>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-header" id="q5">
- <h2 class="mb-0">
- <button class="btn btn-link btn-block text-left"
type="button" data-toggle="collapse" data-target="#cheat5">
- New Project Stub
- </button>
- </h2>
- </div>
- <div id="cheat5" class="collapse" data-parent="#cheats">
- <div class="card-body">
- <nav>
- <div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active"
data-toggle="tab" href="#nav-prj-script" role="tab">NLPCraft CLI</a>
- </div>
- </nav>
- <div class="tab-content">
- <div class="tab-pane fade show active"
id="nav-prj-script" role="tabpanel">
- <pre class="brush: bash">
- $ bin/nlpcraft.sh help -c=gen-project #
Get help.
- $ 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>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-header" id="q6">
- <h2 class="mb-0">
- <button class="btn btn-link btn-block text-left"
type="button" data-toggle="collapse" data-target="#cheat6">
- New Model Stub
- </button>
- </h2>
- </div>
- <div id="cheat6" class="collapse" data-parent="#cheats">
- <div class="card-body">
- <nav>
- <div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active"
data-toggle="tab" href="#nav-mdl-script" role="tab">NLPCraft CLI</a>
- </div>
- </nav>
- <div class="tab-content">
- <div class="tab-pane fade show active"
id="nav-mdl-script" role="tabpanel">
- <pre class="brush: bash">
- $ bin/nlpcraft.sh help -c=gen-model # Get
help.
- $ 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>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="card">
- <div class="card-header" id="q7">
- <h2 class="mb-0">
- <button class="btn btn-link btn-block text-left"
type="button" data-toggle="collapse" data-target="#cheat7">
- Testing With REST
- </button>
- </h2>
- </div>
- <div id="cheat7" class="collapse" data-parent="#cheats">
- <div class="card-body">
- <nav>
- <div class="nav nav-tabs" role="tablist">
- <a class="nav-item nav-link active"
data-toggle="tab" href="#nav-rest-script" role="tab">NLPCraft CLI</a>
- </div>
- </nav>
- <div class="tab-content">
- <div class="tab-pane fade show active"
id="nav-rest-script" role="tabpanel">
- <p></p>
- <p>
- Using <code>ask</code> command:
- </p>
- <pre class="brush: bash">
- $ bin/nlpcraft.sh help -c=ask # Get help.
- $ bin/nlpcraft.sh ask --txt="User request"
# REST 'ask/sync' call.
- </pre>
- <p>
- Using <code>call</code> command (for REPL
mode):
- </p>
- <pre class="brush: bash">
- > help -c=call # Get help.
- > call -p=signin [email protected]
--passwd=admin
- > call --path=ask/sync
--acsTok=qwerty123456 --txt="User request" --mdlId=my.model.id
--data='{"data1": true, "data2": 123, "data3": "some text"}' --enableLog=false
- </pre>
- <p>
- Using <code>rest</code> command (for
command line mode):
- </p>
- <pre class="brush: bash">
- $ bin/nlpcraft.sh help -c=rest # Get help.
- $ 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>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="bq info">
- <p>
- <b>NOTES:</b>
- </p>
- <ul>
- <li>
- Use <span class="keyboard">Tab</span> key for
auto-completion for commands, parameters, paths, and model class names.
- </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>
- <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>
-</div>
-<div class="col-md-2 third-column">
- <ul class="side-nav">
- {% include quick-links.html %}
- </ul>
-</div>
-
-
-
-
diff --git a/examples/light_switch_fr.html b/examples/light_switch_fr.html
index 5c8221e..49241b2 100644
--- a/examples/light_switch_fr.html
+++ b/examples/light_switch_fr.html
@@ -176,8 +176,8 @@ fa_icon: fa-cube
import org.apache.nlpcraft.*
import org.apache.nlpcraft.annotations.*
import demo.nlp.entity.parser.NCFrSemanticEntityParser
- import demo.lightswitch.nlp.token.enricher.*
- import demo.lightswitch.nlp.token.parser.NCFrTokenParser
+ import demo.nlp.token.enricher.*
+ import demo.nlp.token.parser.NCFrTokenParser
import scala.jdk.CollectionConverters.*
class LightSwitchFrModel extends NCModelAdapter(
@@ -380,7 +380,7 @@ fa_icon: fa-cube
package demo.nlp.entity.parser
import opennlp.tools.stemmer.snowball.SnowballStemmer
- import
org.apache.nlpcraft.examples.lightswitch.nlp.token.parser.NCFrTokenParser
+ import demo.nlp.token.parser.NCFrTokenParser
import org.apache.nlpcraft.nlp.parsers.*
class NCFrSemanticEntityParser(src: String) extends
NCSemanticEntityParser(
diff --git a/examples/light_switch_ru.html b/examples/light_switch_ru.html
index 7c0a957..39f1f9e 100644
--- a/examples/light_switch_ru.html
+++ b/examples/light_switch_ru.html
@@ -173,8 +173,8 @@ fa_icon: fa-cube
import org.apache.nlpcraft.*
import org.apache.nlpcraft.annotations.*
import demo.nlp.entity.parser.NCRuSemanticEntityParser
- import demo.lightswitch.nlp.token.enricher.*
- import demo.lightswitch.nlp.token.parser.NCRuTokenParser
+ import demo.nlp.token.enricher.*
+ import demo.nlp.token.parser.NCRuTokenParser
import scala.jdk.CollectionConverters.*
class LightSwitchRuModel extends NCModelAdapter(
diff --git a/installation.html b/installation.html
index 27d1576..00085ca 100644
--- a/installation.html
+++ b/installation.html
@@ -31,8 +31,8 @@ id: installation
<li>If you <a href="/download.html">downloaded</a> binary ZIP
archive -
<a target="asf"
href="https://www.apache.org/dyn/closer.cgi#verify">verify</a> it and unzip it.
</li>
- <li>If you <a href="/download.html">cloned</a> GitHub repository
or downloaded source archive -
- <code>sbt clean compile</code> to build it.
+ <li>If you <a href="/download.html">cloned</a> GitHub repository
or downloaded source archive
+ <code>sbt clean compile</code> to build it.
</li>
<li>Also you can use <code>maven</code> command <code>mvn -B clean
package -P stanford-core,examples</code>
and get same result.
@@ -76,12 +76,14 @@ id: installation
Now you can use <code>NlpCraft</code> library in <code>Your
project</code>.
</li>
<li>
- You can use <code>Sbt</code> or <code>Maven</code> systems
depending on your requirements via links
+ You can use <a href="https://www.scala-sbt.org/">SBT</a> or
+ <a href="https://maven.apache.org/">Maven</a>
+ systems depending on your requirements via links
to <a href="https://search.maven.org/">Maven Central</a>.
</li>
<li>
- You also can build <code>NlpCraft</code> library soource code
and use references on jar files via <code>Ant</code>
- or any another way.
+ You also can build <code>NlpCraft</code> library source code
and use references on jar files via
+ <a href="https://ant.apache.org/">Ant</a> or any another way.
</li>
</ul>
diff --git a/semantic.html b/semantic.html
index bc2e186..7528397 100644
--- a/semantic.html
+++ b/semantic.html
@@ -611,6 +611,48 @@ id: semantic
<code>Line 3</code> makes semantic model which defined in
<code>time_model.yaml</code> YAML file.
</li>
</ul>
+
+ <p>
+ If you want to use <a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCSemanticEntityParser.html">NCSemanticEntityParser</a>
+ with not English language, you have to provide custom
+ <a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCSemanticStemmer.html">NCSemanticStemmer</a>
and
+ <a
href="apis/latest/org/apache/nlpcraft/NCTokenParser.html">NCTokenParser</a>
+ implementations for required language. Look at the <a
href="examples/light_switch_fr.html">Light Switch FR</a>
+ for more details.
+ </p>
+
+ <pre class="brush: scala, highlight: [4, 7, 8]">
+ package demo
+
+ import opennlp.tools.stemmer.snowball.SnowballStemmer
+ import demo.nlp.token.parser.NCFrTokenParser
+ import org.apache.nlpcraft.nlp.parsers.*
+
+ class NCFrSemanticEntityParser(src: String) extends
NCSemanticEntityParser(
+ new NCSemanticStemmer:
+ private val stemmer = new
SnowballStemmer(SnowballStemmer.ALGORITHM.FRENCH)
+ override def stem(txt: String): String =
stemmer.synchronized { stemmer.stem(txt.toLowerCase).toString }
+ ,
+ new NCFrTokenParser(),
+ mdlSrcOpt = Option(src)
+ )
+ </pre>
+ <ul>
+ <li>
+ <code>Line 4</code> includes <code>NCFrTokenParser</code>
import.
+ Its custom <a
href="apis/latest/org/apache/nlpcraft/NCTokenParser.html">NCTokenParser</a>
+ implementation for French language, described here: <a
href="examples/light_switch_fr.html">Light Switch FR</a>.
+ </li>
+ <li>
+ <code>Line 8</code> defines custom <a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCSemanticStemmer.html">NCSemanticStemmer</a>
+ implementation for French language.
+ </li>
+ <li>
+ As you can see, <code>NCFrSemanticEntityParser</code> is very
simple extension of
+ <a
href="apis/latest/org/apache/nlpcraft/nlp/parsers/NCSemanticEntityParser.html">NCSemanticEntityParser</a>
+ base class, look at <code>line 7</code>.
+ </li>
+ </ul>
</section>
</div>
<div class="col-md-2 third-column">