A few weeks ago I was glued to my computer screen watching YouTube videos. I was watching an American TV game show called Jeopardy!. The contestants? Ken Jennings, the format's greatest historical champion; Brad Rutter, another undefeated colossus; and Watson, a black box with a glowing IBM logo.
Watson wiped the floor with them.
In 1997, the older folks saw Deep Blue beat Kasparov at chess, but that, while impressive, was pure mathematical brute force evaluating decision trees in a closed-rule environment. Watson's feat is a completely different league. Watson has understood jokes, puns, irony, and ambiguous clues in human natural language.
Why is NLP hell for a programmer?
To those of us who spend all day writing structured code, Natural Language Processing (NLP) seems like witchcraft. Programming languages have no ambiguities: an if is an if. But human language is chaotic. The sentence "La llama llama a la llama" makes sense in Spanish, but programming a machine to distinguish the animal, the verb, and the fire based on context is an absolute headache.
Watson doesn't "Google it". In fact, it played without an internet connection. It used the Apache UIMA (Unstructured Information Management Architecture) framework and a cluster network running Hadoop to process in parallel some 200 million pages of information (including the entirety of Wikipedia).
To understand how difficult this is at a basic level, the other day I was messing around with NLTK (Natural Language Toolkit) in Python. Just to identify the parts of a sentence (part-of-speech tagging), the machine has to do statistical juggling:
import nltk
# Un ejemplo clásico de ambigüedad en inglés
frase = "Time flies like an arrow; fruit flies like a banana."
# Tokenización: separamos las palabras
tokens = nltk.word_tokenize(frase)
# Etiquetado gramatical (Part-of-Speech tagging)
etiquetas = nltk.pos_tag(tokens)
for palabra, etiqueta in etiquetas:
# Imprime la palabra y si es Nombre (NN), Verbo (VB), etc.
print f"{palabra} -> {etiqueta}"
The script above struggles to understand that in the first half "flies" is a verb and in the second it's a noun. IBM Watson executes thousands of these types of algorithms simultaneously, generating multiple hypotheses, checking sources, and assigning a "confidence percentage" to each possible answer in less than three seconds. If the confidence exceeds a threshold, Watson hits the buzzer.
Reflection: The hardware barrier and the future
Watson's feat is quite possibly the greatest AI milestone of the last decade. It shows us that machines can actually come to "understand" our messy syntax.
However, there's a huge elephant in the room. To achieve this, IBM had to build a room-sized supercomputer made up of 90 IBM Power 750 servers, totaling 2880 processing cores and 16 Terabytes of RAM.
It's an inaccessible beast. As of today, advanced NLP is reserved for mega-corporations or universities. My big question is whether, thanks to Moore's Law and the advancement of cloud computing like Amazon EC2, one day we, the "everyday" developers, will have access to these marvels. For now, we have to keep fighting with simple regular expressions.