Written by Adrien Ball, Clément Doumouro and Joseph Dureau

The Snips Embedded Voice Platform allows any device manufacturer to build a Private by Design voice interface to their product. It handles Wakeword Detection, Speech Recognition, and Natural Language Understanding, fully on-device, so that none of your private voice data goes to the cloud. The Snips platform is also open for non-commercial use, for anyone who’d like to hack a voice assistant at home. With a Raspberry Pi 3, a microphone, and an hour of your time, you can start controlling your home by voice, keeping full control of your data!

Today, the Snips team is making an extra step to promote the use of privacy-preserving Artificial Intelligence: we are fully open sourcing Snips NLU, our Natural Language Understanding library.

Snips NLU has been developed with accuracy and footprint in mind. We wanted our embedded solution to yield similar or better performances as cloud-based NLU solutions (Dialogflow, Amazon Lex, etc). We also wanted it to run anywhere: not only on servers but also on tablets, mobiles, or any connected device. To achieve this, we had to completely rethink how to build an NLU engine, both in terms of engineering and machine learning. Let us introduce you to Snips NLU.

Natural Language Understanding

NLU engines are used to power any chatbot or voice assistant. Their objective is to identify the intention of the user (a.k.a intent) and the parameters (a.k.a slots) of the query. The developer can then use this to determine the appropriate action or response.

Let’s start by looking at a simple example, and see what you would expect from a good NLU engine. Consider the following dataset, used to train a simple weather assistant with a few query examples:

Give me the weather for [tomorrow](snips/datetime)

Show me the [Paris](location)'s weather for [Sunday](snips/datetime)

And a short list of cities:

Paris

New York

Deterministic behavior

The first thing you want is that all the examples you give to train the model are correctly supported by the engine. This makes the system predictable and easy to use: if a query is not correctly parsed, then add it to the dataset and it will work right away.

Generalization power

Having this deterministic behavior is great for robustness and predictability, but a powerful NLU engine also needs to have some generalization power. You want the system not only to recognize patterns provided in the training set, but also all the possible variations that come from speaking naturally. If we go back to the previous dataset, it is reasonable to expect the NLU engine to parse a query like: “What’s the weather in Beijing right now?” even though it is not part of the training examples.

Entity resolution

Lastly, you need something called Entity Resolution. Essentially, extracting the chunk “the third Sunday of March 2018” from the sentence “I need the weather for the third Sunday of March 2018” is a good first step. However, what you want to do next is call a weather API to get the weather, and there’s little chance that the API will accept raw dates strings as input. It will rather take a date in ISO format: 2018–03–18 . The later is referred to as the resolved value of the entity.

Dates and times are examples of entities that can be resolved. There are many others such as number, temperatures, durations etc. We call this special kind of entities Built-in Entities because the engine supports them natively without requiring the developer to provide examples for them (which is the case for custom entities). The list of built-in entities currently supported by Snips is available here, we plan to add more in the future.