Skip to content


The Natural Language Understanding unit is an object that transform a text message into a structured object. To be able to support different understanding systems, such as Kata internal Verstand system or system, the NLU concept is designed to be high-level and flexible.

Figure 1

We provide various kind of NLUs. For more information please refer to KataML Spec.


You can use process to post-process output of the NLU as described in following example:

First we will use VerstandClassifier NLU to extract label and score of a text.

  type: verstandClassifier
  ? options
  model: someModelId

We know that the output of verstandClassifier is string[], or null if no match found. Now we want to rename from snake-case to hyphenated case. So we create a method called hyphenate.

  hyphenate(labels): "
    if (!labels) return null;
    return => label.split("_").join("-");

Now we can add process into myNLU

  type: verstandClassifier
    model: someModelId
  process: hyphenate

Custom NLU

You can specify a custom NLU using method:

    type: method
    method: myNLUMethod
      regex: 'test (.*)'
      index: 1
  myNLUMethod(message,options,config): "
      let match = message.content.match(new Regex(options.regex));
      return match ? match[options.index || 0] : null;

Contributing to the Documentation

Is something missing/incorrect? Please let us know by contacting If you know how to fix it straight away, don’t hesitate to create a pull request on this documentation’s GitHub repository.