dmt


Namedmt JSON
Version 1.5.8 PyPI version JSON
download
home_pagehttps://gitlab.com/waser-technologies/technologies/dmt
SummaryManage domains like packages.
upload_time2023-05-22 21:47:39
maintainer
docs_urlNone
authorDanny Waser
requires_python>=3.8,<3.12
licenseLICENSE
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Domain Management Tool

DMT (for short) is a collection of tools to manage your [RASA domains](https://rasa.com/docs/rasa/domain/) like if they were packages not unlike pip with python but with YAML for RASA.

## Installation

```zsh
pip install dmt
# Or using
#pip install git+https://gitlab.com/waser-technologies/technologies/dmt.git
```

## Usage

Use the `dmt` shortcut command.

```zsh
❯ dmt --help
usage: dmt [-h] [-v] [-l] [-c] [-a ADD] [-s] [-V] [-T] [-S]

Domain Management Tool

optional arguments:
  -h, --help         show this help message and exit
  -v, --version      output version information and exit
  -l, --list         list installed domains
  -c, --create       Create a new domain from template
  -a ADD, --add ADD  git repository hosting a domain to add
  -s, --sync         Synchronize all installed domains
  -V, --validate     Validate all installed domains
  -T, --train        Train new model from all installed domains
  -S, --serve        Serve the lastest model
  -L LANG, --lang LANG  language to work with (defaults to your system preference: $LANG)
```

Find a domain using the tag [#NLP Domains](https://gitlab.com/explore/projects/topics/NLP%20Domains).

And add it.

```zsh
dmt --add $domain_git_url
```

Now validate the domain's data with the installed ones.

```zsh
dmt --validate
```

This will generate some warnings but that is ok most of the time. Unless you made the domain, in which case you should act upon them.

As long as there is not any error you can train a new model using your data. This will take time and computing resourses.

```zsh
dmt --train
```

Or you could add, validate and train with a new domain in one line.

```zsh
dmt -V -T -a $domain_git_url
```

Once trained, you should be able to serve the latest model using the `dmt`.

```zsh
dmt --serve
```

Or by enabling its service.

```zsh
cp ./dmt.service.example /usr/lib/systemd/user/dmt.service
systemctl --user enable --now dmt.service
```

You can also import those tools from `python`.

```python
#!/usr/bin/env python3

from domain.management import tools as dmt
# Where are your domains installed?
INSTALL_PATH="/usr/share/assistant"

# install a new domain from a local repo
path_to_new_domain = "smalltalk" # git clone https://gitlab.com/waser-technologies/data/nlu/en/smalltalk.git ./smalltalk
domains_path = f"{INSTALL_PATH}/domains/en"
dmt.install_domain(tmp_domain, domains_path)

# Get list of installed domains
list_installed_domains = dmt.get_list_installed_domains(domains_path)

# Validate all domains combined
dmt.validate_data(INSTALL_PATH, domains="domains/en", data="data/en", config="configs/en/config.yml")

# Train new model on all domains
dmt.train_lm(INSTALL_PATH, domains="domains/en", data="data/en", config="configs/en/config.yml", models="models/en/NLU")

# Serve the new model
dmt.models_as_service()
```

## Creating your own domains

DMT allows you to quickly start a new domain from a template.

```zsh
dmt --create
```

Once hosted, you can use the `--add` flag to install your domain.

With python.

```python
from domain.management import tools as dmt

dmt.bake_cookie_domain(recipe_url="https://gitlab.com/waser-technologies/cookiecutters/nlu-domain-template")
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/waser-technologies/technologies/dmt",
    "name": "dmt",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.8,<3.12",
    "maintainer_email": "",
    "keywords": "",
    "author": "Danny Waser",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/31/95/dc840536feaf021c76d3e5ec55879a620510e8061ff6722364c664adb644/dmt-1.5.8.tar.gz",
    "platform": null,
    "description": "# Domain Management Tool\n\nDMT (for short) is a collection of tools to manage your [RASA domains](https://rasa.com/docs/rasa/domain/) like if they were packages not unlike pip with python but with YAML for RASA.\n\n## Installation\n\n```zsh\npip install dmt\n# Or using\n#pip install git+https://gitlab.com/waser-technologies/technologies/dmt.git\n```\n\n## Usage\n\nUse the `dmt` shortcut command.\n\n```zsh\n\u276f dmt --help\nusage: dmt [-h] [-v] [-l] [-c] [-a ADD] [-s] [-V] [-T] [-S]\n\nDomain Management Tool\n\noptional arguments:\n  -h, --help         show this help message and exit\n  -v, --version      output version information and exit\n  -l, --list         list installed domains\n  -c, --create       Create a new domain from template\n  -a ADD, --add ADD  git repository hosting a domain to add\n  -s, --sync         Synchronize all installed domains\n  -V, --validate     Validate all installed domains\n  -T, --train        Train new model from all installed domains\n  -S, --serve        Serve the lastest model\n  -L LANG, --lang LANG  language to work with (defaults to your system preference: $LANG)\n```\n\nFind a domain using the tag [#NLP Domains](https://gitlab.com/explore/projects/topics/NLP%20Domains).\n\nAnd add it.\n\n```zsh\ndmt --add $domain_git_url\n```\n\nNow validate the domain's data with the installed ones.\n\n```zsh\ndmt --validate\n```\n\nThis will generate some warnings but that is ok most of the time. Unless you made the domain, in which case you should act upon them.\n\nAs long as there is not any error you can train a new model using your data. This will take time and computing resourses.\n\n```zsh\ndmt --train\n```\n\nOr you could add, validate and train with a new domain in one line.\n\n```zsh\ndmt -V -T -a $domain_git_url\n```\n\nOnce trained, you should be able to serve the latest model using the `dmt`.\n\n```zsh\ndmt --serve\n```\n\nOr by enabling its service.\n\n```zsh\ncp ./dmt.service.example /usr/lib/systemd/user/dmt.service\nsystemctl --user enable --now dmt.service\n```\n\nYou can also import those tools from `python`.\n\n```python\n#!/usr/bin/env python3\n\nfrom domain.management import tools as dmt\n# Where are your domains installed?\nINSTALL_PATH=\"/usr/share/assistant\"\n\n# install a new domain from a local repo\npath_to_new_domain = \"smalltalk\" # git clone https://gitlab.com/waser-technologies/data/nlu/en/smalltalk.git ./smalltalk\ndomains_path = f\"{INSTALL_PATH}/domains/en\"\ndmt.install_domain(tmp_domain, domains_path)\n\n# Get list of installed domains\nlist_installed_domains = dmt.get_list_installed_domains(domains_path)\n\n# Validate all domains combined\ndmt.validate_data(INSTALL_PATH, domains=\"domains/en\", data=\"data/en\", config=\"configs/en/config.yml\")\n\n# Train new model on all domains\ndmt.train_lm(INSTALL_PATH, domains=\"domains/en\", data=\"data/en\", config=\"configs/en/config.yml\", models=\"models/en/NLU\")\n\n# Serve the new model\ndmt.models_as_service()\n```\n\n## Creating your own domains\n\nDMT allows you to quickly start a new domain from a template.\n\n```zsh\ndmt --create\n```\n\nOnce hosted, you can use the `--add` flag to install your domain.\n\nWith python.\n\n```python\nfrom domain.management import tools as dmt\n\ndmt.bake_cookie_domain(recipe_url=\"https://gitlab.com/waser-technologies/cookiecutters/nlu-domain-template\")\n```\n",
    "bugtrack_url": null,
    "license": "LICENSE",
    "summary": "Manage domains like packages.",
    "version": "1.5.8",
    "project_urls": {
        "Code": "https://gitlab.com/waser-technologies/technologies/dmt",
        "Documentation": "https://gitlab.com/waser-technologies/technologies/dmt/blob/main/README.md",
        "Homepage": "https://gitlab.com/waser-technologies/technologies/dmt",
        "Issue tracker": "https://gitlab.com/waser-technologies/technologies/dmt/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b08d055d1395f2366b10808a34e55238362857ef15af3eef188dc6fe59de8c73",
                "md5": "e9782e27c802578c85abffea2c0f797a",
                "sha256": "3348766e55ddbed8523103657733b11ace6951702e88bbc3c6de29c23428bf48"
            },
            "downloads": -1,
            "filename": "dmt-1.5.8-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e9782e27c802578c85abffea2c0f797a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8,<3.12",
            "size": 23256,
            "upload_time": "2023-05-22T21:47:38",
            "upload_time_iso_8601": "2023-05-22T21:47:38.646477Z",
            "url": "https://files.pythonhosted.org/packages/b0/8d/055d1395f2366b10808a34e55238362857ef15af3eef188dc6fe59de8c73/dmt-1.5.8-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "3195dc840536feaf021c76d3e5ec55879a620510e8061ff6722364c664adb644",
                "md5": "a803f608cb8ac5cebe651563fc71ad8b",
                "sha256": "2f48642671d71b6bbc106520796ada3bbfd2434e6be5cd85a08a185f43206aaf"
            },
            "downloads": -1,
            "filename": "dmt-1.5.8.tar.gz",
            "has_sig": false,
            "md5_digest": "a803f608cb8ac5cebe651563fc71ad8b",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8,<3.12",
            "size": 23444,
            "upload_time": "2023-05-22T21:47:39",
            "upload_time_iso_8601": "2023-05-22T21:47:39.986829Z",
            "url": "https://files.pythonhosted.org/packages/31/95/dc840536feaf021c76d3e5ec55879a620510e8061ff6722364c664adb644/dmt-1.5.8.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-05-22 21:47:39",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "waser-technologies",
    "gitlab_project": "technologies",
    "lcname": "dmt"
}
        
Elapsed time: 0.11051s