Modifiers in Articulate

Handling single word replies and more!

Caleb Keller
Smart Platform Group
4 min readMar 9, 2020

--

Modifiers address a shortcoming in handling single word or concise responses. Words like cheese, pepperoni, yes, and no often get treated as entities. And in Articulate entities are found based on the context around them. Training a phrase like I want a cheese pizza provides Articulate with some context for identifying the word cheese as an entity. However, when you prompt the user what toppings they want and their reply is concise: cheese there is no larger sentence context. That is what makes single word replies challenging to handle.

Modifiers enable single word replies in Articulate.

Modifiers are trained in a very similar way to normal actions or intents. They turn single word entities into actions and leverage the full power of word vectors to identify entity values correctly.

For example, if you were building a pizza bot: modifiers could allow your user to add or remove toppings. Or, if you had already gathered the information for an order, modifiers could allow you to confirm the order before placing it.

Creating a Modifier

Modifiers do not get defined in the standard sayings list. They get managed inside the keyword they modify. For example, to create a modifier for the toppings keyword, one would go to the toppings keyword screen.

There are four types of modifiers: SET, UNSET, ADD, and REMOVE. These are pretty self-explanatory. Below are examples of what each of these would look like for toppings.

  • Set — Replace any existing values with new values.
  • Unset — Remove current slot values
  • Add — add a new value to the current slot values
  • Remove — Remove an existing value from the slot.

Using a Modifier

Once a modifier has been defined, there is nothing special that needs doing in the actions. Train your agent, and the modifiers should be available. Any action that uses a keyword with modifiers can immediately take advantage of those modifiers.

Static Values Modifiers

In the above modifiers, we used keyword values to fill slots. But sometimes, you may want a modifier to fill a slot with a static value. Static value modifiers got introduced to handle yes/no type questions but can certainly get used in other ways.

Below is what the creation of two modifiers with static values look like, meant to handle confirmation type questions.

Keyword modifiers often do not have other design considerations, but static value modifiers are often best paired with handlebars. Here is the definition of our Order Pizza action. Notice in the response we are responding a certain way when the slot value equals yes and a different way when the slot value equals no. The actual API call for ordering a pizza takes place in the Place Order action, chained to the first response, which only fires when the confirmation equals yes!

In this way, the combination of modifiers and action chaining allows deep and branching dialog.

Here’s a gist of the above agent if you want to import it into Articulate and see how modifiers work for yourself (it expects you to be running v0.31). If you’re ready to get started with Articulate download the latest release and docker-compose up and if you have any trouble, feel free to create an issue or join us on Discord.

--

--

Caleb Keller
Smart Platform Group

Mechanical Engineer turned Data Scientist turned Machine Learning practitioner. Focused on solving the problems of enterprise data, starting with how we can Do