Word and sentence embeddings
Problems
- Sentence embedding
Map a sentence or a short text to one fixed-size vector so that the cosine of two vectors reflects the semantic similarity of the two texts.
core - Word analogy
Solve a is to b as c is to what, by the word whose vector is closest to b - a + c, a common test of word embeddings.
core - Word sense disambiguation
Choose the intended sense of an ambiguous word in context from a fixed inventory of senses, such as the WordNet synsets of the word.
core
Algorithms
- Lesk algorithm
Choose the sense whose dictionary gloss shares the most words with the context of the ambiguous word.
1 languagesintro - Brown clustering
Greedy agglomerative clustering of words that merges the two classes whose merge least lowers the mutual information of a class bigram model.
1 languagescore - GloVe
Fit word and context vectors whose dot product plus biases matches the log co-occurrence count, by weighted least squares on nonzero counts.
1 languagescore - Hearst patterns
Extract hyponym and hypernym pairs from text with six hand-chosen lexico-syntactic patterns, such as X such as Y and Y and other X.
1 languagescore - Yarowsky algorithm
Semi-supervised sense disambiguation that grows a decision list from a few seed collocations using one sense per discourse and one sense per collocation.
1 languagescore - Cross-lingual embedding mapping
Learn a linear, often orthogonal, map from the embedding space of one language to another from a seed dictionary, solved in closed form by SVD.
1 languagesadvanced - Hard debiasing of word embeddings
Find a bias direction by PCA of differences such as he - she, remove it from neutral words, and equalize pairs of gendered words about it.
1 languagesadvanced - Retrofitting
Post-process word vectors so that words linked in a lexicon such as WordNet move closer, by iterative updates that also keep each near its original.
1 languagesadvanced - Smooth inverse frequency embedding
A sentence vector as the weighted mean of its word vectors with weights a / (a + p(w)), minus its projection on the first principal component.
1 languagesadvanced - Subword information skip-gram
Skip-gram in which a word vector is the sum of the vectors of its character n-grams, so rare and unseen words still get vectors.
1 languagesadvanced - Word embedding association test
Measure bias in embeddings by the difference of mean cosine similarities of two target word sets to two attribute sets, with a permutation test.
1 languagesadvanced - Word mover's distance
The distance between two documents as the minimum cost to move the word embeddings of one to those of the other, an earth mover's distance.
1 languagesadvanced - SimCSE
Train sentence encoders by a contrastive loss in which the positive for a sentence is the same sentence passed again under a new dropout mask.
1 languagesresearch
Techniques
- Hierarchical softmax
Replace the softmax over V words by the product of the binary logistic decisions on the path to the word in a binary tree. A balanced tree has paths of length at most ceil(log2 V).
1 languagescore - Negative sampling
Train word vectors by logistic loss that tells observed word-context pairs from k random pairs drawn from a smoothed unigram distribution.
1 languagescore - Cross-domain similarity local scaling
Retrieve translations by cosine similarity minus the mean similarity of each word to its k nearest neighbours, which reduces hubness.
research
Concepts
- Distributional hypothesis
Words that occur in similar contexts tend to have similar meanings, so the contexts of a word can stand for its meaning.
intro - Contextual word embedding
A vector for each occurrence of a word computed from the whole sentence by a deep network, so one word gets different vectors in different senses.
core
Definitions
- Pointwise mutual information
PMI(x, y) = log P(x, y) / (P(x) P(y)), the log ratio of how often two events occur together to how often they would if independent.
intro - Word embedding
A map from each word of a vocabulary to a dense real vector, usually of 50 to a few hundred dimensions, fit from text so that words used alike lie close together.
intro - Word-context matrix
The matrix whose entry (w, c) counts how often word w occurs near context c in a corpus, the raw material of count-based word vectors.
intro - Positive pointwise mutual information
PPMI(w, c) = max(PMI(w, c), 0), which drops unreliable negative values and makes a sparse word-context weighting that works well for similarity.
core - Resnik similarity
The similarity of two concepts in a taxonomy as the information content -log P(c) of their most informative common subsumer.
core
Theorems
- SGNS as implicit matrix factorization
If every dot product w . c is free, the best skip-gram with k negative samples has w . c = PMI(w, c) - log k, so it factorizes a shifted PMI matrix.
advanced
Models
- Continuous bag-of-words model
A word2vec model that predicts the center word of a window from the sum or mean of the vectors of the words around it.
1 languagescore - Skip-gram model
A log-linear model that predicts each word in a window around a word from that word's vector. Its learned input vectors are word embeddings.
1 languagescore - ELMo
Contextual word vectors taken as a learned weighted sum of the layers of a deep bidirectional LSTM language model trained on a large corpus.
advanced - Paragraph vector
Le and Mikolov's model that learns a vector per document jointly with word vectors, by predicting the words of the document from it.
advanced - Sentence-BERT
A siamese BERT encoder with mean pooling, fine-tuned on sentence pairs so that the cosine of two pooled vectors scores semantic similarity.
research