Skip to main content

Tiny DSL to generate training dataset for NLU engines

Project description

Installation

pip

$ pip install pychatl

source

$ git clone https://github.com/atlassistant/chatl.git
$ cd chatl/python
$ python setup.py install

or

$ pip install -e .

Usage

From the terminal

usage: pychatl [-h] [--version] [-a ADAPTER] [-m MERGE] [--pretty]
             files [files ...]

Generates training dataset from a simple DSL.

positional arguments:
  files                 One or more DSL files to process

optional arguments:
  -h, --help            show this help message and exit
  --version             show program's version number and exit
  -a ADAPTER, --adapter ADAPTER
                        Name of the adapter to use
  -m MERGE, --merge MERGE
                        Options file to merge with the final result
  --pretty              Pretty output

From the code

from pychatl import parse

result = parse("""
%[get_forecast]
  will it rain in @[city] @[dateStart]

~[new york]
  ny
  nyc

@[dateStart](type=snips/datetime)
  at the end of the day
  tomorrow
  today

@[city]
  ~[new york]
  paris
""")

# Now you got a parsed dataset so you may want to process it for a specific NLU engines

from pychatl.adapters import snips

snips_dataset = snips(result) # Or give options with `snips(result, language='en')`

# And now you got your dataset ready to be fitted within snips-nlu!

Testing

$ pip install -e .[test]
$ python -m nose --with-doctest --with-coverage --cover-package=pychatl

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pychatl-2.0.4.tar.gz (17.1 kB view details)

Uploaded Source

File details

Details for the file pychatl-2.0.4.tar.gz.

File metadata

  • Download URL: pychatl-2.0.4.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.20.1 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.3

File hashes

Hashes for pychatl-2.0.4.tar.gz
Algorithm Hash digest
SHA256 498e93ca2cf27d5c543d8e9ddb70b03f6fbb015d4b63f3118dc81e5e23ff5e2d
MD5 86b0f459314201bd77901d2945510122
BLAKE2b-256 453208915ce9a65bb3cb9f374c8eddbe46ad6d133d0b47e27466b3b9df9ad49b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page