Wednesday, January 29, 2020

API: An Unsung Hero of Digital Revolution


Let us imagine that you want to develop a cool gadget, but you don’t have any idea about how to go about doing so. For example, you want to develop an Alexa or a Siri type of device. Someone with no programming background would think on the lines that I first need to learn programming and then I will learn how to do voice recognition and then I will learn how to do natural language processing. But it is actually much more simpler than that.

People without programming background are not entirely wrong thinking that, as During courses on computer science, these subjects are taught. I remember that as part of our course in computer graphics, we had learned how to draw a line, how to draw circle and other polygonal shapes. We had also learned various artificial intelligence algorithms some 15 years back. But I don’t remember ever using those even though I would have drawn many complex shapes on the screen, and I have used some AI algorithms without exactly knowing how they really worked.

How then all of that really works. It works similar to how we drive a car without knowing how does an internal combustion engine work. We know how to press accelerator, how to steer, how to change gears  and how to apply breaks. This process is so simple that it does not even require basic education.

In programming there is a similar role played by what is known as function. You provide the input to the function and it returns you the result of the computation. And a collection of such functions with well-known and stable interfaces could be called Application Programming Interface (API). Let us again take the example of a chat bot. There are many organizations that provide online and offline services such as LUIS from Microsoft, Hangouts Chat from google and Amazon Connect chat from who else, Amazon. You just need to choose programming language of your choice and download the code to call these interfaces and do some basic programming to send the voice that you capture from your device hardware using another set of API.

What an API does that it lets you and me, who have no idea how to do speech recognition and natural language processing, do these tasks as if we are experts. It also makes it possible to scale for those few who have perfected these technologies. Actually most of programming is about using various APIs to get the task done with very basic programming skills. That’s why many students who are right out of college are able to create AI based solutions. Actually we don’t even need college for that. I think, students who are around 10 to 12 year of age are capable of learning these technologies if they put their mind to it.

So whatever new algorithms are developed they can be made available through API to others who can put those algorithms in the service of their needs and develop amazing products for you and me. This makes me think that APIs are the unsung heroes of our digital revolution.

Thursday, January 23, 2020

How to Reach out to More Users with Inclusive Design

This post is about why user interface should be designed by keeping in mind needs of people with disabilities.
Natasha, a young HR executive was traveling to her home town with her fiancé for her wedding. Her wedding was just a week away and both of them had great plans for the future. But as fate would have it, they met with an accident colliding with a truck. Her fiancé died on the spot and Natasha suffered serious injuries. Upon awakening, she found herself in a hospital, and she realized that she would never be able to see again. Already crippled by the irreparable loss of her fiancé, she now had to deal with a new way of life and had no idea how to face this predicament.
This could happen to anyone of us, and such things do happen to more than a billion of us. In the United States alone, there are 74.6 million people with disabilities (Health, United States, 2012, table 48). Think about it, 1 sixth of us find it difficult to hear everyday conversations, watch this beautiful world, or do things independently. In short, many of us find it difficult to do things that most of us take for granted.
To understand some of the challenges faced by people with disabilities, let us consider following 3 thought experiments.
You are watching a movie, but the speakers are not working. You can see everything, but cannot hear a thing. This is how a deaf person experiences the world. It becomes a challenge even to carry on conversations with your friends and colleagues. Thanks to mobile texting, deaf persons can now carry on conversations with others although with difficulty.

Now imagine yourself watching a movie on a broken or distorted screen. This is how a blind person would experience the world. So you cannot read books, see pictorial depictions, and look at other visual things. you would find it difficult to obtain a book that you want to read because, until recently, printed books were the only format available. Though e-books have now begun to make a dent in this problem, only 5 percent of the books are available so far.
And imagine yourself in chains either handcuffed or in shackles. You would experience challenges in moving around and accomplishing simple tasks independently. awkward Instances like a woman having to attend to natures call in the open in presence of male colleagues occur only because of lack of accessible facilities.
So what should be done? Can we really work around such problems?
Digital technology has opened doors for various people with disabilities. A person with hearing difficulties can communicate with others using SMS and emails, a person with blindness can use a software that can read out information in computer and Mobile phones, and a person with physical difficulties could work effectively if his or her environment is barrier free.
But just because these technologies exist, does not mean that people with disabilities can work smoothly. Often designers of mainstream products do not realize that inadvertently they create barriers for some of their users. For example, In order to build a dazzling user interface, we often place a pretty picture replacing plain text. But pictures cannot be read out or resized, so such pictures become barrier for many people with disabilities. Let me be clear, I am not against a good looking interface, but we need to be aware of the consequences of our actions. So we need to provide an alternative to any information that is presented as a picture.
So you would say, I got it, but what am I supposed to do? And the answer is: the interface should be programmatic, not be dependent on one sense alone and there should be multiple ways of interacting with it. Oops! what is that? Let me explain.
As we discussed above, we can add  text material in 2 ways. we could just add the text, or add an image of the text. But there is a problem with adding an image. An image cannot be read without OCR, so image can only be useful for someone with sight alone, but text can also be read out with the help of a special software known as speech synthesizer, the types you see in science fictions. You might have come across speech synthesizer in your day to day life as well. in many mobile phones, the  name or number of the caller is announced by a synthesizer. So add a text instead of an image, and if you cannot avoid adding an image, describe that image using alternative text.
But accessibility is more than making the information available in text. Another aspect is to provide structure to the text as well. For example in web applications. A heading could be represented either by highlighting it visually  such as bold etc. or by using a heading tag. In the first option, a software cannot programmatically determine whether a bold text is a heading or not. So the better way would be to use h1…h6 tags. Similarly, you could arrange tabular text either with spaces or css, or with a table tag. As before, spaces and css  cannot be interpreted by the software to mean for tables, so tabular text should be mark-up with table tags. In case of applications on mobile devices or standard computer, using standard components makes your application easily accessible. If, however, you cannot use standard components, then you need to use accessibility API available for that platform. For example, UI Automation is a good accessibility API for windows.
Similarly, if your software can only be operated with the help of mouse, many people who depend on alternative ways such as keyboard or joystick, would not be able to use it. One advantage of making a software accessible with keyboard is that it can also be used by advance users, who are good with keystrokes.
Have you ever wondered why elder persons find it difficult to read a few websites or applications? With age, their eye sight deteriorates, so reading small print with colorful background becomes difficult. So resizable text with good contrast would be very helpful in such scenarios. Good contrast and resizing would also be useful for people with regular sight in unusual lighting conditions.
If the language of your user interface is simple, your software can be used by people with wider reading abilities as well. If there is an audio, there should be text alternative known as captions for people who cannot hear. In short, alternative presentation and alternative input mechanism should be provided to cater to broader needs and capabilities.
Accessibility is not just  something nice to do, it has economic rational as well. You can increase the number of users if your software is easier and accessible. Do you know that an iPhone can be used by a blind person, hearing impaired person or a person with mobility difficulties? Steve jobs could easily ignore accessibility in iPhone but he was not a person who would ignore such things. He cared to make it happen or the systems that he had setup at Apple made it happen, but what we learn from him, is to pay attention even for things that may evade an ordinary leader. iPhone has not only transformed mobile industry, but it has also transformed accessibility for people with disabilities. And that would have been one of the reasons for the success of Apple devices.
Let us return to Natasha’s story and see how she was enabled. One of her colleagues, who is blind, trained her on a software called a screen reader. Using this software, she could now Read and write emails, browse the web, and make PowerPoint presentations and more, as effectively as before the only difference being, she now listened to speech instead of looking at the screen. So when you design your software, make sure that you don’t create barriers for Natasha.
I have only highlighted a fraction of what needs to be done in order to make software accessible. So if you are motivated enough, you could start by looking at Web Content Accessibility Guidelines 2.0 (WCAG 2.0) for web applications. And Engineering Software for Accessibility, a book, by Microsoft Corporation for windows based applications. There are similar guidelines for IOS, Android, and other platforms. And yes, remember to get your applications tested by someone who is a person with disability.
Note: the story in this article is based on a real incident, but the name is changed to preserve the anonymity.