MULTILINGUAL SEMANTIC MODELS
In this post I’ll discuss a model for learning word embeddings, such that they end up in the same space in different languages. This means we can find the similarity between some English and German words, or even compare the meaning of two sentences in different languages. It is a summary and analysis of the paper by Karl Moritz Hermann and Phil Blunsom, titled “Multilingual Models for Compositional Distributional Semantics“, published at ACL 2014. The Task
The goal of this work is to extend the distributional hypothesis to multilingual data and joint-space embeddings. This would give us the ability to compare words and sentences in different languages, and also make use of labelled training data from languages other than the target language. For example, below is an illustration of English words and their Estonian translations in the same semantic space.
This actually turns out to be a very difficult task, because the distributional hypothesis stops working across different languages. While “fish” is an important feature of “cat”, because they occur together often, “kass” never occurs with “fish”, because they are in different languages and therefore used in separate sets of documents.
In order to learn these representations in the same space, the authors construct a neural network that learns from parallel sentences (pairs of the same sentence in different languages). The model is then evaluated on the task of topic classification, training on one language and testing on the other.
A bit of a spoiler, but here is a visualisation of some words from the final model, mapped into 2 dimensions.
The words from English, German and French are successfully mapped into clusters based on meaning. The colours indicate gender (blue=male, red=female, green=neutral). The Multilingual Model
The main idea is as follows: We have sentence a in one language, and we have a function f(a) which maps that sentence into a vector representation (we’ll come back to that function). We then have sentence b , which is the same sentence just in a different language, and function g(b) for mapping it into a vector representation. Our goal is to have f(a) and g(b) be identical, because both of these sentences have the same meaning. So during training, we show the model a series of parallel sentences a and b , and each time we adjust the functions f(a) and g(b) so that they would produce more similar vectors.