Designing and maintaining chatito takes time and effort, if it was usefull for you, please consider making a donation and share the abundance! :)
Chatito helps you generate datasets for training and validating chatbot models using a minimalistic DSL.
If you are building chatbots using commercial models, open source frameworks or writing your own natural language processing model, you need training examples. Chatito is here to help you.
This project contains the:
- Online chatito IDE
- Chatito DSL specification
- DSL AST parser in pegjs format
- Generator implemented in typescript + npm package
For the full language specification and documentation, please refer to the DSL spec document.
The language is independent from the generated output format and because each model can receive different parameters and settings, there are 3 data format adapters provided. This section describes the adapters, their specific behaviors and use cases:
Use the default format if you plan to train a custom model or if you are writting a custom adapter. This is the most flexible format because you can annotate
Intents with custom entity arguments, and they all will be present at the generated output, so for example, you could also include dialog/response generation logic with the dsl. E.g.:
%[some intent]('context': 'some annotation') @[some slot] ~[please?] @[some slot]('required': 'true', 'type': 'some type') ~[some alias here]
Custom entities like 'context', 'required' and 'type' will be available at the output so you can handle this custom arguments as you want.
Rasa NLU is a great open source framework for training NLU models. One particular behavior of the Rasa adapter is that when a slot definition sentence only contains one alias, the generated rasa dataset will map the alias as a synonym. e.g.:
%[some intent]('training': '1') @[some slot] @[some slot] ~[some slot synonyms] ~[some slot synonyms] synonym 1 synonym 2
In this example, the generated rasa dataset will contain the
synonym 1 and
synonym 2 mapping to
some slot synonyms.
Snips NLU is another great open source framework for NLU. One particular behavior of the Snips adapter is that you can define entity types for the slots. e.g.:
%[date search]('training':'1') for @[date] @[date]('entity': 'snips/datetime') ~[today] ~[tomorrow]
In the previous example, all
@[date] values will be taged with the
snips/datetime entity tag.
Chatito is supports nodejs
v8.11.2 LTS or higher.
Install it globally:
npm i chatito -g
npm i chatito --save
Then create a definition file (e.g.:
trainClimateBot.chatito) with your code.
Run the npm generator:
npx chatito trainClimateBot.chatito
The generated dataset should be available next to your definition file.
Here is the full npm generator options:
npx chatito <pathToFileOrDirectory> --format=<format> --formatOptions=<formatOptions> --outputPath=<outputPath>
<pathToFileOrDirectory>path to a
.chatitofile or a directory that contains chatito files. If it is a directory, will search recursively for all
*.chatitofiles inside and use them to generate the dataset. e.g.:
<formatOptions>Optional. Path to a .json file that each adapter optionally can use
<outputPath>Optional. The directory where to save the generated dataset. Uses the current directory as default.
Author and maintainer