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 743ed28  WIP.
743ed28 is described below

commit 743ed28e3af57839c2e3e86877c346375bee4abd
Author: Aaron Radzinski <[email protected]>
AuthorDate: Fri Jun 4 20:31:16 2021 -0700

    WIP.
---
 _data/blogs.yaml                                   |  10 ++
 _data/news.yml                                     |   9 ++
 blogs.html                                         |   3 +-
 blogs/nlpcraft-idl-intent-definition-language.html | 110 ++++++++++++++++++++-
 4 files changed, 128 insertions(+), 4 deletions(-)

diff --git a/_data/blogs.yaml b/_data/blogs.yaml
index 716190e..615f328 100644
--- a/_data/blogs.yaml
+++ b/_data/blogs.yaml
@@ -26,6 +26,16 @@
   twitter_id: aaron_radzinski
   href_target: _self
 
+- title: Язык определения интентов NLPCraft IDL
+  url: https://habr.com/ru/post/559716/
+  excerpt: Новая версия декларативного языка определения интентов, получившая 
название NLPCraft IDL (NLPCraft Intents Definition Language), значительно 
упростила процесс работы с интентами в диалоговых и поисковых системах, 
построенных на базе проекта Apache NLPCraft и вместе с тем расширила 
возможности системы...
+  author: Сергей Камов
+  publish_date: May 28, 2021
+  avatar_url: images/sergey_kamov_avatar.png
+  twitter_id: apachenlpcraft
+  href_target: habr
+  ru: true
+
 - title: Программируемые NER компоненты
   url: https://habr.com/ru/post/543786/
   excerpt: В данной заметке мы продолжим говорить о NER компонентах и 
попытаемся  определить условия, в которых нам начинает недоставать функционала 
стандартных компонентов и стоит задуматься о программировании своих 
собственных...
diff --git a/_data/news.yml b/_data/news.yml
index ad8c430..6cc0aa8 100644
--- a/_data/news.yml
+++ b/_data/news.yml
@@ -24,6 +24,15 @@
   twitter_id: aaron_radzinski
   href_target: _self
 
+- title: Язык определения интентов NLPCraft IDL
+  url: https://habr.com/ru/post/559716/
+  excerpt: Новая версия декларативного языка определения интентов, получившая 
название NlpCraft IDL , значительно упростила процесс работы с интентами в 
диалоговых и поисковых системах...
+  author: Сергей Камов
+  publish_date: May 28, 2021
+  avatar_url: images/sergey_kamov_avatar.png
+  twitter_id: apachenlpcraft
+  href_target: habr
+
 - title: 📢 Apache NLPCraft 0.7.5 Released
   url: /relnotes/release-notes-0.7.5.html
   excerpt: Download NLPCraft 0.7.5. Over 50 💪 fixes, improvements and 
enhancements.
diff --git a/blogs.html b/blogs.html
index e2a67cd..e95f25d 100644
--- a/blogs.html
+++ b/blogs.html
@@ -39,7 +39,7 @@ layout: interior
             <div class="blog-block">
                 <div class="blog-title">
                     <a style="color: #{{ news.title_color }} !important;" 
href="{{ news.url }}" target={{ news.href_target }}>
-                        {{ news.title }}
+                        {{ news.title }} {% if news.ru %}<img alt="" 
style="vertical-align: text-bottom" src="/images/ru-flag-128x128.png" 
width="24">{% endif %}
                     </a>
                 </div>
                 <div class="blog-excerpt">
@@ -52,7 +52,6 @@ layout: interior
                     {% if news.medium_id %}<a target="medium" 
href="https://medium.com/@{{ news.medium_id}}"><i class="fab fa-fw 
fa-medium"></i></a>{% endif %}
                     {% if news.twitter_id %}<a target="twitter" 
href="https://twitter.com/{{ news.twitter_id}}"><i class="fab fa-fw 
fa-twitter"></i></a>{% endif %}
                     <span class="text-nowrap">{{news.publish_date}}</span>
-                    {% if news.ru %}<img alt="" 
src="/images/ru-flag-128x128.png" width="24">{% endif %}
                 </div>
             </div>
             {% endfor %}
diff --git a/blogs/nlpcraft-idl-intent-definition-language.html 
b/blogs/nlpcraft-idl-intent-definition-language.html
index d9976ed..027c8e5 100644
--- a/blogs/nlpcraft-idl-intent-definition-language.html
+++ b/blogs/nlpcraft-idl-intent-definition-language.html
@@ -30,7 +30,7 @@ publish_date: June 3, 2021
         This blog is an English adaptation of Sergey Kamov's <a target=habr 
href="https://habr.com/ru/post/559716";>blog</a> written in Russian.
     </div>
     <p>
-        This article is a second part of the article <a target=habr 
href="https://habr.com/ru/post/534034/";>Designing intents with Apache 
NlpCraft</a>
+        This article is a second part of the article <a target=habr 
href="https://habr.com/ru/post/534034/";>Проектируем интенты с Apache 
NLPCraft</a>
         <img alt="" src="/images/ru-flag-128x128.png" width="24"> and contains 
a detailed description of
         NLPCraft IDL - Intent Definition Language, created for NLP projects 
based on the Apache NlpCraft.
         NLPCraft IDL support has been added to the system since version <a 
href="/download.html">0.7.5</a>.
@@ -190,10 +190,116 @@ publish_date: June 3, 2021
         The program contains a set of the following optional elements, in no 
particular order:
     </p>
     <ul>
-        <li><code>import</code> statement</li>
+        <li>
+            <code>import</code> statement
+        </li>
         <li><code>fragment</code> statement</li>
         <li><code>intent</code> statement</li>
     </ul>
+    <b><code>import</code> Statement</b>
+    <p>
+        It contains the <code>import</code> keyword and the file name or URL 
resource in parentheses. It allows to import
+        other IDL definitions from external files or URLs. For example:
+    </p>
+    <pre class="brush: idl">
+        import('http://mysite.com/nlp/idls/external.idl)
+    </pre>
+    <b><code>fragment</code> Statement</b>
+    <p>
+        It contains the <code>fragment</code> keyword with the name and a list 
of terms. Terms can be parameterized.
+        An example of a simple fragment:
+    </p>
+    <pre class="brush: idl">
+        fragment=buzz term~{tok_id() == 'x:alarm'}
+    </pre>
+    <p>
+        An example of a parameterized fragment with arguments <code>a</code> 
and <code>b</code>:
+    </p>
+    <pre class="brush: idl">
+        fragment=p1
+        term={
+            meta_frag('a') &&
+            has_any(get(meta_frag('b'), 'Москва'), list(1, 2))
+        }
+    </pre>
+    <p>
+        Below is an example of using this fragment in an intent. Note that 
fragment’s parameters (its metadata) is passed using JSON format:
+    </p>
+    <pre class="brush: idl">
+        intent=i1
+        fragment(p1, {'a': true, 'b': {'Москва': [1, 2, 3]}})
+    </pre>
+    <b><code>intent</code> Statement</b>
+    <p>
+        This statement is the core element of IDL allowing to declare the 
intent. Here's the example
+        of the simple intent:
+    </p>
+    <pre class="brush: idl">
+        intent=xa
+           flow="^(?:login)(^:logout)*$"
+           meta={'enabled': true}
+           term(a)={!(tok_id()) != "z"}[1,3]
+    </pre>
+    <p>
+        Every intent statement consists of the following elements:
+    </p>
+    <ul>
+        <li>
+            <p><b>Intent Name</b></p>
+            <p>
+                Required element. The name is a unique identifier within the 
model. Below is an example of using a reference
+                to the <code>xa</code> intent.
+            </p>
+            <pre class="brush: java">
+                @NCIntentRef("xa")
+                fun onTimeMatch(
+                    ctx: NCIntentMatch,
+                    @NCIntentTerm("a") tok: NCToken
+                ): NCResult { ... }
+            </pre>
+        </li>
+        <li>
+            <p><b>Intent Terms</b></p>
+            <p>
+                At least one term is required. Term is the main element of the 
intent definition. Term consists of
+                the predicate over a token (term body). The constituent parts 
of the predicate can be based on
+                the token or on some other factors.
+            </p>
+            <p>
+                Here's how an intent's term is defined:
+            </p>
+            <ul>
+                <li>The <code>term</code> keyword. Required element.</li>
+                <li>
+                    Name in parentheses. Optional. Used to create references 
to the found token in the callback arguments,
+                    see the example above, token <code>a</code>.
+                </li>
+                Term type. Required element. Two term types are supported:
+                “~“ - the token can be obtained from the history of the dialog 
or from the current request (i.e. the term is conversational).
+                “=“ - the token should be obtained only from the current 
request.
+                Example: term(nums)~{tok_id() == 'nlpcraft:num'}
+                The term body. Required element. There are two ways to define 
the term body: using built-in functions or in code.
+                Examples:
+                term(nums)={tok_id() == 'nlpcraft:num'}
+                term(nums)~{true}
+                term~/org.mypackage.MyClass#termMethod/?
+                Note the special syntax for the last term.
+                Quantifier. Optional. The default value is [1, 1]. The 
following types of quantifiers are supported:
+                [M, N] - the term must be found from N to M times.
+                * - the term must be found at least once, is equivalent to [0, 
∞]
+                + - the term must be found more than once, is it equivalent to 
[1, ∞]
+                ? - the term must be found 0 or 1 time, equivalent to [0, 1]
+                Examples:
+                term(nums)={tok_id() == 'nlpcraft:num'}[1,2] - the request 
must contain one or two tokens with the identifier “nlpcraft: num”.
+                term(nums)={tok_id() == 'nlpcraft:num'}* - the request must 
contain one or more tokens with the identifier “nlpcraft: num”.
+            </ul>
+        </li>
+        <li><p><b>IDL Built-In Functions</b></p></li>
+        <li><p><b>Intent Fragments</b></p></li>
+        <li><p><b>Intent Flow</b></p></li>
+        <li><p><b>Intent Metadata</b></p></li>
+        <li><p><b>Ordered Flag</b></p></li>
+    </ul>
 </section>
 
 

Reply via email to