Wednesday, August 31, 2016

Understanding Google Translate: Statistical Analysis and Quality Variance

Many of us at some point in our lives have turned to Google to translate words, sentences, or maybe even our homework, from one language to another, and have received results - to varying degrees of accuracy - in the blink of an eye. 

Google Translate accomplishes this feat using a process called “statistical machine translation,” which involves methods that are central to computer science. 

The process starts with an input - the phrase or word that you would like translated. In the normal computing process, the central processing unit would receive this input, and then request and write to and from its memory (cache, RAM, Hard drive, etc.). Google Translate works similarly; however, the memory that it draws from is not a universal list of words and phrases in every language; instead, its memory consists of an extensive record of millions of documents on the internet that have already been translated, including books, documents from the UN, and websites. 

The algorithm that the software works with to produce its results involves a statistical computation. Every translated document is scanned and analyzed for statistically significant patterns, and once each pattern is identified, it is stored to be accessed as a reference pattern for future translations involving the specific language in which the document is written. Google Translate also uses the same algorithm when processing our input, comparing the pattern produced by your initial phrase to the patterns stored in the software's database. The more closely an input pattern matches a reference pattern, the stronger its correlation. To produce the final output, Google Translate simply chooses the translation with the highest correlation. Interestingly, every time a translation is made on Google, it is added to its database to be used as a reference pattern in the future, influencing the probability that the specific output translation will be made again. 
Because Google Translate interprets both inputs and outputs as patterns, there is a great tendency of your translation to become altered when adding or removing seemingly insignificant words. Each word changes the pattern that the software receives and interprets, which ultimately determines the content of your output. Not only does the content and syntax of your input impact the accuracy of your output, but also the languages that you are translating between. For relatively obscure languages, there are fewer documents available to serve as reference, and therefore fewer patterns for the software to analyze. Because of this, there is a high degree of variance in the accuracy of translation depending on the language, with such languages as English producing translations of high quality, and languages such as Igbo producing those of low quality. 

Still don't understand?

Check out the video below for a highly animated but highly informative explanation, by the one and only, Google. 




Image Source:
http://jess3.com/google-translate-video/

Video Source:
https://www.youtube.com/watch?v=_GdSC1Z1Kzs

Text Source:

The Automobile: Beneath the Body

Think of your vehicle. What comes to mind?
The last parking ticket you got, that you need to change your breaks, or the fact that you need to fill up your tank soon?

Rarely does the average person consider what’s going on under the hood, let alone the role that programming plays in continuously bringing your car to life. 

First, let’s start with the basics. Aside from the major mechanical architecture that your car is built on, automobiles are controlled electronically. The main electrical components of your car are the Electrical Control Units. These units are computers, set up in various locations throughout a vehicle, each programmed to control a certain area of the car, such as the engine, transmission, dashboard electronics, etc. They are comparable to the Central Processing Units (CPU) in normal PC's, in that their function is to receive inputs, process them, and then create outputs. 

Whereas the input methods we are familiar with include clicking with our mouse or typing with our keyboard, ECU’s are responsive to a variety of switches and sensors located throughout the vehicle, some of which we operate, and some of which operate automatically by responding to the mechanical and electrical system. Examples of these include the oxygen sensor, window and lock switches, and speed sensors, but in the image below, dozens more are shown, and all of which are ultimately processed by the electrical control units. 



Although these input methods are considerably different from those of a normal PC, the methods used to analyze and respond to them are identical. Information from sensors and switches located throughout the vehicle is transmitted to the ECU via the “Controller Area Network (CAN),” which is the system of wires and software protocols acting as the connective tissue between the two. In the figure below, the CAN (also referred to as CANbus) is highlighted in gray, and is connected to a variety of sensors and control units. Once an ECU receives inputs, taps into its memory, processes them, and then “decides” on an output according to its program, the CAN carries the information back to the designated architecture, where operations are performed instantly.



What is interesting about the ability of ECU’s to operate such complex machines in such a short amount of time is that compared to the Central Processing Unit in a PC, which has an average speed of 500-1000 MHz, the ECU’s average operation speed is only 40 MHz. And yet, the amount of memory storage that it draws from is less than 1 megabyte, as compared to 2 gigabytes (minimum) in a PC - thats about 2000x less! Although the numbers suggest a slower operation, the cause for the ECU’s instantaneous activity is simply that it is running on a highly efficient code.


So, the next time you watch an ultra savvy sports car cross the finish line in first place, just remember it was the programmer who won the race, not the driver. 



Image Sources: 

Text Sources: