This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch NLPCRAFT-384
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-384 by this push:
     new ddd733b  WIP.
ddd733b is described below

commit ddd733b80e6d47944abd0d9d931f98d5d68e938f
Author: Aaron Radzinski <[email protected]>
AuthorDate: Tue Aug 24 01:23:58 2021 -0700

    WIP.
---
 .../cargps/src/main/resources/cargps_intents.idl   |  2 +-
 .../cargps/src/main/resources/cargps_model.yaml    | 34 +++++++++++++++-------
 .../resources/samples/cargps_navigate_samples.txt  |  1 +
 3 files changed, 26 insertions(+), 11 deletions(-)

diff --git a/nlpcraft-examples/cargps/src/main/resources/cargps_intents.idl 
b/nlpcraft-examples/cargps/src/main/resources/cargps_intents.idl
index 00baf99..bf82b2c 100644
--- a/nlpcraft-examples/cargps/src/main/resources/cargps_intents.idl
+++ b/nlpcraft-examples/cargps/src/main/resources/cargps_intents.idl
@@ -29,6 +29,6 @@ intent=int:cancel
     fragment(hey)
     term={tok_id() == "x:cancel"}
 
-intent=int:navigate fragment(hey) term={tok_id() == "x:navigate"}
+intent=int:navigate fragment(hey) term={tok_id() == "x:navigate"} 
term={tok_id() == "x:addr"}
 intent=int:add:waypoint fragment(hey) term={tok_id() == "x:add-waypoint"}
 intent=int:remove:waypoint fragment(hey) term={tok_id() == "x:remove-waypoint"}
\ No newline at end of file
diff --git a/nlpcraft-examples/cargps/src/main/resources/cargps_model.yaml 
b/nlpcraft-examples/cargps/src/main/resources/cargps_model.yaml
index 357fcf7..4ba30c2 100644
--- a/nlpcraft-examples/cargps/src/main/resources/cargps_model.yaml
+++ b/nlpcraft-examples/cargps/src/main/resources/cargps_model.yaml
@@ -19,7 +19,11 @@ id: "nlpcraft.cargps.ex"
 name: "Car GPS Example Model"
 version: "1.0"
 description: "NLI-powered car GPS-based navigation example model."
-enabledBuiltInTokens: [] # This example doesn't use any built-in tokens.
+enabledBuiltInTokens:
+    - "nlpcraft:num"
+    - "nlpcraft:city"
+    - "nlpcraft:country"
+    - "nlpcraft:region"
 
 macros:
   - name: "<HEY>"
@@ -31,16 +35,26 @@ macros:
   - name: "<WAYPOINT>"
     macro: "{waypoint|location|point|stopover|stop over|way 
station|stop|checkpoint|stop point} {point|station|_}"
 
-#
-# Allows for multi-word synonyms in this entire model
-# to be sparse and permutate them for better detection.
-# These two properties generally enable a free-form
-# natural language comprehension.
-#
-permutateSynonyms: true
-sparse: true
-
 elements:
+  - id: "x:addr:kind"
+    # Short list from https://pe.usps.com/text/pub28/28apc_002.htm
+    synonyms:
+      # street[0,2] => {_|street|street street}
+      - 
"{street|drive|court|plaza|avenue|alley|anex|beach|bend|boulevard|bridge|canyon|causeway|way|circle|corner|creek|fork|harbor|highway|expressway|island|lane|lake|loop|motorway|park|path|point|ramp|route|rue|row|skyway|square|station|summit|trail|tunnel|walk|road}"
+      - "{st|str|dr|crt|plz|ave|blvd|hwy|rd}"
+
+  - id: "x:addr:num"
+    synonyms:
+      - "^^{tok_id() == 'nlpcraft:num' && meta_tok('nlpcraft:num:unit') == 
null && meta_tok('nlpcraft:num:isequalcondition')}^^"
+
+  - id: "x:addr:st"
+    synonyms:
+      - "{//[a-zA-Z0-9]+//}[1,3]"
+
+  - id: "x:addr"
+    synonyms:
+      - "^^[num]{tok_id() == 'x:addr:num'}^^ ^^[name]{tok_id() == 
'x:addr:st'}^^ ^^[kind]{tok_id() == 'x:addr:kind'}^^"
+
   - id: "x:hey"
     description: "NLI prompt"
     synonyms:
diff --git 
a/nlpcraft-examples/cargps/src/main/resources/samples/cargps_navigate_samples.txt
 
b/nlpcraft-examples/cargps/src/main/resources/samples/cargps_navigate_samples.txt
index 329393e..03472b0 100644
--- 
a/nlpcraft-examples/cargps/src/main/resources/samples/cargps_navigate_samples.txt
+++ 
b/nlpcraft-examples/cargps/src/main/resources/samples/cargps_navigate_samples.txt
@@ -18,3 +18,4 @@
 #
 # Set of samples (corpus) for automatic unit and regression testing.
 #
+hey car, drive to 21 table rock drive

Reply via email to