{"id":18729938,"url":"https://github.com/jovotech/jovo-model","last_synced_at":"2025-04-12T17:04:23.531Z","repository":{"id":37442190,"uuid":"180602449","full_name":"jovotech/jovo-model","owner":"jovotech","description":"💬 A language model abstraction layer that works across NLU providers, including Alexa, Dialogflow, LUIS, Rasa, and more","archived":false,"fork":false,"pushed_at":"2024-02-27T19:22:27.000Z","size":4918,"stargazers_count":19,"open_issues_count":12,"forks_count":11,"subscribers_count":8,"default_branch":"v4/latest","last_synced_at":"2024-10-29T12:13:15.142Z","etag":null,"topics":["nlu"],"latest_commit_sha":null,"homepage":"https://www.jovo.tech/marketplace/jovo-model","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/jovotech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"open_collective":"jovo-framework","github":"jovotech"}},"created_at":"2019-04-10T14:44:52.000Z","updated_at":"2023-09-07T20:02:57.000Z","dependencies_parsed_at":"2023-09-24T16:43:37.047Z","dependency_job_id":"9d4b51c5-123b-48ae-a701-22558a3b724a","html_url":"https://github.com/jovotech/jovo-model","commit_stats":{"total_commits":271,"total_committers":15,"mean_commits":"18.066666666666666","dds":0.5608856088560885,"last_synced_commit":"1b73eb175659af6c964fdaab332a6aade486aa1b"},"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jovotech%2Fjovo-model","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jovotech%2Fjovo-model/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jovotech%2Fjovo-model/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jovotech%2Fjovo-model/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jovotech","download_url":"https://codeload.github.com/jovotech/jovo-model/tar.gz/refs/heads/v4/latest","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247649264,"owners_count":20973017,"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":["nlu"],"created_at":"2024-11-07T14:30:30.018Z","updated_at":"2025-04-12T17:04:23.500Z","avatar_url":"https://github.com/jovotech.png","language":"TypeScript","funding_links":["https://opencollective.com/jovo-framework","https://github.com/sponsors/jovotech"],"categories":[],"sub_categories":[],"readme":"# Jovo Model\n\n![Jovo Model: NLU abstraction for Alexa, Dialogflow, Google Actions, Rasa NLU, Microsoft LUIS, and more](./img/jovo-model.png)\n\nThe Jovo Model is a language model abstraction layer that works across NLU providers. It allows you to maintain a language model in a single source of truth and then translate it into different platform schemas like Amazon Alexa, Google Assistant, Dialogflow, Rasa NLU, Microsoft LUIS, and more.\n\n- [Introduction](#introduction)\n- [Supported Platforms](#supported-platforms)\n- [Model Structure](#model-structure)\n- [Using the Jovo Model with the Jovo CLI](#using-the-jovo-model-with-the-jovo-cli)\n  - [Models Folder](#models-folder)\n  - [Build Folder](#build-folder)\n- [Using the Jovo Model npm Packages](#using-the-jovo-model-npm-packages)\n  - [Model Conversions](#model-conversions)\n  - [Updating the Model](#updating-the-model)\n- [Contributing](#contributing)\n\n\n## Introduction\n\nThe Jovo Framework works with many different [platforms](https://www.jovo.tech/marketplace/tag/platforms) and [natural language understanding (NLU) providers](https://www.jovo.tech/marketplace/tag/nlu) that turn spoken or written language into structured meaning. Each of these services have their own schema that needs to be used to train their models. If you want to use more than one provider, designing maintaining the different language models can become a tedious task.\n\nThe Jovo Model enables you to store language model information in a single JSON file. For Jovo projects, you can find the language model files in the `/models` folder:\n\n![Models Folder in a Jovo Project](./img/folder-structure-models.png \"Models Folder in a Jovo Project\" )\n\nThe Jovo Model is mainly used by the [Jovo CLI](https://www.jovo.tech/marketplace/jovo-cli)'s [`build` command](https://www.jovo.tech/marketplace/jovo-cli/build) which turns the files into platform specific models like Alexa Interaction Models and Dialogflow agents. These resulting models can then be deployed to the respective platforms and trained there. Learn more here: [Using the Jovo Model with the Jovo CLI](#using-the-jovo-model-with-the-jovo-cli).\n\nWe chose to open source this repository to provide more flexibility to Jovo users and tool providers. You can directly access the Jovo Model features from your code and make transformations yourself. Learn more here: [Using the Jovo Model npm Packages](#using-the-jovo-model-npm-packages).\n\n\n## Supported Platforms\n\nThe Jovo Model supports the following NLU providers):\n\n* [Amazon Alexa](./packages/jovo-model-alexa)\n* [Amazon Lex](./packages/jovo-model-lex)\n* [Google Dialogflow](./packages/jovo-modeldialogflow)\n* [Google Assistant Conversational Actions](./packages/jovo-model-googleassistant)\n* [Microsoft LUIS](./packages/jovo-model-luis)\n* [Rasa NLU](./packages/jovo-model-rasa)\n* [NLP.js](./packages/jovo-model-nlpjs)\n* [Snips NLU](./packages/jovo-model-snips)\n\n## Model Structure\n\n[Learn more about the model schema here](./docs/model-schema.md).\n\n## Using the Jovo Model with the Jovo CLI\n\nIn regular Jovo projects, the Jovo Model is translated into different NLU formats and then deployed by using the [Jovo CLI](https://www.jovo.tech/marketplace/jovo-cli).\n\nThe workflow consists of three elements:\n\n* [`models` folder](#models-folder) that stores the Jovo Model files\n* [`build` folder](#build-folder) that consists all generated files\n* [`jovo.project.js` file](#project-configuration) that contains all project configuration\n\n\n### Models Folder\n\nThe `models` folder contains all the language models. Each locale (like `en-US`, `de-DE`) has its own JSON file.\n\n\n### Build Folder\n\nThe `build` folder includes all the information you need to deploy the project to the respective developer platforms like Amazon Alexa and Google Assistant.\n\nAt the beginning of a new project, the folder doesn't exist until you either import an existing platform project with [`jovo get`](https://www.jovo.tech/marketplace/jovo-cli/get), or create the files from the Jovo Model with [`jovo build`](https://www.jovo.tech/marketplace/jovo-cli/build).\n\nWe recommend to use the `jovo.project.js` file ([see the project configuration documentation here](https://github.com/jovotech/jovo-framework/blob/v4dev/docs/project-config.md)) as the single source of truth and add the `build` folder to the `.gitignore` to avoid conflicts (like Alexa Skill IDs) if you're working on a project with a team.\n\n\n## Using the Jovo Model npm Packages\n\nYou can download the package like this:\n\n```sh\n$ npm install @jovotech/model\n```\n\n\n### Model Conversions\n\nBy using this package in your code, you can convert the data from one platform schema to another.\n\n* [Jovo Model to Platform Schema](#jovo-model-to-platform-schema)\n* [Platform Schema to Jovo Model](#platform-schema-to-jovo-model)\n* [Platform Schema A to Platform Schema B](#platform-schema-a-to-platform-schema-b)\n\n#### Jovo Model to Platform Schema\n\nTo turn a Jovo Model into a platform model like Alexa, you can do the following:\n\n```javascript\nimport { NativeFileInformation } from '@jovotech/model';\nimport { JovoModelAlexa } from '@jovotech/model-alexa';\n\nconst jovoModelInstance = new JovoModelAlexa();\nconst jovoModelData = '...';\nconst locale = 'en-US';\njovoModelInstance.importJovoModel(jovoModelData, locale);\nconst alexaModelFiles = jovoModelInstance.exportNative();\n```\n\n#### Platform Schema to Jovo Model\n\nIf you want to turn a platform model like Alexa into the Jovo Model format, do this:\n\n```javascript\nimport { NativeFileInformation } from '@jovotech/model';\nimport { JovoModelAlexa } from '@jovotech/model-alexa';\n\nconst jovoModelInstance = new JovoModelAlexa();\nconst alexaModelFiles: NativeFileInformation = [\n    {\n        path: [\n            'fileName.json',\n        ],\n        content: '...',\n    }\n];\nconst locale = 'en-US';\njovoModelInstance.importNative(alexaModelFiles, locale);\nconst jovoModelData = jovoModelInstance.exportJovoModel();\n```\n\n#### Platform Schema A to Platform Schema B\n\nYou can also use the package to turn one platform schema into another, e.g. Alexa into Dialogflow:\n\n```javascript\nimport { NativeFileInformation } from '@jovotech/model';\nimport { JovoModelAlexa } from '@jovotech/model-alexa';\nimport { JovoModelDialogflow } from '@jovotech/model-dialogflow';\n\nconst locale = 'en-US';\n\n// Convert Alexa Model -\u003e Jovo Model\nconst jovoModelInstanceAlexa = new JovoModelAlexa();\nconst alexaModelFiles: NativeFileInformation = [\n    {\n        path: [\n            'fileName.json',\n        ],\n        content: '...',\n    }\n];\njovoModelInstanceAlexa.importNative(alexaModelFiles, locale);\nconst jovoModelData = jovoModelInstanceAlexa.exportJovoModel();\n\n// Convert Jovo Model -\u003e Dialogflow Model\nconst jovoModelInstanceDialogflow = new JovoModelDialogflow();\njovoModelInstance.importJovoModel(jovoModelData, locale);\nconst dialogflowModelFiles = jovoModelInstance.exportNative();\n```\n\n### Updating the Model\n\nThe Jovo Model also allows to extract, manipulate, and delete data.\n\n```javascript\nimport { NativeFileInformation } from '@jovotech/model';\nimport { JovoModelDialogflow } from '@jovotech/model-dialogflow';\n\n// Load the data into the Jovo-Model\nconst jovoModelInstance = new JovoModelDialogflow();\nconst alexaModelFiles: NativeFileInformation = [\n    {\n        path: [\n            'fileName.json',\n        ],\n        content: '...',\n    }\n];\nconst locale = 'en-US';\njovoModelInstance.importNative(alexaModelFiles, locale);\n\nconst intent = jovoModelInstance.getIntentByName('MyNameIntent');\nconst phrases = jovoModelInstance.getPhrases(intent);\njovoModelInstance.removeIntent(intent);\n\n// Export updated model\n\n// As Jovo Model\nconst jovoModelData = jovoModelInstanceAlexa.exportJovoModel();\n\n// As Dialogflow Model\nconst dialogflowModelFiles = jovoModelInstance.exportNative();\n```\n\n\n## Contributing\n\nFeel free to add more NLU providers via pull requests. Each platform implements the following methods of the `@jovotech/model` core package:\n\n```javascript\n/**\n * Converts native model files to JovoModel\n *\n * @param {NativeFileInformation[]} inputFiles The files in the native format\n * @param {string} locale The locale of the files\n * @returns {JovoModelData}\n * @memberof JovoModel\n */\nstatic toJovoModel(inputFiles: NativeFileInformation[], locale: string): JovoModelData {\n    // ...\n}\n\n/**\n * Converts JovoModel to native model files\n *\n * @param {JovoModel} model The JovoModel to convert\n * @param {string} locale The locale of the JovoModel\n * @returns {NativeFileInformation[]}\n * @memberof JovoModel\n */\nstatic fromJovoModel(model: JovoModelData, locale: string): NativeFileInformation[] {\n    // ...\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjovotech%2Fjovo-model","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjovotech%2Fjovo-model","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjovotech%2Fjovo-model/lists"}