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.

Monday, February 18, 2019

How could We Use Google Assistant to Make Learning Fun

In my previous post, I discussed how my family is using Google Home to spend quality time together. We enjoyed so many things together such as listening to stories, playing trivia quiz, listening to jokes and host of other things. We could also ask for meaning for a word that we didn’t know, but my son didn’t want to proactively ask for meaning. I want him to learn better vocabulary, but the existing vocabulary quizzes are SAT level and he is in sixth grade.
So I wondered whether I could make a custom quiz for him. To my pleasant surprise google has made it very easy to create quiz either for personal consumption or for the world at large. Actually the official terminology is testing; there is no option labeled as personal consumption. The main point is that when you make it available for testing, it becomes available on devices associated with your account. So when you develop a quiz, you could test it on your own account. But who stops you to stay in testing mode for ever and keep modifying for your hearts content!
So how could we create a quiz? Like me, you would be thinking that it would require you to learn programming, or learn advance skills such as machine learning or artificial intelligence techniques or some amount of natural language processing. Well, all those things are used to create and run the quiz, but we don’t need to do that. Nice and smart folks at google have already done the hard work so that we could just use simple tools and enjoy the outcome.
We just need to create a Google sheet and the template of the sheet is also provided by google. There are 5 columns, first is the question column, second is the correct answer column, third and fourth are incorrect option columns, and fifth is the additional information which would be spoken with the correct answer. The comments in the google sheet also tell you that you could add additional columns for options but I didn’t try that.
If everything goes well, google will create your quiz and voila, you could run it in the device that is associated with your account. You could also publish it for the world, but I guess that would require many iterations before you would want to do that.
For detailed step by step instructions, visit the following guide: Build Actions for the Google Assistant (Level 1)

Friday, August 31, 2018

Making study material more inclusive for people with blindness: Learning from CFA Institute

In August 2018, I got the news that I have passed Chartered Financial Analyst (CFA) Level III exam. CFA is a very rigorous program consisting of 3 very intense exams. The content for these exams is heavily quantitative. It could be even more tough for a person with blindness as a blind person has to get the course material converted in a suitable format. But CFA institute made the course material accessible by making material available online and equations in math ML format. Yes, you guessed it right, I am a person with blindness myself.

To understand what I just said, it is important to know some background. Technology has made a huge difference for people with blindness. There is a special software that reads out information in computer or mobile devices. This software is known as screen reader. You can see these screen readers in mobile phones as Talkback in Android or Voiceover in iPhone. This technology is somewhat similar to a navigation system that informs the upcoming route. To be precise, a screen reader depends on two technologies. For speech, it uses what is known as speech synthesizer, and for Braille output, it uses Braille display.

Before screen readers, blind persons had to depend on one to one help such as a family member or  friend who would either read the books or record them. Some organizations working for people with blindness would record commonly used material. But such material would be only available for subjects that are studied widely, that too with great difficulty. Some organizations would also convert books in Braille, but since this is a laborious process, only limited books have been available and they are bulky.

Due to modern technology, blind persons can read electronic content, but not any content. A content has to be made available in a proper format. This format is known as e-Pub which is becoming more and more popular among publishers. But just making books available in e-pub may not solve the problem. For example, Some publishers might put images in the e-pub, but images are not readable through screen readers. In order to make it accessible, the material needs to be in plain text or HTML. For technical subjects that have equations such as mathematics and other math based subjects (Science, Technology, Engineering, or finance), a standard known as math ML should be used to specify equations. Math ML can be embedded in e-pub books.

The traditional methods such as recording or Braille books were not scalable, so very few people could benefit from them. The few lucky once were those who had support of a family or an organization. But if we make mainstream course material more accessible just as CFA institute did, we would be able to make many people with blindness independent. This does not mean that such material would only be available for someone with a screen reader only. The same accessible content would be readable through Braille using a special device known as Braille display which converts print to Braille instantly without requiring huge infrastructure. People can also use Braille printer to create Braille books from e-pub books.

With earlier methods, I often struggled to get material. Whereas with CFA material I didn’t need any help as content was properly formatted in text, and  All the equations were also formatted in math ML. The only help I needed was for understanding diagrams. It was easy to find a solution Even for this, I could print them and request anyone without any financial knowledge to trace the diagram with simple board and pen. This would raise the diagram in reverse and I could understand them. For this, I needed someone’s help only for a percent or 2 of the time.

Needless to say, CFA institute has shown a way forward for the empowerment of persons with disabilities through accessible course material. I wish other institutes could learn from CFA institute and become more inclusive.

Monday, July 30, 2018

Google Home review


This father’s day my son planned a surprise gift with the help of my wife. Both of them went out to the market and got me an amazing gift. I got Google Home as gift for the father’s day.

We were like kids with new toy! Initially we asked it to play various songs and it complied. We were so thrilled that we could say title of any song and it would invariably be able to recognize those songs. Interestingly, it understands various Indian names such as titles of songs in Hindi, Punjabi,  or Himachali. Not only songs, it also provides news if you just wish it good morning or ask directly. Google home can also provide weather updates, details of the songs played, complement you if you ask for it, and many other interesting things.

I also asked it for some financial terms and it could fetch the definitions from Investopedia. It can fetch definitions from Wikipedia and many other sources as well.

Then we discovered many other features such as spin the wheel in which google home comes up with funny comments, or fun facts, or lucky trivia which is a good way to spend time with a bunch of kids or grown up friends. It can also help in improving vocabulary. just ask for SAT vocabulary or GRE word games.

All that was so amazing but we discovered another gem in store for us.

My son asked my wife to tell him a story but after a couple of stories, she could not think of a story that he has not already heard. So she tried Google Home again. And low and behold, google home obliged her with a very nice story of a Golden Goose.

We can now spend quality time with our son listening to various short stories. And we are thankful to google to have created such an amazing product that helps us to have a story time even we may not remember so many stories. Well the truth is that parents often run out of stories no matter how hard they try. At time we read many story books but could not keep up with the demands of my son who always asks for more stories. He would want us to tell him 7 – 8 stories in any night. Though we may not be able to come up with more stories, Google home is able to do so with ease.

There are so many features that we discover every day that one blog post is not enough for that. Recently I asked for contact details for a shop near our home and it could fetch that as well. I also read that it can help with online shopping. Google home is going to revolutionize the way we live our online or offline lives.

Saturday, July 29, 2017

Making it easy to understand Indian budget 2017

Understanding any government budget can be daunting as the numbers involved are huge. Not only the numbers are so large, they are often presented with reference to different big numbers. For example, sometimes one number is reported as percentage of GDP (gross domestic product i.e. total output of a country in a year)and another number as either percentage of government expense or percentage of government revenue. I have decided to take these numbers as percentage of adjusted union budget. I am avoiding reference to the GDP as government only has control over the budget; GDP is not within its control. In order to prepare adjusted union budget, I have added back the state’s share of the union taxes which the budget subtracts as I thought adding it back will provide a better picture. So the total budget amount is Rs. 27 lakhs, 74 thousand 228 crores out of which 6 Lakhs 74 thousand 565 crores is states share which union budget excludes. Apologies for such large numbers, I promise I will not provide any such large number going forward at least in this post.

 

In the interest of understanding, I would try to avoid the exact numbers, rather I would round off to the nearest  whole number. Once we get the hang of the quantum of the amounts, we could always refer to the budget document For exact numbers. For more details refer to DISBURSEMENTS and RECEIPTS sheets of STATEMENT I - CONSOLIDATED FUND OF INDIA - REVENUE ACCOUNT for union Budget 2017.

 

Note: This post does not consider state’s revenue and expenses which are even larger than the union budget in aggregate. I will provide consolidated details in my next post.

 

So let us get started and consider as if the total union budget size is 100 rupees, then various expenses and income would be as under.

 

Starting with the government expenses, out of 100 rupees, 34 rupees are allocated for states and union territories, 25.5 for economic services, 19 for repayment of debt servicing, 16 for general services minus debt servicing, and 5.5 rupees for social services.

 

Going further about the details of the expenses: Out of 34 rupees allocated for states and union territories, 25 rupees are state’s share of the union taxes and 9 rupees are other grants for states and union territories. 19 rupees have to be set aside for repayment of the loan that the government takes every year to cover budget shortfall. That leaves the government with 47 rupees.

 

Out of 47 rupees, 31 rupees are allocated for social and economic services and 16 rupees are allocated for general services. Breaking down 5.5 rupees for social services, we find that 3 rupees are allocated for education and 2.5 rupees are allocated for other social services. Drilling down in to 25.5 rupees for economic services, we find that 7 rupees are allocated for agriculture, 2 rupees for rural development and irrigation, 7.5 rupees for transport including rail, shipping, road etc., 2.5 rupees for industry and minerals, 2 rupees for energy including petroleum, 1.5 for special area program for north east, 1 rupee for communication, 80 paisa for science and technology, and 70 paisa for general economic services.

 

Out of 16 rupees spent on general services, 6.5 rupees are allocated for defense, 5.5 rupees for pensions, 3 rupees for administrative services which includes police, 40 paisa for tax collection, and 30 paisa for organs of state which includes expense on administration of justice; elections; Parliament/State/Union Territory Legislatures; President, Vice President/Governor, Administrator of Union Territories; and council of ministers.

 

Note: the expense on organs of state is so less; even then, we fret a lot about it as it is visible to us. this is an example of availability bias.

 

Another expense which is noteworthy because we spend so little is administration of justice. As part of organs of state, the expense on judiciary is just 3 paisa. Should we still wonder that it takes 10 – 20 years to decide a case?

 

Where does the government find money to spend on the above items? First and the foremost source is commodities and service tax (which is now goods and services tax); it contributes 33 rupees. second source is non-tax revenue such as railway , communication, postal service and various other government operations; these contribute 20 rupees. Third source is corporate tax which contributes 19 rupees. And the last source is income tax other than corporate tax (mostly individuals) which contributes 16 rupees. That leaves the government with a shortfall of 12 Rupees, and for which the government borrows money every year. This borrowing has resulted in a debt of 2.5 times the total budget amount. The borrowing and the debt result in high inflation as government has to pay back less if value of money goes down.

 

The objective of this exercise has been to understand how the government earns money and how it spends. We will get in to more details in the future posts regarding various categories of these expenses.

Saturday, November 07, 2015

Possible origins of words Ganga, Goa, and Nagaland

once in a while in our life we get an opportunity to discover hidden jems. Such an opportunity is often fraught with a risk of being wrong as well because one could land on coincidental occurrence and not find any meaningful connection. I hope what I am going to explain is one such jem.

 

I think I found origin of 3 Indian names. These are Ganga, Goa, and Naga.

 

I know what you are thinking? “I know meaning of these words, what have you really discovered?

 

Let me give a background. I was reading the book Drunk Tank Pink by Adam Alter. The book is about hidden influences about names, labels, symbols and other things in our lives.

 

In this book, Adam Alter discusses an aboriginal tribe language in Australia known as Guugu Yimithirr. This language does not have words for left, right, behind, and in front, but instead it has words for North, East, South, and West. But what is interesting is names for these directions. Indians might be able to spot the connections of these words after reading the following text.

 

“In the early 1970s, anthropologist John Haviland discovered an unusual feature of the language spoken by the Guugu Yimithirr people of far north Queensland, in north-eastern Australia. The language had no words for directions like "left", "right", "in front of", or "behind", but instead the Guugu Yimithirr relied on the cardinal directions gungga (north), jiba (south), naga (east), and guwa (west).”

 

So the word for north in Guugu Yimithirr is Gungga which is quite close to Ganga and could actually be the same because pronunciation of Ganga in Hindi is close to Gungga. So you might ask what that’s got to do with the River Ganges? Gungga could mean a river that starts in the North? I don’t know if another association would have any meaning. The word gunung in Malay language means mountain. Could that be translated to the word Ganga or Gungga over the period of time? Then that word could mean a river that starts in the mountain? It is more plausible to connect a Malay language word to Indian context than Guugu Yimithirr a language of people situated across oceans thousands of miles away. But before we conclude, let’s look at other words.

 

The word for East in Guugu Yimithirr is Naga. Now is it just a coincidence that Nagaland is towards east of India? My cursory investigation on Google about the word Naga did not get me closer than this. The word Naga is associated with people of mountains, people associated with Nag (a Sanskrit word for snakes), or free men. I am more inclined to choose East, but I did not find any reference for that in my search.

 

The word for West in Guugu Yimithirr is Guwa. So there is another India centric or let’s call Delhi centric thought. How is it that Goa and Guwa are almost identical in Hindi or may be Sanskrit and Goa is towards west of India? In this case as well, my search on Google did not lead me to any meaning of Goa as being in the west. Meaning of Goa is most likely to be region of Caos (gomanta  in Hindi) as this Wikipedia page about the History of Goa suggests https://en.wikipedia.org/wiki/History_of_Goa.

 

The word for south in Guugu Yimithirr is Jiba. I could not find any place or river or mountain in south India similar to jiba, but I will keep searching.

 

So I wonder how come Guugu Yimithirr a language of People in Australia has words that are similar to 3 places in India? Is there a prehistoric connection? Before I conclude, I want to point out that we should not  assume these connections already exist, but I am only suggesting a possibility. There is a difference between a proof and a hypothesis.