Classical NLPNLP 08
Word Similarity
Words that appear in similar contexts tend to mean similar things. Here each word becomes a vector of the words found near it in the abstract sentences below, and two words are compared by the cosine of the angle between their vectors: 1 means the two words occur in contexts in the same proportions, 0 means they share none. As in the other panels, words are stemmed and stopwords removed; numbers are left out. Pick two words to compare them and see each word’s nearest neighbours. The sentences are fictional.
corpus (click to view or edit, one sentence per line)
The distributional hypothesis
The idea that words used in similar contexts have similar meanings goes back to Zellig Harris (1954) and J. R. Firth, who wrote in 1957 that “you shall know a word by the company it keeps”. It underlies every method on this page and the next, up to today’s language models.
Raw counts or PPMI
Raw counts are dominated by frequent words that appear everywhere. Pointwise mutual information (Church & Hanks, 1990) asks instead whether two words occur together more often than chance would predict; keeping only the positive values (PPMI) gives cleaner vectors. Compare the two with the weighting menu.
Limits
With 28 sentences the vectors are sparse and noisy; research systems count over millions of sentences. Such count-based vectors are closely related to word2vec on the next page: Levy & Goldberg (2014) showed that word2vec’s skip-gram model with negative sampling implicitly factorises a matrix of shifted PMI values.
References
- Harris, Z. S. (1954). Distributional structure. Word, 10(2–3), 146–162. doi.org/10.1080/00437956.1954.11659520
- Firth, J. R. (1957). A synopsis of linguistic theory, 1930–1955. In Studies in Linguistic Analysis (pp. 1–32). Oxford: Philological Society.
- Church, K. W., & Hanks, P. (1990). Word association norms, mutual information, and lexicography. Computational Linguistics, 16(1), 22–29. aclanthology.org/J90-1003
- Turney, P. D., & Pantel, P. (2010). From frequency to meaning: vector space models of semantics. Journal of Artificial Intelligence Research, 37, 141–188. arxiv.org/abs/1003.1141
- Levy, O., & Goldberg, Y. (2014). Neural word embedding as implicit matrix factorization. Advances in Neural Information Processing Systems 27. papers.nips.cc