| # |
| # 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. |
| # |
| |
| id: "nlpcraft.cargps.ex" |
| name: "Car GPS Example Model" |
| version: "1.0" |
| description: "NLI-powered car GPS-based navigation example model." |
| enabledBuiltInTokens: |
| - "nlpcraft:num" |
| - "nlpcraft:city" |
| - "nlpcraft:country" |
| - "nlpcraft:region" |
| |
| macros: |
| - name: "<HEY>" |
| macro: "{hey|hi|howdy}" |
| - name: "<NAVIGATE>" |
| macro: "{go|move|navigate|pilot|journey|plot|drive|route|plan|find|head|ride|direct|steer|operate|sail} {out|_} {course|route|destination|drive|_} {to|_}" |
| - name: "<CANCEL>" |
| macro: "{cancel|stop|abort|finish|cease|quit} {off|_}" |
| - name: "<WAYPOINT>" |
| macro: "{waypoint|stopover|stop over|way station|stop|checkpoint|stop point} {point|station|_}" |
| |
| # Make sure 'howdy' is not marked as a stopword. |
| excludedStopWords: |
| - howdy |
| |
| # Don't surface these tokens as standalone one. They are used only |
| # as building blocks for other tokens. |
| abstractTokens: |
| - x:addr:kind |
| - x:addr:num |
| - x:addr:st |
| - x:street:addr |
| |
| elements: |
| # |
| # Address definition. |
| # ------------------- |
| - id: "x:addr:kind" |
| # Short list from https://pe.usps.com/text/pub28/28apc_002.htm |
| synonyms: |
| - "{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}" |
| |
| # Street number. |
| - id: "x:addr:num" |
| synonyms: |
| # Straight number. |
| - "^^{# == 'nlpcraft:num' && meta_tok('nlpcraft:num:unit') == null && meta_tok('nlpcraft:num:isequalcondition')}^^" |
| |
| # Street name. |
| - id: "x:addr:st" |
| greedy: false |
| synonyms: |
| # Alphanumeric and must be after street number and before street kind. |
| - "{^^{is_alphanum(tok_txt) && tok_is_between_ids('x:addr:num', 'x:addr:kind') == true}^^}[1,3]" |
| |
| - id: "x:street:addr" |
| synonyms: |
| - "^^{# == 'x:addr:num'}^^ ^^{# == 'x:addr:st'}^^ ^^{# == 'x:addr:kind'}^^" |
| |
| - id: "x:addr" |
| synonyms: |
| - "^^{# == 'x:street:addr'}^^ {^^{# == 'nlpcraft:city'}^^}[0,1]" |
| |
| - id: "x:hey" |
| description: "NLI prompt, salutation." |
| synonyms: |
| - "<HEY> {car|vehicle|{pickup|_} truck|pickup|van|sedan|coupe|lorry}" |
| |
| - id: "x:cancel" |
| description: "Cancel action." |
| synonyms: |
| - "<CANCEL> <NAVIGATE>" |
| |
| - id: "x:navigate" |
| description: "Start 'navigate' action." |
| synonyms: |
| - "<NAVIGATE>" |
| - "{find|give|get|calculate} {me|_} {shortest|fastest|quickest|ideal|best|_} {navigation|route|path|drive|course|ride}" |
| |
| - id: "x:add-waypoint" |
| description: "Add 'waypoint' action." |
| synonyms: |
| - "{add|make} <WAYPOINT>" |
| - "stop {by|at}" |
| |
| - id: "x:remove-waypoint" |
| description: "Remove last 'waypoint' action." |
| synonyms: |
| # NOTE: assumes the LAST waypoint, if any. |
| - "{skip|remove} {over|_} {last|latest|current|_} <WAYPOINT>" |
| - "<CANCEL> {last|latest|current|_} <WAYPOINT>" |
| - "<NAVIGATE> without {stopping|<WAYPOINT>}" |
| |
| intents: |
| - "import('cargps_intents.idl')" |