{"id":21743941,"url":"https://github.com/telefonica/language-model-converter","last_synced_at":"2025-04-13T05:07:20.398Z","repository":{"id":57165008,"uuid":"75284024","full_name":"Telefonica/language-model-converter","owner":"Telefonica","description":"Language model converter yaml \u003c-\u003e json for LUIS","archived":false,"fork":false,"pushed_at":"2019-07-25T21:11:22.000Z","size":111,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":18,"default_branch":"master","last_synced_at":"2025-04-13T05:07:11.958Z","etag":null,"topics":["cdco"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Telefonica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-12-01T10:58:32.000Z","updated_at":"2021-09-27T07:51:30.000Z","dependencies_parsed_at":"2022-09-12T09:12:34.492Z","dependency_job_id":null,"html_url":"https://github.com/Telefonica/language-model-converter","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flanguage-model-converter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flanguage-model-converter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flanguage-model-converter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Telefonica%2Flanguage-model-converter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Telefonica","download_url":"https://codeload.github.com/Telefonica/language-model-converter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248665747,"owners_count":21142123,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cdco"],"created_at":"2024-11-26T07:09:28.663Z","updated_at":"2025-04-13T05:07:20.379Z","avatar_url":"https://github.com/Telefonica.png","language":"TypeScript","readme":"# language-model-converter\n\nThis is a tool to convert language files defined in yaml language model into the [LUIS](http://luis.ai) internal JSON representation.\n\n### The language model\nThis is a [yaml](http://www.yaml.org/) format file that is conveted to a [JSON file](https://dev.projectoxford.ai/docs/services/56d95961e597ed0f04b76e58/operations/56f8a55119845511c81de480) that LUIS can undestand\n\nWords preceed by `#` are comments, and its purpose is to leave some insights to people that will help on understanding whats going on. These words will be removed when training luis, so feel free to add as much as you want to help next colleagues that will manage the file\n\n```yaml\n\nlist.${examples}:  # Defines a example list to make substitutions in the utterances\n  - heaven\n  - hell\n\ntef.intent.info: # Defines a Luis Intent\n  - Tell me about the purgatory # Simple utterance\n  - What is ${examples} # Substitution with list: Will generate for you \"What is heaven\" and \"What is hell\"\n\ntef.intent.go: # Defines a Luis Intent\n  - Go to [purgatory:tef.places] # Defines an entity \"tef.places\" giving \"purgatory\" as an example. The example is mandatory\n  - Head to [${examples}:tef.places] # You can make substitution in the entity examples too!\n  - We will go to [hell:tef.places] from [january 1:tef.date::start] until [december 31:tef.date::enf] # Hierarchical Entities are supported also\n\nphraselist:\n  aksforinfo: # ex: How to ask for something synonims:\n    words:\n      - Tell me about\n      - What is\n\n  tef.places: # ex: Place examples here for training entities\n    words:\n      - heaven\n      - hell\n      - purgatory\n      - home\n  # if you want no have a not-exangeable phraselist, add the property `mode: false` to it. Example:\n  # tef.relations\n  #   mode: false\n  #   words:\n  #     - leader\n  #     - area\n  # more info: https://github.com/Microsoft/Cognitive-Documentation/issues/97#issuecomment-265738124\n\nbuiltin: # LUIS builtin entities that should be used\n  - age\n  - datetime\n  - dimension\n  - encyclopedia\n  - geography\n  - money\n  - number\n  - ordinal\n  - percentage\n  - temperature\n```\n\nThe list of **builtin** entities can be found in the [LUIS Help](https://www.luis.ai/Help#PreBuiltEntities) and/or the [Cognitive Services Help](https://www.microsoft.com/cognitive-services/en-us/luis-api/documentation/pre-builtentities)\nPlease, read carefully about what entities are available for the target language you are writting utterances to, as\n\u003e Unless otherwise noted, each pre-built entity is available in all LUIS application locales (cultures).\n\n_Note: maybe the doc page [is not actualized with all the entities](https://github.com/Microsoft/Cognitive-Documentation/issues/96)_\n\nYou dont need to declare with brackets the builtin entities. They are recognized by default on LUIS. I.E:\n```yaml\n# DONT DO THIS\ntef.intent.money:\n  - It's worth [$30:builtin.money]\n\n# DO THIS\nbuiltin:\n  - money\n\ntef.intent.money:\n  - It's worth $30\n```\n\n### Limitations\nAs of writing this doc, the following limitations apply in LUIS Service\n * Max of 40 intents (`tef.intent.info` + `tef.intent.go` = 2)\n * Max of 50 chars for the intent name (`tef.intent.info` = 15)\n * Max of 10 phraselists (`askforinfo` + `tef.places` = 2)\n * Max of 10 entities ([something:`tef.places`]) _You can provide as much examples as you want for the entities_\n * Max of 10 children entities per parent ([something:`tef.date::start`])\n\n## Usage examples\n\n```sh\nnpm install -g @telefonica/language-model-converter\nlanguage-model-converter --help\n\n  Usage: language-model-converter [options] \u003cfiles\u003e\n\n  Convert language files defined to LUIS format\n\n  Options:\n\n    -h, --help               output usage information\n    -c, --culture \u003cculture\u003e  Culture code this files belongs to (ex. \"en-us\")\n    -n, --ner                Generate a model compatible with NER\n\n  Examples:\n\n    Convert all files in 'models' and its subfolders, starting with 'en',\n    setting the locale to en-us\n      $ language-model-converter ./models/**/en*.yaml -c en-us\n```\n\nNotice that you can use [luis-cli](https://github.com/Telefonica/luis-cli) to import or update the generated LUIS models.\n\n## USE IT PROGRAMMATICALLY\nYou can also use this module from code:\n\n```typescript\nimport { LanguageModelParser, culture } from '@telefonica/language-model-converter';\n\nlet parser = new LanguageModelParser();\nlet files = 'model.yaml';\ntry {\n    let luisModel = parser.parse(files, 'en-us' as culture);\n    // Do something with the LUIS model\n} catch (err) {\n    // Manage errors\n}\n```\n\n## LICENSE\n\nCopyright 2016 [Telefónica I+D](http://www.tid.es)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelefonica%2Flanguage-model-converter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftelefonica%2Flanguage-model-converter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftelefonica%2Flanguage-model-converter/lists"}