Chapter 4
Chapter 4
Index
Abstract
Keywords
1 Introduction
2 Lexical Semantics
8.1 Architecture
11 Conclusion
12 References
Appendix A: Mathematical Derivations
Glossary
Abstract
This chapter provides a rigorous treatment of representation learning in Natural Language Processing (NLP),
spanning both count-based vector semantics and neural network-based approaches. The exposition begins with
lexical semantics, establishing foundational notions of word meaning, synonymy, similarity, and the distributional
hypothesis that underpins modern distributional semantics. Vector space models are constructed via term-
document and term-term matrices, with formal derivations of TF-IDF weighting and cosine similarity as the
primary similarity metric. Pointwise Mutual Information (PMI) and its positive variant (PPMI) are introduced as
association measures superior to raw counts. The chapter then develops Word2Vec's Skip-Gram architecture,
formulating embedding learning as a binary classification task that distinguishes true context words from noise
samples. The transition to neural networks covers computational units with nonlinear activations, the XOR
problem as motivation for hidden layers, and feedforward network architectures for text classification. Training
procedures including cross-entropy loss, stochastic gradient descent, and error backpropagation via computation
graphs are presented with mathematical precision. The chapter culminates with feedforward neural language
models that learn to predict the next word while simultaneously acquiring useful word representations.
Keywords
Vector Semantics; Distributional Hypothesis; TF-IDF; Cosine Similarity; Pointwise Mutual Information; PPMI; Word
Embeddings; Word2Vec; Skip-Gram; Negative Sampling; Neural Networks; Activation Functions; Feedforward
Networks; Softmax; Cross-Entropy Loss; Backpropagation; Computation Graphs; Neural Language Models
1 Introduction
This section establishes the motivation for learning vector representations of words and provides an overview of
the chapter's structure.
The solution developed in this chapter relies on the insight that word meaning can be inferred from usage
patterns. Words that appear in similar contexts tend to have similar meanings—a principle known as the
distributional hypothesis. This insight motivates the construction of vector representations where semantic
relationships manifest as geometric relationships in a vector space.
1. Count-based methods: Words are represented by vectors of co-occurrence counts (or weighted
transformations thereof) with other words or documents. These methods are transparent and interpretable
but yield sparse, high-dimensional vectors.
2. Prediction-based methods: Dense, low-dimensional vectors (embeddings) are learned by training neural
networks to predict words from their contexts. These methods produce representations that capture subtle
semantic and syntactic regularities.
The second half of the chapter introduces the neural network machinery required to understand prediction-based
embeddings and, more broadly, modern deep learning approaches to NLP.
Sections 2–4 develop count-based vector semantics, covering lexical semantics foundations, vector space
construction via term-document and term-term matrices, TF-IDF weighting, and cosine similarity.
Section 5 introduces Pointwise Mutual Information (PMI) as an association measure that addresses
limitations of raw co-occurrence counts.
Section 6 transitions to dense embeddings, presenting the Word2Vec Skip-Gram model and its training via
negative sampling.
Sections 7–9 provide a self-contained introduction to neural networks, covering computational units,
activation functions, feedforward architectures, and training via backpropagation.
Section 10 synthesizes the preceding material in the context of feedforward neural language models.
2 Lexical Semantics
This section introduces foundational concepts from lexical semantics that inform the computational treatment of
word meaning.
Lemmas and Wordforms. A lemma is a canonical form representing a set of inflected wordforms. For example,
the lemma sing encompasses the wordforms sing, sang, sung, and singing. Lemmas are typically what appear as
headwords in dictionaries.
Word Senses. A single lemma may have multiple distinct meanings, each called a sense. The word bank has at
least two senses:
A financial institution
The sloping land beside a body of water
Words with multiple senses are termed polysemous. The phenomenon of polysemy presents challenges for
computational models, as a single wordform may require different representations depending on context.
Synonymy. Two words are synonyms if they have the same meaning in some or all contexts. Perfect synonymy is
rare; most synonyms differ in nuance, register, or collocational preferences. For example, big and large are near-
synonyms but exhibit different usage patterns (big sister vs. ?large sister).
The formal criterion for synonymy is substitutability: two words are synonymous if substituting one for the other
preserves the truth conditions of any sentence.
Similarity. Words may be similar without being synonymous. Similarity is often defined via shared features or
taxonomic proximity. For instance, cat and dog are similar (both are mammals, pets, quadrupeds) but are not
synonyms.
Relatedness (Association). A broader notion captures words that co-occur or are thematically connected without
necessarily being similar. Coffee and cup are related but not similar—they belong to different semantic categories
but frequently co-occur.
These distinctions matter because different vector space models capture different aspects of meaning. Co-
occurrence-based models often capture relatedness (association), while taxonomic similarity requires additional
structure.
The hypothesis asserts that words occurring in similar linguistic contexts tend to have similar meanings. This
principle enables the inference of semantic properties from observable distributional patterns, without requiring
access to referents or world knowledge.
Formally, if w1 and w2 appear with overlapping sets of context words, we infer that w1 and w2 are semantically
related. The strength of this inference scales with the degree of contextual overlap.
Each row of M is a vector representation of a word, where dimensions correspond to documents. Words
appearing in similar documents will have similar row vectors.
battle 1 0 7 13
soldier 2 0 12 36
fool 37 58 1 5
crown 5 117 0 0
The vectors for battle and soldier are similar (high values for the history plays), while fool has a different
distribution (concentrated in the comedies).
Limitations. Term-document matrices conflate topical similarity with semantic similarity. Documents on related
topics will induce similarity between words that co-occur with those topics, even if the words themselves are not
semantically related.
word i occurs in the context of word j . Context is typically defined by a window of ±k words around the target.
Each row is now a vector of length ∣V ∣, where dimensions correspond to context words. Words with similar co-
occurrence patterns will have similar vectors.
apricot 0 0 0 1 0 1
pineapple 0 0 0 1 0 1
digital 0 2 1 0 1 0
information 0 1 6 0 4 0
The vectors for apricot and pineapple are identical, reflecting their similar usage in contexts involving food
preparation (pinch, sugar). The vectors for digital and information are similar and distinct from the fruit words.
Raw term frequency tft,d is the count of term t in document d. To reduce the impact of very high frequencies, a
tft,d = {
1 + log10 (count(t, d)) if count(t, d) > 0
(3.1)
0 otherwise
Terms appearing in many documents are less informative for distinguishing documents. Let dft denote the
document frequency of term t (the number of documents containing t), and let N be the total number of
documents. The inverse document frequency is:
idft = log10 ( )
N
(3.2)
dft
Rare terms have high IDF; terms appearing in all documents have idf = 0.
N
v ⋅ w = ∑ vi w i (4.1)
i=1
However, the dot product is unbounded and scales with vector magnitude—longer vectors yield larger products
regardless of directional similarity.
Cosine similarity normalizes by vector lengths, measuring the cosine of the angle between vectors:
v⋅w ∑N
i=1 vi wi
cosine(v, w) = = (4.2)
∣v∣ ∣w∣
N N
∑i=1 vi2 ∑i=1 wi2
For non-negative vectors (e.g., count-based representations), cosine similarity ranges from 0 to 1.
Worked Example. Consider computing the similarity between apricot and digital using the term-term matrix from
Section 3.2:
vapricot = [0, 0, 0, 1, 0, 1]
vdigital = [0, 2, 1, 0, 1, 0]
Dot product:
The vectors are orthogonal—the words share no context words and are thus unrelated according to this
representation.
0+0+0+1+0+1 2
cosine(vapricot , vpineapple ) = = =1
2⋅ 2 2
1. Scale invariance: Cosine similarity is unaffected by vector magnitude. A word appearing twice as often in a
corpus does not become "more similar" to itself.
2. Sparsity handling: In high-dimensional sparse vectors, most dimensions are zero. Euclidean distance is
dominated by these zeros, while cosine focuses on the dimensions where both vectors have non-zero values.
3. Interpretability: The angular interpretation provides geometric intuition—similar words cluster in similar
directions from the origin.
This section introduces PMI and PPMI as association measures that address limitations of raw co-occurrence
counts.
Pointwise Mutual Information (PMI) measures the discrepancy between the observed co-occurrence probability
and the probability expected under independence:
P (w, c)
PMI(w, c) = log2 (5.1)
P (w)P (c)
where:
Interpretation:
PMI > 0: The words co-occur more often than expected under independence (positive association)
PMI = 0: Co-occurrence matches the independence expectation
PMI < 0: The words co-occur less often than expected (negative association, or avoidance)
1. Unreliability: Reliably estimating that two words avoid each other requires observing their absence of co-
occurrence across a large corpus. Such estimates are noisy.
2. Sparsity: Most word pairs never co-occur, yielding PMI = −∞ (since log 0 = −∞).
The standard solution is Positive PMI (PPMI), which clamps negative values to zero:
P (w, c)
PPMI(w, c) = max (log2 , 0) (5.2)
P (w)P (c)
PPMI matrices are sparse and non-negative, making them suitable for cosine similarity computations.
cherry 0 0 0 5 10
strawberry 0 0 0 3 8
digital 10 20 5 0 0
information 15 25 10 0 0
Total count: N = 0 + 0 + 0 + 5 + 10 + 0 + 0 + 0 + 3 + 8 + 10 + 20 + 5 + 0 + 0 + 15 + 25 + 10 +
0 + 0 = 111
15 11 35 50
P (cherry) = , P (strawberry) = , P (digital) = , P (information) =
111 111 111 111
25 45 15
P (computer) = , P (data) = , P (result) =
111 111 111
8 18
P (pie) = , P (sugar) =
111 111
10
P (cherry, sugar) =
111
0
P (digital, sugar) = =0
111
25
P (information, data) =
111
Observation: PPMI assigns high values to word-context pairs that co-occur more than expected (cherry-sugar:
2.04), moderate values to expected associations (information-data: 0.30), and zero to pairs that never co-occur
(digital-sugar: 0).
6 Word Embeddings
This section transitions from sparse, count-based representations to dense, learned embeddings.
1. High dimensionality: Vectors have ∣V ∣ dimensions, where vocabulary sizes can reach hundreds of
thousands.
2. Sparsity: Most entries are zero, wasting storage and computational resources.
3. Limited generalization: The representation cannot leverage similarity between context words.
Word embeddings address these issues by representing words as dense vectors of much lower dimensionality
(typically 50–300 dimensions). These representations are learned from data such that:
Similar words receive similar embeddings
Semantic and syntactic regularities emerge as algebraic relationships
The term "embedding" reflects that words are embedded as points in a continuous vector space.
The key insight is that rather than counting co-occurrences explicitly, we train a model whose parameters encode
the same distributional information implicitly. The trained parameters become the word embeddings.
Skip-Gram Objective. Given a target word w and a context word c, the Skip-Gram model learns to estimate:
P (c ∣ w) (6.1)
For a window of ±L words, the model predicts each context word independently:
1
P (+ ∣ w, c) = σ(c ⋅ w) = (6.3)
1 + e−c⋅w
Training Setup:
2. Negative examples: (w, cneg ) pairs where cneg is sampled randomly, labeled −
Loss Function. For a single training instance with target w , positive context cpos , and k negative samples
cneg1 , … , cnegk :
k
L = − [log σ(cpos ⋅ w) + ∑ log σ(−cnegi ⋅ w)]
(6.4)
i=1
count(w)α
Pα (w) = (6.5)
∑w′ count(w′ )α
where α = 0.75 is typical. This raises the probability of rare words relative to uniform sampling while still
favoring frequent words.
k
∂L
= [σ(cpos ⋅ w) − 1] cpos + ∑ σ(cnegi ⋅ w) cnegi (6.6)
∂w
i=1
∂L
= [σ(cpos ⋅ w) − 1] w (6.7)
∂cpos
∂L
= σ(cnegi ⋅ w) w (6.8)
∂cnegi
∂L
w(t+1) = w(t) − η (6.9)
∂w
∂L
c(t+1) = c(t) − η (6.10)
∂c
After training, the target embedding matrix W is typically used as the word embedding matrix. Alternatively, W
and C can be summed or concatenated.
This suggests that the vector offset vking − vman encodes a gender-neutral "royalty" concept.
These properties emerge from the training objective without explicit supervision for analogies.
Racial biases: African American names cluster with negative sentiment words
These biases can propagate to downstream applications (e.g., resume screening, sentiment analysis). Research on
debiasing embeddings seeks to identify and mitigate these effects while preserving useful semantic information.
Implications. The presence of bias in embeddings is a reminder that distributional semantics captures usage
patterns, not normative meaning. Models trained on biased text will learn biased representations.
Given an input vector x = [x1 , x2 , … , xn ]T , weight vector w = [w1 , w2 , … , wn ]T , and bias b, the unit
computes:
n
z = w ⋅ x + b = ∑ w i xi + b (7.1)
i=1
y = f (z) (7.2)
where f is the activation function and y is the unit's output.
The bias b allows the unit to shift its activation threshold. Without bias, the decision boundary must pass through
the origin.
Sigmoid. The sigmoid function squashes real values to the range (0, 1):
1
σ(z) = (7.3)
1 + e−z
Properties:
σ(z) → 1 as z → +∞
σ(z) → 0 as z → −∞
σ(0) = 0.5
Derivative: dσ
dz = σ(z)(1 − σ(z))
Sigmoid is used for binary classification outputs but suffers from the vanishing gradient problem: gradients
approach zero for large ∣z∣, slowing learning.
Hyperbolic Tangent (tanh). Tanh maps inputs to the range (−1, 1):
ez − e−z
tanh(z) = (7.4)
ez + e−z
Tanh is zero-centered, which can improve gradient flow. It is related to sigmoid by:
Derivative: d tanh
dz
= 1 − tanh2 (z)
Rectified Linear Unit (ReLU). ReLU is the most widely used activation in modern deep learning:
Derivative:
={
dReLU 0 if z < 0
(7.7)
1 if z ≥ 0
dz
ReLU advantages:
x1 x2 x1 XOR x2
0 0 0
0 1 1
1 0 1
1 1 0
No single line can separate the + class (where output is 1) from the − class. XOR is not linearly separable.
Solution: Multi-Layer Networks. Adding a hidden layer between input and output creates a two-layer network
that can represent XOR.
Input layer: x1 , x2
Output: y = σ(h1 + h2 − 1)
The hidden layer transforms the input space such that the output becomes linearly separable.
Universal Approximation. A feedforward network with a single hidden layer containing enough units can
approximate any continuous function to arbitrary precision (Cybenko, 1989). This theoretical result motivates the
use of hidden layers for modeling complex functions.
8.1 Architecture
A feedforward neural network (also called a multi-layer perceptron or MLP) consists of:
In a fully connected (dense) network, every unit in layer l connects to every unit in layer l + 1. Information flows
forward from input to output with no cycles.
h = g(z[1] ) (8.2)
The hidden layer learns an internal representation of the input that is useful for the task. These learned
representations are the "deep" features that give deep learning its power.
Dimensionality. If the input has n0 dimensions and the hidden layer has n1 units:
b[1] ∈ Rn1
h ∈ Rn 1
The hidden layer can expand (n1 > n0 ), compress (n1 < n0 ), or preserve dimensionality.
y^ = σ(w ⋅ h + b)
(8.3)
^∈
where y (0, 1) is interpreted as P (y = 1∣x).
z = Uh + b[2] (8.4)
exp(zk )
y^k = softmax(zk ) = (8.5)
K
∑j=1 exp(zj )
Softmax properties:
^k
Outputs sum to 1: ∑k y =1
^k
All outputs are positive: y >0
Exponential amplifies differences: larger zk receive disproportionately higher probability
^
The output y
= [y^1 , … , y^K ]T is a probability distribution over classes.
y^ = softmax(z)
(8.8)
Using Pre-trained Embeddings. For text classification, the input x is often derived from word embeddings.
Common strategies:
The network learns weights that project the embedding space into a sentiment-predictive representation.
1∣x):
This loss:
Equals − log y
^ when y
= 1 (penalizes low confidence in positive class)
Equals − log(1 − y
^) when y
= 0 (penalizes high confidence in negative class)
Multi-class Cross-Entropy. For K classes with true label vector y (one-hot encoded) and predicted probabilities
y^:
K
LCE (y^, y) = − ∑ yk log y^k
(9.2)
k=1
where c is the index of the correct class. Minimizing cross-entropy is equivalent to maximizing the log probability
of the correct class.
Stochastic Gradient Descent (SGD). Computing the gradient over the entire training set is expensive. SGD
approximates the full gradient using a single example (or mini-batch):
SGD is noisy but computationally efficient and often escapes local minima.
B
1
θ (t+1)
=θ (t)
− η ∑ ∇θ L(x(i) , y (i) )
(9.6)
B i=1
Computation graphs enable systematic gradient computation via the chain rule.
d = 2b
e=a+d
L=c⋅e
The graph flows from inputs (a, b, c) through intermediate nodes (d, e) to output L.
For a = 3, b = 1, c = −2:
d=2
e=5
L = −10
9.4 Backpropagation
Backpropagation (backward differentiation) computes gradients by applying the chain rule from output to input
along the computation graph.
Chain Rule. For a composite function L = L(e(a, d), c) where e = a + d and d = 2b:
∂L ∂L ∂e
= ⋅ (9.7)
∂a ∂e ∂a
∂L ∂L ∂e ∂d
= ⋅ ⋅ (9.8)
∂b ∂e ∂d ∂b
Local Gradients. At each node, we compute the local gradient (derivative of output with respect to input):
For L = c ⋅ e:
∂L ∂L
= c, =e
∂e ∂c
For e = a + d:
∂e ∂e
= 1, =1
∂a ∂d
For d = 2b:
∂d
∂d
=2
∂b
Neural Network Backpropagation. For a neural network, the same principle applies. The computation graph
includes:
Loss computation
Sigmoid:
dσ(z)
= σ(z)(1 − σ(z))
(9.9)
dz
Tanh:
d tanh(z)
= 1 − tanh2 (z)
(9.10)
dz
ReLU:
={
dReLU(z) 0 z<0
(9.11)
1 z≥0
dz
Gradient with respect to output layer. For cross-entropy loss with softmax output and correct class c:
∂L
= y^k − yk (9.12)
∂zk
This elegant result simplifies implementation: the gradient is simply the difference between predicted and true
probabilities.
9.5 Practical Considerations
Several techniques improve training:
Weight Initialization. Unlike logistic regression, neural networks cannot be initialized with all zeros (all units
would compute identical gradients). Weights are initialized with small random values, typically drawn from:
2
N (0, )
nin + nout
where nin and nout are the input and output dimensions.
Dropout: Randomly set unit activations to zero during training with probability p
Dropout (Hinton et al., 2012) is particularly effective. During training, each unit is "dropped" with probability p
(typically 0.5). At test time, all units are used but outputs are scaled by (1 − p).
Learning rate η
Mini-batch size
Modern Frameworks. Deep learning frameworks (PyTorch, TensorFlow) automate gradient computation via
automatic differentiation. The user specifies the forward pass; gradients are computed automatically.
Like n-gram models, feedforward neural LMs approximate using a fixed context window:
P (wt ∣w1 , … , wt−1 ) ≈ P (wt ∣wt−N +1 , … , wt−1 )
(10.2)
Generalization via embeddings: Words with similar embeddings yield similar predictions
Continuous representations: No discrete probability tables
Disadvantages:
Less interpretable
Example. An n-gram model trained on "the cat gets fed" cannot predict "fed" after "the dog gets" without
observing that exact trigram. A neural LM, knowing that "cat" and "dog" have similar embeddings, generalizes
appropriately.
word.
1. Embedding lookup: Each context word is represented as a one-hot vector and multiplied by the embedding
matrix E ∈ Rd×∣V ∣ :
ei = Exi
(10.3)
h = g(We + b) (10.5)
z = Uh (10.6)
y^ = softmax(z)
(10.7)
(10.8)
Gradients are computed via backpropagation through the network, including into the embedding matrix E.
1. Frozen embeddings: Initialize E with pre-trained embeddings (e.g., Word2Vec) and do not update during
training. Only W, b, U are learned.
2. Fine-tuning: Initialize with pre-trained embeddings but continue updating E during training. This adapts
embeddings to the specific task.
Fine-tuning is generally preferred when sufficient training data is available. Freezing is useful for small datasets
where updating E risks overfitting.
N
1
PP(W ) = P (w1 , … , wN ) −1/N
= N
∏ (10.10)
P (wi ∣w1 , … , wi−1 )
i=1
Lower perplexity indicates a better model. Perplexity can be interpreted as the weighted average number of
choices the model considers at each position.
11 Conclusion
This chapter has developed the theoretical foundations for representing word meaning and learning from text
data.
Count-based methods construct word vectors from co-occurrence statistics. TF-IDF weighting and PPMI address
the bias toward frequent words, yielding sparse but interpretable representations. Cosine similarity serves as the
standard metric for comparing these vectors.
Word embeddings (Word2Vec, Skip-Gram with Negative Sampling) learn dense representations by training a
classifier to distinguish true context words from noise samples. The resulting embeddings capture semantic and
syntactic regularities, manifesting as algebraic relationships in the vector space.
Neural networks provide the computational machinery for learning embeddings and performing downstream
tasks. The feedforward architecture, with its hidden layers and nonlinear activations, can represent complex
functions. Training via gradient descent and backpropagation adjusts weights to minimize cross-entropy loss.
Neural language models synthesize these components, using embeddings as input to networks that predict
upcoming words. These models generalize better than n-gram models because similar words yield similar
predictions.
The transition from count-based to neural methods reflects a broader shift in NLP: from hand-crafted features to
learned representations. The embeddings and network weights learned in this chapter form the foundation for
the deep learning architectures (RNNs, Transformers) covered in subsequent chapters.
12 References
Bengio, Y., Ducharme, R., Vincent, P., & Jauvin, C. (2003). A neural probabilistic language model. Journal of
Machine Learning Research, 3, 1137–1155.
Cybenko, G. (1989). Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals and
Systems, 2(4), 303–314.
Firth, J. R. (1957). A synopsis of linguistic theory 1930–1955. In Studies in Linguistic Analysis, 1–32. Oxford:
Blackwell.
Goldberg, Y. (2017). Neural Network Methods for Natural Language Processing. Morgan & Claypool Publishers.
Hinton, G. E., Srivastava, N., Krizhevsky, A., Sutskever, I., & Salakhutdinov, R. R. (2012). Improving neural networks
by preventing co-adaptation of feature detectors. arXiv preprint arXiv:1207.0580.
Jurafsky, D., & Martin, J. H. (2024). Speech and Language Processing (3rd ed. draft). Chapters 6–7.
Kingma, D. P., & Ba, J. (2015). Adam: A method for stochastic optimization. In Proceedings of ICLR.
Mikolov, T., Chen, K., Corrado, G., & Dean, J. (2013). Efficient estimation of word representations in vector space.
In Proceedings of ICLR Workshop.
Mikolov, T., Sutskever, I., Chen, K., Corrado, G., & Dean, J. (2013). Distributed representations of words and
phrases and their compositionality. In Advances in Neural Information Processing Systems, 3111–3119.
Pennington, J., Socher, R., & Manning, C. D. (2014). GloVe: Global vectors for word representation. In Proceedings
of EMNLP, 1532–1543.
Rumelhart, D. E., Hinton, G. E., & Williams, R. J. (1986). Learning representations by back-propagating errors.
Nature, 323(6088), 533–536.
Appendix A: Mathematical Derivations
dσ d −1 −2 e−z
= (1 + e−z ) = − (1 + e−z ) ⋅ (−e−z ) =
(1 + e−z )2
dz dz
Rewriting:
dσ 1 e−z 1 + e−z − 1
= ⋅ = σ(z) ⋅ = σ(z)(1 − σ(z))
1 + e−z 1 + e−z 1 + e−z
dz
∑j e z j
k k
={ k
∂ y^k
y^ (1 − y^k ) k = i
WT C ≈ MPMI − log k
where k is the number of negative samples. This connection unifies count-based and prediction-based methods.
Glossary
Term Definition
Activation Function Nonlinear function applied element-wise to transform neural unit outputs
Term Definition
Backpropagation Algorithm for computing gradients by applying the chain rule backward through a computation graph
Bias Scalar parameter added to the weighted sum in a neural unit, allowing shift of the activation threshold
Computation Graph Directed acyclic graph representing the sequence of operations in a neural network
Cosine Similarity Similarity measure based on the cosine of the angle between two vectors
Cross-Entropy Loss Loss function measuring the difference between predicted probability distribution and true distribution
Distributional Hypothesis The principle that words occurring in similar contexts have similar meanings
Dropout Regularization technique that randomly sets unit activations to zero during training
Feedforward Network Neural network where connections flow in one direction from input to output with no cycles
Gradient Descent Optimization algorithm that iteratively updates parameters in the direction of steepest descent
Hidden Layer Layer between input and output that learns internal representations
Loss Function Function quantifying the discrepancy between predictions and ground truth
Negative Sampling Training technique that contrasts true context words with randomly sampled "noise" words
One-Hot Vector Sparse vector with a single 1 at the index corresponding to a word and 0s elsewhere
Perplexity Evaluation metric for language models; the inverse probability normalized by sequence length
PMI Pointwise Mutual Information; measures association between word pairs relative to independence
Self-Supervision Training paradigm where labels are derived from the data itself (e.g., predicting the next word)
Skip-Gram Word2Vec architecture that predicts context words from a target word
TF-IDF Term Frequency-Inverse Document Frequency; weighting scheme balancing term frequency and document frequency
Word2Vec Family of algorithms for learning word embeddings from text corpora