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.git


The following commit(s) were added to refs/heads/master by this push:
     new 668cf8c7 Update NCPipeline.java
668cf8c7 is described below

commit 668cf8c757525be4a2528aa3cd4d3daca49a1713
Author: Aaron Radzinski <[email protected]>
AuthorDate: Tue Apr 5 09:31:57 2022 -0700

    Update NCPipeline.java
---
 .../main/scala/org/apache/nlpcraft/NCPipeline.java | 35 ++++++++++++++--------
 1 file changed, 22 insertions(+), 13 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java
index 65f1f60e..072cc2c4 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java
@@ -27,19 +27,19 @@ import java.util.Optional;
  * An NLP pipeline is a container for various processing components that take 
the input text at the beginning of the
  * pipeline and produce the list of {@link NCEntity entities} at the end of 
the pipeline.
  * Schematically the pipeline looks like this:
- * &lt;pre&gt;
- *                                                ,---------.        
,----------.        ,-------.
- *   o/         *=========*    ,---------.    ,---'-------. |    
,---'--------. |    ,---'-----. |
- *  /|     -&gt;   :  Text   : -&gt; |  Token  | -&gt; | Token     | | -&gt; | 
Token      | | -&gt; | Entity  | |
- *  / \         :  Input  :    |  Parser |    | Enrichers |-'    | Validators 
|-'    | Parsers |-'
- *              *=========*    `---------'    `-----------'      
`------------'      `---------'
- *                                                                             
            |
- *                                                   ,----------.        
,---------.       |
- *              *============*    ,---------.    ,---'--------. |    
,---'-------. |       |
- * Intent   &lt;-  :  Entity    : &lt;- | Variant | &lt;- | Entity     | | 
&lt;- | Entity    | | &lt;-----'
- * Matching     :  Variants  :    | Filter  |    | Validators |-'    | 
Enrichers |-'
- *              *============*    `---------'    `------------'      
`-----------'
- * &lt;/pre&gt;
+ * <pre>
+ *                                               ,---------.        
,----------.        ,-------.
+ *   o/         *=========*    ,--------.    ,---'-------. |    ,---'--------. 
|    ,---'-----. |
+ *  /|     -&gt;   :  Text   : -&gt; | Token  | -&gt; | Token     | | -&gt; | 
Token      | | -&gt; | Entity  | | -------.
+ *  / \         :  Input  :    | Parser |    | Enrichers |-'    | Validators 
|-'    | Parsers |-'        |
+ *              *=========*    `--------'    `-----------'      `------------' 
     `---------'          |
+ *                                                                             
                          |
+ *                                                                 
,----------.        ,---------.       |
+ *              *============*    ,---------.    ,--------.    ,---'--------. 
|    ,---'-------. |       |
+ * Intent   &lt;-  :  Entity    : &lt;- | Variant | &lt;- | Entity | &lt;- | 
Entity     | | &lt;- | Entity    | | &lt;-----'
+ * Matching     :  Variants  :    | Filter  |    | Mapper |    | Validators 
|-'    | Enrichers |-'
+ *              *============*    `---------'    `--------'    `------------'  
    `-----------'
+ * </pre>
  * <p>
  * Pipeline has the following components:
  * <ul>
@@ -101,6 +101,15 @@ import java.util.Optional;
  *     </li>
  *     <li>
  *         <p>
+ *             After entities have been validated they go through the list of 
optional entity mappers. Entity mapper's primary
+ *             role is to combine multiple entities into a new one without a 
need to modify entity parser or enrichers. More
+ *             than one entity mapper can be chained together to form a 
transformation sub-pipeline. For example,
+ *             if you have individual entities for pizza, pizza size and list 
of toppings, the entity mapper could combine all these
+ *             individual entities into a new single pizza order entity that 
would then be used in intent matching in much easier way.
+ *         </p>
+ *     </li>
+ *     <li>
+ *         <p>
  *              Finally, there is an optional filter for {@link NCVariant} 
instances before they get into intent matching. This
  *              filter allows to filter out unnecessary (or spurious) parsing 
variants based on application-specific logic.
  *              Note that amount of parsing variants directly correlates to 
the overall performance of intent matching.

Reply via email to