MathOverflow is a question and answer site for professional mathematicians. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Hi all,

I have two multi-dimensional vectors representing documents $\vec{a}$ and $\vec{b}$.

Considering cases where there is no overlap between $a$ and $b$ ($a \cap b = \emptyset $), traditional vector-distance measures do not work. For this reason I introduce a fuzzy measure between vector terms: $sim(t_{a},t_{b}) \in [0,1]$

This way I can compute the similarity matrix $M_{ab} |\vec{a}| \times |\vec{b}|$ with function $sim$. So I have the following elements:

  • vectors $\vec{a},\vec{b}$
  • matrices $M_{ab}$ representing the fuzzy similarity between all terms of the vectors

I would like to compute the distance between $a$ and $b$ in relation to $M$. A naive solution could consist of multiplying $a$ for the maximum element in each row of $M$ (columns for $b$)

$ sim(\vec{a},\vec{b}) = weights_a \cdot maxRows( M_{ab} )$

$ sim(\vec{b},\vec{a}) = weights_b \cdot maxColumns( M_{ab} )$

(as described in Corley, Courtney, and Rada Mihalcea. Measuring the semantic similarity of texts (June 30, 2005): 13-18.)

How would you compute the similarity between $a$ and $b$ in this context? Do you think that the Hungarian algorithm might give an alternative way of computing it?

Thanks for any hints!


share|cite|improve this question
up vote 0 down vote accepted

One direct method yhou could try the Semantic Matrix formulation, as given in "A semantic similarity approach to paraphrase detection" (Fernando and Stevenson, 2008). Basically their formulation gives the similarity between two vectors $a, b$ (presumably vocabulary vectors) as, $$sim(a,b) = \frac{a^t\mathbf{M_{ab}}b}{|a||b|}$$.

Note that this may not result in a 0-1 normed value, and if $\mathbf{M_{ab}}$ is identity this reduces to the cosine distance.

share|cite|improve this answer
I know it sounds ridiculous to say, but last night I had exactly the same idea that Fernando and Stevenson describe in their paper. I'm only 3 years late :-( – user17528 Dec 20 '11 at 11:55
Note that this construction is almoot identical to the construction that induces the Mahalanobis distance between two vectors, when M is positive definite. – Suresh Venkat Dec 22 '11 at 5:40

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.