Sitemap
Jacob Menashi

Jacob Menashi

Natural Language Processing

--

Or, “How Does That Brain In My Phone Know What To Do?”

Press enter or click to view image in full size

In just the last 8 years, the commercial usage and technology behind Voice-Activated Assistants has essentially exploded. Siri’s debut on the iPhone 4S in 2011 was a major milestone for the industry, and in the following years, with Amazon’s Alexa and Google Assistant joining the market, VAAs have only increased in popularity and importance. Literally billions of devices have a VAA on them nowadays, and although people don’t even always use them as much as intended — most Alexa users have only made one Amazon purchase while owning the device, for example — they certainly aren’t going to be losing any relevance anytime soon.

VAAs are incredibly complex technologies that definitely cannot be explained fully in a blog post, but I want to touch on one of the major components that all VAAs rely on: Natural Language Processing. NLP is essentially the middleman when it comes to the work VAAs do, sandwiched in-between the technology recognizing your speech and saying something back to you? NLP is there to answer the question of when you give a command to your phone or home device, how does it know what to do with what you’ve said? To me, there are three main components to that process.

Analyzing Intent

The first thing a VAA needs to do is figure out meaning within the speech it has process. When technologies like Siri were first starting out, this was one of the biggest barriers to overcome, specifically for one reason: human beings are super inconsistent when it comes to speech. If you’re setting a reminder on your phone, you could say “remind me to buy groceries tomorrow at 5 PM” or “please set a reminder for tomorrow at 5 PM to buy groceries”. To us, those two sentences don’t sound very different, but to a Voice-Activated Assistant, especially 7 or 8 years ago, those would be difficult to process as the same thing. Over time, VAAs were able to build up incredible amounts of data, stored on a Deep Neural Network (essentially a giant server in the cloud capable of processing that data), and use that data to interpret intent. The DNN could take in millions of phonemes, words, phrases, and sentences, and over time would grow to understand all the different ways humans say things. The more data these servers learned, the more unique a request the VAA could process, to the point where VAAs can figure out what you’re trying to say at a much higher rate of success.

Extracting Entities

Once the Voice-Activated Assistant understands what you’re trying to do with your words, it can move forward by taking the key parts of your command and turning them into entities. The entities are what the VAA can act on, the specific details of your statement that create a task. Kiran Krishnan’s blog on this subject helps break it down with the following diagram:

Source

The key things to focus on here are the “invocation name” and the “utterance”. The invocation name is the entity that directs the VAA to use a particular area of functionality. In this case it’s for Alexa’s horoscope capability, but it could also be a word like “alarm”, “reminder” (if you’re asking about a specific task) or “sports”, “weather” (if you need something on the information side). The utterance is breaking it down more specifically — now that the VAA knows where to look or where to perform the task, the utterance provides the information about how to complete the task.

Get Jacob Menashi’s stories in your inbox

Join Medium for free to get updates from this writer.

One cool thing that has evolved over time is the ability for VAAs to understand context. Kind of like the issues with understanding intent, in the early days you needed to include every component within your statement. Nowadays, if you say something like “set an alarm tomorrow”, your VAA will extract entities, but also understand that it’s missing an entity, and will ask you a follow-up question of what time to set the alarm.

Communicating With Applications

So now the Voice-Activated Assistant knows what you are trying to say and what it needs to do in order to complete your task — the final step it to actually do it! Once again, it all comes down to datasets. VAAs have so much information about correlating a request to a task that it knows how to delegate to different applications, regardless of it has the internal ability to process the task. For example, if you were to ask Siri a question about a movie review, the server that Siri is on doesn’t directly have that answer. However, Siri has access to the Rotten Tomatoes server, so it fires off a request there, and then presents that information back to you. The ability to seamlessly interact with outside applications and servers is crucial for VAAs to be useful, because they aren’t just for alarms and reminders, they’re for so much more!

--

--