Skip to main content

Tiny DSL to generate training dataset for NLU engines

Project description

Tiny DSL to generate training dataset for NLU engines. Based on the javascript implementation of chatl.

Installation

pip

$ pip install pychatl

source

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

or

$ pip install -e .

Usage

From the terminal

TODO

From the code

from pychatl import parse

result = parse("""
# pychatl is really easy to understand.
#
# You can defines:
#   - Intents
#   - Entities (with or without variants)
#   - Synonyms
#   - Comments (only at the top level)

# Inside an intent, you got training data.
# Training data can refer to one or more entities and/or synonyms, they will be used
# by generators to generate all possible permutations and training samples.

%[my_intent]
  ~[greet] some training data @[date]
  another training data that uses an @[entity] at @[date#with_variant]

~[greet]
  hi
  hello

# Entities contains available samples and could refer to a synonym.

@[entity]
  some value
  other value
  ~[a synonym]

# Synonyms contains only raw values

~[a synonym]
  possible synonym
  another one

# Entities and intents can define arbitrary properties that will be made available
# to generators.
# For snips, `type` and `extensible` are used for example.

@[date](type=snips/datetime)
  tomorrow
  today

# Variants is used only to generate training sample with specific values that should
# maps to the same entity name, here `date`. Props will be merged with the root entity.

@[date#with_variant]
  the end of the day
  nine o clock
  twenty past five
""")

Testing

$ cd tests/
$ python -m unittest -v

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-1.0.0.tar.gz (5.1 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: pychatl-1.0.0.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.22.0 CPython/3.6.6

File hashes

Hashes for pychatl-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e58a5592c4d373bb1e5d7b086fbfaba4fa9fd891e8a06c4687120c794ec016c0
MD5 2c6eb66bb6e5b2c877ebbe17f246c361
BLAKE2b-256 8492c2575c044088b2e5ab3fe4ed17e13fec00c62647d1f86e7ec7c94769c67b

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