similarity function

Compute similarity between word or document vectors