Siri is, by far, my favourite recent addition to iOS. In an age when electronic devices keep getting smaller, faster, and thinner, the humble keyboard feels increasingly like a relic of a bygone era â€“ an era when computers were designed to occupy entire rooms instead of the palm of a hand. Appleâ€™s virtual assistant has changed the ways in which I interact with my mobile devices in a significant, if small, way.
Alas, Siri is frustratingly limited. Itâ€™s integrated well enough with Appleâ€™s own apps, as well as with services that the company decides to support, but itâ€™s otherwise nearly impossible to use with third-party software of any kind. Thatâ€™s disappointing, because in such a context it could be a game changer â€“ especially for people who have difficulty interacting with a normal keyboard because of a disability.
In an ideal world, Siri would be the primary way for me to interact with many aspects of my iPhone and iPad, and the keyboard would be available as a backup when needed. Iâ€™m sure plenty of developers would love to be able to take advantage of Siri, if only Apple would make it possible for them to do so. Unfortunately, the technology behind Siri makes that a significant challenge for the company.
There and back again
What we know as â€śSiriâ€ť is not just an app built into our phones and tablets, but rather a collection of software and internet-based services that Apple operates in cooperation with a number of partners. By keeping the majority of the functionality server-side, the company can offload much of the work to powerful computers rather than taxing the limited resources of its mobile devices; plus, Apple can use the data it collects to continuously improve the service and offer new functionality without having to release a new version of iOS.
When you issue Siri a command, your device is mainly responsible for collecting the sound of your voice and converting it into an audio file, which it then sends to Appleâ€™s data center for processing. This is not as trivial a task as it sounds â€“ youâ€™d be surprised at how much noise a microphone picks up, even when youâ€™re in what seems like a quiet environment. For this reason, Apple has been investing heavily in technologies that make that sound as clear as possible: Most recent iOS devices feature multiple microphones, along withÂ sophisticated hardwareÂ that analyses the micsâ€™ input to produce a signal scrubbed of most of its noise â€“ a cleaner signal requires less data to transmit and is easier to process.
Once it reaches Appleâ€™s servers, your audio file goes through a series of steps that progressively transform it into an action that a computer program can perform â€“ such as figuring out what the weather looks like. The output of that action is then transformed back into text that can be read to you in a natural way.
Recognition and context
The first of these steps consists of converting your spoken words into text â€“ a task that Apple reportedlyÂ delegates to voice recognition powerhouse Nuance. Siri does a remarkable job here: Even with my Italian accent â€“ â€śNoticeable,â€ť as a friend once told me, â€śbut youâ€™ll never be picked as the next voice of Marioâ€ť â€“ I find myself only rarely having to repeat a command.
However, Siriâ€™s success at understanding me is possibleÂ onlyÂ because it already â€śknowsâ€ť the words I am likely to speak: The service uploads your contacts and other data about you so that it can recognise the information later on with a good degree of accuracy. Apple has programmed Siri to understand all the terms that are required to fulfill the tasks it supports, based on the context in which they are presented.
Due to the vagaries of human languages, this is not a simple problem to solve even with the most advanced technology. For example, the wordsÂ byteÂ andÂ biteÂ sound exactly the same, but a restaurant-review app is more likely to use the latter, while software destined for a technical audience will more often employ the former. Confusing the two could lead to a dead-wrong interpretation of the resulting text: Nobody wants a few chips of RAM with their dark rye sandwich, but a computer has no concept of the absurd.
In order to allow third parties to take advantage of Siri, Apple would have to figure out a way for developers to â€śteachâ€ť the service about the specific terminology that their software is going to use, and the context in which it is going to be used. As you can imagine, this would be difficult even for simple apps and nearly impossible for others, particularly if theyÂ deal with complex conceptsÂ that do not lend themselves well to vocalisation.
From words to concepts
Once voice is turned into text, Siriâ€™s next job consists of understanding what the user is asking for, a process that relies on an area of science calledÂ natural language processing. If you thought voice recognition was difficult, this is many, many times harder, because humans have a nearly unlimited ability to express any given concept using endless combinations of words and they often say one thing when they really mean another.
To tackle this problem, a natural language system like Siri usually starts by attempting to parse the syntactical structure of a piece of text, extracting things like nouns, adjectives and verbs, as well as the general intonation of the sentences. That helps Siri determine, for example, whether the text is a question or whether the person is phrasing things in a way that sounds like they are upset or excited.
Assuming that the user has a passable command of their chosen language, this is usually a relatively easy problem to handle. The hard part comes when all those words have to be turned into some sort of actionable content that an app can process; to do this well,Â the system must have what is calledÂ domain knowledge â€“Â in other words, it must know the subject area youâ€™re talking about.
Youâ€™ve likely encountered a similar problem when asked to deal with a body of knowledge youâ€™re unfamiliar with: Your doctor, for example, may tell you that you need to be treated forÂ dyspepsia, but unless you are a medical professional, you probably wonâ€™t know that you just have indigestion and need an antacid or two. Apple would have to come up with a way for developers to explain to Siri what their apps can do and provide all the appropriate terminology for those actions.
Of all the parts that make up Siri, this natural language analysis is probably the toughest for developers to tackle, because apps differ greatly and itâ€™s hard to come up with a magic solution that can easily be applied to every possible situation. To make things worse, natural language analysis is not a familiar field for most programmers â€“ who, until now, have mainlyÂ beenÂ concerned with point-and-click (or point-and-tap) interfaces.
Putting results to text
Once a request has been processed, Siri must convert the result back into text that can be spoken to the user. While not as hard as processing a userâ€™s commands, this task, known asnatural language generation, still presents some challenges.
Itâ€™s relatively easy to write software that uses data to cobble together syntactically correct sentences, but, without some hard work, the result is likely to sound artificial and unexciting. When you ask Siri about the weather, for example, instead of just rattling out a list of statistics on temperature, pressure and cloud cover, the service will give you a generic comment, such as â€śItâ€™s sunnyâ€ť or â€śIt looks like rain.â€ť
ThisÂ touch of personalityÂ may seem unimportant, but it a makes a big difference to a user, particularly during verbal communication. Luckily, there is a well-definedÂ body of workÂ that puts this capability well within the reach of most app developers. Even better, there is no need for this final portion of the Siri experience to take place on the server side; instead, Apple could conceivably come up with a technology that standardises the creation of complex text and then leave it to the apps to produce a response directly on each device without unduly taxing resources.
Siri for everyone
Allowing third-party apps to integrate with Siri would be a boon for both developers and users, but itâ€™s going to require a lot of effort for everyone involved, in large part because it would represent a significant departure from the way we are used to designing and interacting with our software.
Still, itâ€™s fair to say that the company is quietly laying the groundwork for putting more and more Siri-like capabilities within the reach of every programmer, starting with Appleâ€™s ever-increasing investment in the back-end facilities that it needs to run Siriâ€™s complex infrastructure.
For example, dictation is now built into both of Appleâ€™s operating systems, though developers are not currently allowed to add their own specialised jargon to the vocabulary. Similarly, both OS X and iOS have recently acquired severalÂ programming interfacesÂ that can be used to analyse the syntax of a text document, although they do not help much in the much harder task of interpreting its meaning. Finally, Appleâ€™s software has long been adept at speech synthesis; right now this capability is used primarily by system tools likeÂ VoiceOverÂ and is off-limits to developers (at least on iOS), but it wouldnâ€™t take much work, from a technical perspective, to turn speech synthesis into a general-purpose tool that everyone could use.
Ultimately, the shift toward natural language interaction is all but inevitable and the keyboard, while not likely to disappear anytime soon, is going to become less and less relevant. The switch to a voice-based interface is going to be a hard one, with plenty of obstacles along the way; still, I look forward to the day when I will finally be able to stop typing on my devices and start communicating with them.
By Marco Tabini. Macworld