{ "info": { "author": "Collen Roller", "author_email": "collen.roller@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# Rasa Denerator\n\nA simple way of generating a domain.yml file for Rasa\n\n**Works with legacy versions of rasa || rasa 1.x!**\n\nDeveloped with Python 3.7.x\n\n## Installation\n\n```bash\n$ pip install rasa_denerator\n```\n\nAfter installation, the component can be used via command line or within a python script, we provide scenarios for both.\n\n## Usage\n\n### CLI\n\nThe example below will create a domain file from an actions module, nlu training data and templates\n\n```bash\n$ rasa_denerator -actions Rasa-Denerator/notebooks/denerator_tests/actions -f templates Rasa-Denerator/notebooks/denerator_tests/data -nlu Rasa-Denerator/notebooks/denerator_tests/data/nlu/nlu.md \n ```\n\n ```bash\nusage: rasa_denerator [-h] [-o OUTPUT] [-nlu NLU_FILE]\n [-actions ACTIONS_DIR] [-f TAG_FILES TAG_FILES]\n\nmerge disparate Rasa domain files to create or update a aggregated domain.yml\n\noptional arguments:\n -h, --help show this help message and exit\n -o OUTPUT, --output OUTPUT\n -o \n -nlu NLU_FILE, --nlu_file NLU_FILE\n -nlu \n -actions ACTIONS_DIR, --actions_dir ACTIONS_DIR\n -actions \n -f TAG_FILES TAG_FILES, --find TAG_FILES TAG_FILES\n -f \n ```\n\nThe script will output to the std.out unless an output file is specific. \n\nQueries can get quite complex. For example, you could specify the following:\n```bash\nrasa_denerator -actions Rasa-Denerator/notebooks/denerator_tests/actions \\ \n -f templates Rasa-Denerator/notebooks/denerator_tests/data \\\n -f slots Rasa-Denerator/notebooks/denerator_tests/data/ \\\n -nlu Rasa-Denerator/notebooks/denerator_tests/data/nlu/nlu.md \\\n -o domain.yml\n ```\n\n### Python\n\nIf you'd like to use the denerator within a python script, you can do that too!\n```python\nfrom rasa_denerator import RasaDenerator\n\nnlu_file = \"denerator_tests/data/nlu/nlu.md\"\nactions_dir = \"denerator_tests/actions/\"\ntag_dict = {\"templates\":\"denerator_tests/data/domain\", \"slots\": \"denerator_tests/data/domain\", \"entities\":\"denerator_tests/data/domain\"}\noutput_file = \"domain.yml\"\n\ndenerator = RasaDenerator(nlu_file = nlu_file, \n actions_dir = actions_dir,\n tag_dict = tag_dict,\n output = output_file)\ndenerator.generate_domain()\n\n```\n\n## Explanation\n\nCreating a domain.yml file currently is a tedious process within Rasa. Take this example below\n\nHere is a sample structure that your rasa project might look like right now.\n\n```\nyour_rasa_project\n\u2502 README.md\n\u2502 other stuff... \n\u2502\n\u2514\u2500\u2500\u2500data (This is where you store all your data)\n\u2502 nlu.md\n| domain.yml\n| \n\u2514\u2500\u2500\u2500actions (This is where your action.py lives for rasa_sdk)\n \u2502 __init__.py\n \u2502 actions.py\n | other_code.py\n```\n\nCurrently the developer must hand create the domain file using multiple assets from other files that already exists within other parts of the application. Here are some points below\n\n1. Entities and intents that are placed within training data files must be copied manually to a domain.yml file prior to training. \n2. Custom action names must be listed within the domain.yml file. Developers currently need to manually extract these names from their custom action classes everytime they add a new actions prior to retraining\n3. Templates are defined within the domain.yml file. These templates are utterances that can be returned to the user at certain trained points within the dialogue. Once these template utterances are defined, their identifies must be manually copied to the actions section of the domain.yml file.\n\nYou might have felt these pain points before...\n\nTo alleviate some pain, I created this tool to automatically generate a domain.yml file\n\n### Dev considerations: \n- Automatically generate intents based on intents listed within NLU training data\n- Automatically generate actions based on a valid actions module \n- Automatically aggergate forms, actions, slots, utterances listed within a specific directory recursivly\n- If NLU training data exists or Actions module exists, tags read in for entities, intents, actions, or forms are ignored\n- Make it command line version accessable\n- Make it easy to include within another script\n\n### A Better Layout\n\nInstead of hand creating these domain files and updating them constantly as you create new entities, intents, utterances, and actions consider the layout below. \n\n```\nyour_rasa_project\n\u2502 README.md\n\u2502 other stuff... \n\u2502\n\u2514\u2500\u2500\u2500data (This is where you store all your data)\n\u2502 \u2502\n\u2502 \u2514\u2500\u2500\u2500nlu\n\u2502 \u2502 nlu.md\n| |\n\u2502 \u2514\u2500\u2500\u2500domain\n\u2502 \u2502 templates_1.yml (file containing templates)\n| | templates_2.yml (file containing more templates...)\n\u2502 \u2502 slots_1.yml (file containing slots)\n| | slots_2.yml (file containing more slots...)\n\u2502 \u2502 entities.yml (file containing entities, these entities will take precedence over entities found in the nlu.md)\n\u2502 \u2502 intents.yml (file containing intents, these intent will take precedence over entities found in the nlu.md)\n| \n\u2514\u2500\u2500\u2500actions (This is where your action.py lives for rasa_sdk)\n \u2502 __init__.py\n \u2502 actions.py\n | other_code.py\n```\n\n#### Utterances\n\nAll utterance templates can be defined within a set of yml files. The script will automatically extract these templates and add them to a domain file as templates and registed actions. Additionally, the script will append these to registered utterances to the registered actions within the generated domain file. \n\n#### Entities and Intents\n\nEntities and intents will be extracted from the nlu.md training data file. This script uses Rasa's training_data functions to load and extract entities and intents. This allows us to accept markdown, json, etc. Entities and intents within the training data are extracted and placed into the output file.\n\nIf you want to hand-define entities and intents, thats fine too. Just create a folder or file that contains them and pass it to the script. \n\nNote: If a entities or intents are specified, they will take precidence over entities and intents identified within the nlu training data file.\n\n#### Actions\n\nMost Rasa users define custom actions. Copying these names from their respective classes and copying them into the domain file is currently tedious. The denerator fixes this my using rasa_sdk to load the repsective action module created by the user, extract the class names, and automatically add them to the domain file.\n\n## Tests\n\nAll unit tests are within the notebook file and can be run here. I prototyped all code within the notebook, all unit tests can be found there.\n\n## License \n\nMIT 2019\n\n## Questions\n\nContact me at collen.roller@gmail.com\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Collen-Roller/Rasa-Denerator", "keywords": "rasa,rasa_core,rasa_nlu", "license": "", "maintainer": "", "maintainer_email": "", "name": "rasa-denerator", "package_url": "https://pypi.org/project/rasa-denerator/", "platform": "", "project_url": "https://pypi.org/project/rasa-denerator/", "project_urls": { "Homepage": "https://github.com/Collen-Roller/Rasa-Denerator" }, "release_url": "https://pypi.org/project/rasa-denerator/1.0.4/", "requires_dist": [ "rasa (~=1.3)", "typing (==3.6.2)", "rasa-sdk (~=1.3)", "ruamel.base (==1.0.0)" ], "requires_python": "", "summary": "A simple way of generating a domain.yml file for Rasa", "version": "1.0.4" }, "last_serial": 5996704, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "d6ee1b026df6dd36fd0ba0f74de690a1", "sha256": "a427b3d4b7ecb125faf131a620f016323706b38edcb649f49535546692d18ad2" }, "downloads": -1, "filename": "rasa_denerator-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d6ee1b026df6dd36fd0ba0f74de690a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6935, "upload_time": "2019-08-11T21:04:38", "url": "https://files.pythonhosted.org/packages/71/35/f7916630e20d79e5b324c99de2af20f4277f62e92e75ce48c1f975f4cd83/rasa_denerator-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "5051e639cfdeddf7166d0783e1f259b8", "sha256": "bd2160a7e4c8ef377f7f6dd2807b8924e3ecae828e60dfb8afb1d64c44dd3da4" }, "downloads": -1, "filename": "rasa_denerator-1.0.1.tar.gz", "has_sig": false, "md5_digest": "5051e639cfdeddf7166d0783e1f259b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6898, "upload_time": "2019-08-14T21:27:18", "url": "https://files.pythonhosted.org/packages/b5/d8/543d056284627fabf0dbdb92f6065001375d1a29ae1d09d3d9fe3cc5c9ae/rasa_denerator-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "55d89c1a267236ba99e7044db3553992", "sha256": "a4bcafea35875a31cb269b8c0469f227a0ad3981f9e46603f26ba51ab0fa919b" }, "downloads": -1, "filename": "rasa_denerator-1.0.2.tar.gz", "has_sig": false, "md5_digest": "55d89c1a267236ba99e7044db3553992", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6904, "upload_time": "2019-08-20T14:51:01", "url": "https://files.pythonhosted.org/packages/00/1e/ebbd084baa701c6688af158edf889a9a421d83236bf09f9079c270ca0ef7/rasa_denerator-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "69cbd74d35fdcb398d45b577dbf3840d", "sha256": "763b166de9d1c3b085bc840ba842a46982b0bf7e025282aee55a02bb203c9b95" }, "downloads": -1, "filename": "rasa_denerator-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "69cbd74d35fdcb398d45b577dbf3840d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8465, "upload_time": "2019-09-21T02:31:13", "url": "https://files.pythonhosted.org/packages/c5/99/50dc4d0d1dcf84308f0f68c589ef1d6189b1c9994a5fae14c5dc345de33e/rasa_denerator-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dd5b34d43f2466d2d6fcc05f96368998", "sha256": "1e44e443f345cfc7c601f90f39fe056e699ac9fabd75cceef096d20768a0753f" }, "downloads": -1, "filename": "rasa_denerator-1.0.3.tar.gz", "has_sig": false, "md5_digest": "dd5b34d43f2466d2d6fcc05f96368998", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6920, "upload_time": "2019-09-21T02:31:16", "url": "https://files.pythonhosted.org/packages/12/81/b851d0ec2fc67032384b53795da8b39ddc0e0acca71190b4abfa2bb8399b/rasa_denerator-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "e9fd3ac6d4e4761ef7df1dcea875c934", "sha256": "939f22ba640cc3cc0f777f9f03569eba4cb7ff81673e8d8a04c322f7ba650297" }, "downloads": -1, "filename": "rasa_denerator-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e9fd3ac6d4e4761ef7df1dcea875c934", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8485, "upload_time": "2019-10-18T17:32:16", "url": "https://files.pythonhosted.org/packages/0b/0e/df3e13f44a7011746a594f4bead63fab78d8431b27c2f36986fd350b66c7/rasa_denerator-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "42ab4e10567eb95a49470d88359d9f5a", "sha256": "f672d81838ad377556ce08aaff26fccdda6764b4d66cf313f19c8d181b041a52" }, "downloads": -1, "filename": "rasa_denerator-1.0.4.tar.gz", "has_sig": false, "md5_digest": "42ab4e10567eb95a49470d88359d9f5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6957, "upload_time": "2019-10-18T17:32:18", "url": "https://files.pythonhosted.org/packages/f9/b6/5025aca3d16d7ce9dcb380377e7d37fe0319a0aa28c20f80f104b27cd23b/rasa_denerator-1.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e9fd3ac6d4e4761ef7df1dcea875c934", "sha256": "939f22ba640cc3cc0f777f9f03569eba4cb7ff81673e8d8a04c322f7ba650297" }, "downloads": -1, "filename": "rasa_denerator-1.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e9fd3ac6d4e4761ef7df1dcea875c934", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8485, "upload_time": "2019-10-18T17:32:16", "url": "https://files.pythonhosted.org/packages/0b/0e/df3e13f44a7011746a594f4bead63fab78d8431b27c2f36986fd350b66c7/rasa_denerator-1.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "42ab4e10567eb95a49470d88359d9f5a", "sha256": "f672d81838ad377556ce08aaff26fccdda6764b4d66cf313f19c8d181b041a52" }, "downloads": -1, "filename": "rasa_denerator-1.0.4.tar.gz", "has_sig": false, "md5_digest": "42ab4e10567eb95a49470d88359d9f5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6957, "upload_time": "2019-10-18T17:32:18", "url": "https://files.pythonhosted.org/packages/f9/b6/5025aca3d16d7ce9dcb380377e7d37fe0319a0aa28c20f80f104b27cd23b/rasa_denerator-1.0.4.tar.gz" } ] }