intermediate classification-sentiment 35 min read

Lexicon Sentiment and the Loughran–McDonald Dictionary

A sentiment dictionary is a linear classifier whose weights were fixed before any label was seen. Net tone projects a filing onto one direction of the category simplex and discards the other; length, contamination, and the sentences no word list can read set its ceiling; and as a prior for logistic regression the dictionary is worth about a thousand labeled filings

Overview & Motivation

Take the 1,5001{,}500 synthetic financial filings of the linear classifiers topic, labeled negative, neutral, or positive in tone, and score each one with a word list: count its positive words, subtract its negative words, divide by its length. With two cutpoints tuned on the training filings, this net tone gets 0.6370.637 of the test filings right. Logistic regression on all the word counts got 0.7390.739. The dictionary uses no labels at all, apart from its two cutpoints.

Finance learned to distrust such lists the hard way. Loughran and McDonald (2011) found that in a large sample of 10-K filings, almost three-fourths of the words that the widely used Harvard-IV dictionary calls negative are not negative in a financial context: tax, cost, capital, liability, crude. Their finance word lists replaced Harvard-IV across the literature. This page treats a dictionary as what the previous topic would call it, a linear classifier with fixed weights, and asks what the fixing costs. In order:

  1. The category simplex. A dictionary places a document at its rates of positive and negative words, and net tone keeps one direction of that plane.
  2. Length. How many words a document needs before the sign of its score can be trusted.
  3. Contamination. What counting tax as negative does, exactly.
  4. What no word list reads. Directions, the valence trap, and negation.
  5. The dictionary as a prior. Shrinking logistic regression toward the dictionary instead of toward zero.
  6. Inducing a dictionary. Propagating polarity from a few seed words, and where that stops.

The corpus has a hand-written stand-in lexicon (positive, negative, uncertainty, and litigious lists of 1515 to 1818 words each). It is not derived from the Loughran–McDonald dictionary, whose license allows academic research but not redistribution here; every number on this page comes from the stand-in.


A dictionary reads a filing

Here are two sentences from one positive test filing, an MD&A section, with the stand-in’s words marked: “Operating margin in networkpoint was resilient. Liquidity in efficiency operations and multistores surpassed expectations.” Two positive hits, no negative ones. The same filing also says “Management pointed to loss in free cash flow,” one negative hit for a fact that is bad news, and “Estimates of fluctuations could change, and the claimbase outlook remains uncertain given variability in overpipe,” five uncertainty hits that say nothing about direction.

Definition 1 (Lexicon, counts, and net tone).

A lexicon is a family of disjoint word sets, here positive PP, negative NN, uncertainty, and litigious. For a document with count vector xx and length L=∑jxjL = \sum_j x_j, the category counts are n+=∑j∈Pxjn_+ = \sum_{j \in P} x_j and n−=∑j∈Nxjn_- = \sum_{j \in N} x_j, the rates are p^±=n±/L\hat p_\pm = n_\pm / L, the weight vector is wL=1P−1Nw_L = \mathbf 1_P - \mathbf 1_N, the raw score is s=wL⋅x=n+−n−s = w_L \cdot x = n_+ - n_-, and the net tone is s/L=p^+−p^−s/L = \hat p_+ - \hat p_-.

The raw score is a linear function of the counts with weights in {−1,0,1}\{-1, 0, 1\}, so a lexicon is a point of the previous topic’s hypothesis class that was chosen without data. Net tone divides by the length, which is Loughran and McDonald’s proportional measure, and the cutpoints turn it into a three-way decision.


The category simplex

Discard everything about a document except its rates. Then the document is a point (p^+,p^−)(\hat p_+, \hat p_-) in a small triangle, the simplex whose third corner is “everything else”. Net tone measures that point along the diagonal direction (1,−1)(1, -1), so a net-tone rule cuts the triangle with lines parallel to p^+=p^−\hat p_+ = \hat p_-. Whether that is the right cut depends on how the tones place their documents.

Suppose each tone tt draws every token’s category independently with rates qt=(qt+,qt−,qt0)q_t = (q_{t+}, q_{t-}, q_{t0}), where qt0q_{t0} covers every token that is in neither list, and draws the word within its category from a distribution that does not depend on the tone. Call this a category world. For two tones tt and t′t', write

uc=log⁡qtcqt′c−log⁡qt0qt′0(c=+,−),v=log⁡qt0qt′0.u_c = \log\frac{q_{tc}}{q_{t'c}} - \log\frac{q_{t0}}{q_{t'0}} \quad (c = +, -), \qquad v = \log\frac{q_{t0}}{q_{t'0}}.

Proposition 1 (The Bayes rule of a category world).

Assume a category world with equal tone priors.

(a) The posterior depends on the document only through its category counts: log⁡P(t∣x)=n+log⁡qt++n−log⁡qt−+n0log⁡qt0+c(x)\log P(t \mid x) = n_+ \log q_{t+} + n_- \log q_{t-} + n_0 \log q_{t0} + c(x) with n0=L−n+−n−n_0 = L - n_+ - n_- and c(x)c(x) free of tt. Divided by LL, every tone’s score is affine in (p^+,p^−)(\hat p_+, \hat p_-), so the Bayes regions are cut by lines.

(b) Tones tt and t′t' are decided by a threshold on net tone if and only if u+=−u−u_+ = -u_-.

(c) In the symmetric-tilt world with q0=(m,m,1−2m)q_0 = (m, m, 1 - 2m), q+=(meβ,me−β,1−2m)/Zq_+ = (m e^\beta, m e^{-\beta}, 1 - 2m)/Z, and q−q_- its mirror image, where Z=1+2m(cosh⁡β−1)Z = 1 + 2m(\cosh\beta - 1), the Bayes rule is: positive if s/L>τs/L \gt \tau, negative if s/L<−τs/L \lt -\tau, neutral otherwise, with τ=log⁡Z/β>0\tau = \log Z/\beta \gt 0. The positive-against-negative log-odds is 2βs2\beta s.

Proof.

(a) A word jj of category cc has probability qtc rc(j)q_{tc}\, r_c(j) under tone tt, so log⁡P(x∣t)\log P(x \mid t) is the multinomial coefficient, plus ∑cnclog⁡qtc\sum_c n_c \log q_{tc}, plus ∑jxjlog⁡rc(j)(j)\sum_j x_j \log r_{c(j)}(j). Only the middle term depends on tt, and with equal priors the posterior is the softmax of n⋅log⁡qtn \cdot \log q_t. Since n0/L=1−p^+−p^−n_0/L = 1 - \hat p_+ - \hat p_-, each score divided by LL is affine in the rates, and the boundary between two tones is the line u+p^++u−p^−+v=0u_+ \hat p_+ + u_- \hat p_- + v = 0.

(b) The pair’s log-odds divided by LL is u+p^++u−p^−+vu_+\hat p_+ + u_-\hat p_- + v. It is a function of p^+−p^−\hat p_+ - \hat p_- alone on the open simplex if and only if its gradient (u+,u−)(u_+, u_-) is parallel to (1,−1)(1, -1), that is, if and only if u+=−u−u_+ = -u_-.

(c) Positive against neutral has u+=βu_+ = \beta, u−=−βu_- = -\beta, and v=−log⁡Zv = -\log Z, so positive wins exactly when βs/L>log⁡Z\beta s/L \gt \log Z; negative against neutral is the mirror image. Positive against negative has u+=2βu_+ = 2\beta, u−=−2βu_- = -2\beta, and v=0v = 0, so its log-odds is 2βs2\beta s. Since cosh⁡β>1\cosh\beta \gt 1, we have Z>1Z \gt 1 and τ>0\tau \gt 0, and the three pairwise rules agree on the stated regions.

∎

So net tone is the Bayes rule of a particular world, one in which a positive document trades negative words for positive ones symmetrically. With unequal priors the prior adds log⁡πt\log \pi_t to each score, which becomes a length-dependent offset after dividing by LL, so even there a fixed cutpoint on net tone is only right for documents of one length.

The finance corpus is not that world. Positive filings have 1.791.79 positive hits per 100100 tokens against 0.690.69 in neutral ones, but 0.820.82 negative hits against 0.680.68: a positive filing still reports some bad news. Fitting the category world’s rates to the training filings gives (u+,u−)=(0.967,0.191)(u_+, u_-) = (0.967, 0.191) for positive against neutral, far from antisymmetric. Neutral filings are the ones with few polar words of either kind, and a band of diagonal lines cannot separate them from filings with many polar words in balance. The plug-in Bayes rule of the category world, which uses both counts, scores 0.7240.724 on the test filings, against net tone’s 0.6370.637, close to logistic regression’s 0.7390.739 on every word. On this split the projection is most of the gap between the dictionary and the learned model; over the previous topic’s six random splits into training, development, and test filings (this page’s is the first), it is, on average, all of it. There the plug-in rule scores 0.734±0.0120.734 \pm 0.012 and logistic regression 0.733±0.0120.733 \pm 0.012, a difference of 0.001±0.0210.001 \pm 0.021 in the plug-in rule’s favor, which is ahead on three splits of six. The two counts also leave little to find: on 60,00060{,}000 fresh filings, the best rule on (n+,n−)(n_+, n_-) at all, a table of the commonest tone for each pair, scores 0.7360.736 on 60,00060{,}000 more, the plug-in rule 0.7370.737, and net tone with its best cutpoints 0.6380.638. What separates the dictionary from the learned model is the projection, not the word list. The Simplex tab draws the filings and both rules.

Each filing is a point of the category simplex: net tone keeps one direction of it
600 test filings: negative hits against positive hits, per 100 tokens00112233positive hits per 100 tokens (p̂₊)negative hits per 100 tokens (p̂₋)
negative filingneutral filingpositive filing
net tone, tuned cutpoints
0.637
category-world Bayes
0.724
unigram logistic regression
0.739
slopes (u₊, u₋), positive vs neutral
0.967, 0.191

Net tone p̂₊ − p̂₋ can only cut along the dashed diagonals, at the cutpoints -0.619 and 0.75 per 100 tokens. Neutral filings sit near the origin, with few polar words of either kind, and a diagonal band cannot separate them from balanced filings with many. The Bayes rule's boundaries (Proposition 1) are lines too, but they are not parallel to the diagonal. A few filings beyond 3.2 hits per 100 tokens are off the chart.


How long a document must be

Even in a world where net tone is right, a short document does not contain enough hits to decide. Model the tokens of a positive document as independent, each a positive hit with probability aa, a negative hit with probability b<ab \lt a, and neither otherwise, and let SLS_L be the raw score of LL tokens.

Theorem 1 (Length and the sign of the score).

Let ρ=1−(a−b)2\rho = 1 - (\sqrt a - \sqrt b)^2. Then (a) P(SL≤0)≤ρLP(S_L \le 0) \le \rho^L for every LL, and (b) 1Llog⁡P(SL≤0)→log⁡ρ\frac1L \log P(S_L \le 0) \to \log\rho as L→∞L \to \infty.

Proof.

(a) For t≥0t \ge 0, Markov’s inequality gives P(SL≤0)=P(e−tSL≥1)≤E e−tSL=M(t)LP(S_L \le 0) = P(e^{-tS_L} \ge 1) \le E\,e^{-tS_L} = M(t)^L with M(t)=ae−t+bet+1−a−bM(t) = a e^{-t} + b e^{t} + 1 - a - b. The function MM is strictly convex, with M′(t)=0M'(t) = 0 where e2t=a/be^{2t} = a/b, at t∗=12log⁡(a/b)>0t^\ast = \tfrac12 \log(a/b) \gt 0, and there M(t∗)=2ab+1−a−b=1−(a−b)2M(t^\ast) = 2\sqrt{ab} + 1 - a - b = 1 - (\sqrt a - \sqrt b)^2.

(b) Cramér’s theorem for the mean SL/LS_L/L (formalStatistics: large deviations, Theorem 6; Dembo and Zeitouni, Theorem 2.2.3) has rate function I(y)=sup⁡λ[λy−log⁡M(−λ)]I(y) = \sup_\lambda [\lambda y - \log M(-\lambda)]. Because EX=a−b>0E X = a - b \gt 0, the function II is convex, vanishes at a−ba - b, and is finite and continuous on (−1,1)(-1, 1), so its infimum over (−∞,0)(-\infty, 0) equals its infimum over (−∞,0](-\infty, 0], which is I(0)=−log⁡min⁡tM(t)=−log⁡ρI(0) = -\log\min_t M(t) = -\log\rho. The upper and lower bounds of Cramér’s theorem therefore meet at −log⁡ρ-\log \rho.

∎

The factor ρ=2ab+(1−a−b)\rho = 2\sqrt{ab} + (1 - a - b) is the Bhattacharyya coefficient between the hit distributions of positive and negative documents, so 1−ρ=(a−b)21 - \rho = (\sqrt a - \sqrt b)^2 is their squared Hellinger distance, and the error is small once L(a−b)2L(\sqrt a - \sqrt b)^2 is large. For the stand-in on positive filings, a=0.0179a = 0.0179 and b=0.0082b = 0.0082, so ρ=0.998\rho = 0.998. Positive filings average 210.5210.5 tokens, about 5.55.5 expected hits, and at that length the bound is 0.6710.671. That is loose: the exact error of the independent model is 0.2530.253. The corpus is not independent tokens, since its tone lives in five to eight aspect sentences, yet on this split the measured share of positive filings with a raw score of zero or below is 0.2520.252, which the independent model matches. That match is particular to this split. Over the six splits the measured share is 0.217±0.0200.217 \pm 0.020, and this split’s 0.2520.252 is the largest of the six, while the independent model, at each filing’s own length, predicts 0.252±0.0100.252 \pm 0.010. On average it overpredicts the error, because the corpus’s scores are less spread out than independent tokens would make them: their variance is 0.76±0.060.76 \pm 0.06 of the independent model’s. Almost all of that comes from the positive count, whose variance is 2.152.15 against 3.913.91 for independent tokens. The two counts are slightly negatively correlated (covariance −0.19-0.19, against +0.07+0.07 for independent tokens), and since the score is their difference, that widens it rather than narrowing it. Still, one positive filing in four or five is misread before any subtlety of language enters. A lexicon ten times denser would bring the error at the corpus’s 210210 tokens down to 0.0030.003, which is why finance dictionaries are long. For small rates, ten times the density and ten times the length change the exponent L(a−b)2L(\sqrt a - \sqrt b)^2 identically, and the exact errors agree: 0.00280.0028 at ten times the rates, 0.00300.0030 at ten times the length. The Length tab plots the exact error and the bound for three presets.


When is a liability not a liability


What no word list reads

The corpus’s gold annotation records each aspect a sentence evaluates and its polarity for the company, and its templates tell us how each sentence was written. Restrict to the 5,1715{,}171 test sentences whose aspects share one nonzero polarity, and ask whether the sign of the sentence’s raw score matches it.

constructionsentencesright
adjective (“margins were solid”)1,2051{,}2051.0001.000
direction with a comment (“rose 4 percent, a trend executives characterized as solid”)1,7461{,}7461.0001.000
bare direction (“costs rose 5 percent”)59559500 (abstains)
negated adjective (“revenue was not weak”)30230200
verb, up is good (“sales beat expectations”)4464461.0001.000
verb, cost-like (“costs exceeded expectations”)35235200
noun phrase (“Management pointed to strength in demand”)5255251.0001.000

Overall the lexicon gets 0.7580.758 of these sentences right and abstains on 0.1150.115. The failures are of two kinds. A bare direction and a cost-like “exceeded expectations” are the previous topic’s exclusive-or of aspect valence and direction: “costs rose” is bad news and “revenue rose” good news, written with the same word, and no fixed weight on single words can read both. Negation is different, because it can be patched with a scope rule.

Definition 2 (Negation scope).

With scope kk, a positive or negative hit at position ii counts for the other side if a negator (not, no, never) occurs among positions i−k,…,i−1i - k, \dots, i - 1.

Das and Chen (2007) mark negated words in this way, and VADER (Hutto and Gilbert 2014) looks three tokens back. On this corpus, whose only negation template is “not” followed by an adjective, scope k=1k = 1 repairs all 302302 negated sentences, raising sentence accuracy to 0.8170.817 and three-class document accuracy from 0.6370.637 to 0.6960.696. Wider scopes change nothing until k=8k = 8, where 3636 flips land on words in the next sentence and document accuracy slips to 0.6940.694. Real text negates in more ways and at more distances, so the scope is a trade-off there, not a free fix. The Constructions tab shows the table with and without the scope.

Loughran and McDonald’s other lists measure something other than polarity. Uncertainty words occur at 1.6181.618, 1.6181.618, and 1.5651.565 per 100100 tokens in negative, neutral, and positive filings: the same rate in every tone. Litigious words occur only in the 8-K filings, at 1.3301.330 per 100100 tokens. The rule “any uncertainty word means neutral” scores 0.4140.414, far below net tone, and a logistic model on all four category rates scores 0.7250.725, the same accuracy it gets from the two polarity rates alone. The two models are not identical: their predictions differ on 3.8%3.8\% of the test filings, and those differences cancel exactly in accuracy. Uncertainty is not neutrality; it is a separate dimension of the text.


The dictionary as a prior

A dictionary is free and a labeled filing is not. The previous topic’s logistic regression shrinks its weights toward zero; we can shrink them toward the dictionary instead. Let AA be a V×rV \times r matrix of dictionary directions, either A=wLA = w_L (net tone, r=1r = 1) or A=[1P,1N]A = [\mathbf 1_P, \mathbf 1_N] (the two counts, r=2r = 2), and give class kk the logit x⋅Δk+(A⊤x)⋅βk+bkx \cdot \Delta_k + (A^\top x) \cdot \beta_k + b_k, so that its weight vector is Wk=Δk+AβkW_k = \Delta_k + A\beta_k. Fit by minimizing the mean cross-entropy plus λ2∑k∥Δk∥2\frac\lambda2 \sum_k \lVert\Delta_k\rVert^2, with no penalty on β\beta or bb.

Theorem 2 (Shrinking toward a dictionary).

Let AA have full column rank, let P⊥P_\perp be the orthogonal projection onto the complement of its column space, and let G=1n∑i∥xi∥G = \frac1n \sum_i \lVert x_i \rVert.

(a) The fit is equivalent to minimizing the cross-entropy of WW plus λ2∑k∥P⊥Wk∥2\frac\lambda2 \sum_k \lVert P_\perp W_k \rVert^2, ridge on the part of each class’s weights orthogonal to the dictionary’s directions, with Δk=P⊥Wk\Delta_k = P_\perp W_k. In particular A⊤Δk=0A^\top \Delta_k = 0.

(b) At the optimum, ∥Δk∥≤G/λ\lVert \Delta_k \rVert \le G/\lambda for every class kk.

(c) If the limiting problem, softmax regression on the dictionary counts A⊤xA^\top x alone, has a nondegenerate minimizer (after fixing the common shift of the softmax), then the fitted probabilities converge to its probabilities as λ→∞\lambda \to \infty, uniformly on bounded sets, at rate O(1/λ)O(1/\lambda).

Proof.

(a) The cross-entropy depends on (Δ,β)(\Delta, \beta) only through WW. For a fixed WkW_k, minimizing ∥Δk∥2\lVert\Delta_k\rVert^2 over the decompositions Wk=Δk+AβkW_k = \Delta_k + A\beta_k is least squares in βk\beta_k, with minimum ∥P⊥Wk∥2\lVert P_\perp W_k \rVert^2 attained at Δk=P⊥Wk\Delta_k = P_\perp W_k.

(b) Setting the gradient in Δk\Delta_k to zero gives ∇WkCE+λΔk=0\nabla_{W_k}\mathrm{CE} + \lambda\Delta_k = 0. (Setting the gradient in βk\beta_k to zero gives A⊤∇WkCE=0A^\top \nabla_{W_k}\mathrm{CE} = 0, which is the orthogonality of (a) again.) Since ∇WkCE=1n∑i(pik−yik) xi\nabla_{W_k}\mathrm{CE} = \frac1n \sum_i (p_{ik} - y_{ik})\, x_i and ∣pik−yik∣≤1\lvert p_{ik} - y_{ik} \rvert \le 1, we get ∥Δk∥≤G/λ\lVert\Delta_k\rVert \le G/\lambda.

(c) For fixed Δ\Delta, the optimal (β,b)(\beta, b) minimizes the convex function CE(Δ,⋅,⋅)\mathrm{CE}(\Delta, \cdot, \cdot), and at Δ=0\Delta = 0 its stationarity equations are those of the limiting problem. Nondegeneracy and the implicit function theorem give a smooth branch (β(Δ),b(Δ))(\beta(\Delta), b(\Delta)) of minimizers near Δ=0\Delta = 0, and by convexity the optimum at Δλ\Delta_\lambda lies on it, so (βλ,bλ)(\beta_\lambda, b_\lambda) is within O(∥Δλ∥)O(\lVert \Delta_\lambda \rVert) of the limit. Every logit then moves by O(∥x∥ ∥Δλ∥)O(\lVert x\rVert\,\lVert\Delta_\lambda\rVert), and the softmax is Lipschitz, so by (b) the probabilities move by O(1/λ)O(1/\lambda).

∎

On the full training set, G=26.364G = 26.364, while for the prior toward net tone λmax⁡k∥Δk∥\lambda \max_k \lVert\Delta_k\rVert is at most 0.7250.725, so the constant in (b) is loose by a factor of 3636 at λ=1,000\lambda = 1{,}000, its tightest, and about 9797 at λ=1\lambda = 1; for the two counts the factor is 9595 to 147147. At λ=1,000\lambda = 1{,}000 the slack has two sources: cancellation of the terms (pik−yik) xi(p_{ik} - y_{ik})\,x_i across documents, a factor of about 1414, and residuals ∣pik−yik∣\lvert p_{ik} - y_{ik}\rvert well below 11, about 2.52.5. The largest gap between the fitted and limiting test probabilities falls from 0.46740.4674 at λ=1\lambda = 1 to 0.15910.1591, 0.02150.0215, and 0.00220.0022 at λ=10\lambda = 10, 100100, and 1,0001{,}000: one decade of accuracy per decade of λ\lambda.

The learning curves set the price of the dictionary in labeled filings. Each column is a number of labeled training filings nn; small nn average ten random samples, and every penalty is chosen on 600600 development filings.

method10101001003003001,0001{,}0001,5001{,}500
dictionary, net tone0.5470.5470.6200.6200.6300.6300.6390.6390.6390.639
dictionary, two counts0.6230.6230.7120.7120.7190.7190.7170.7170.7170.717
logistic regression on the 3535 lexicon words0.4710.4710.6390.6390.7060.7060.7290.7290.7390.739
logistic regression on every word0.3990.3990.5320.5320.6140.6140.7190.7190.7390.739
prior toward net tone0.5490.5490.7010.7010.7230.7230.7510.7510.7660.766
prior toward two counts0.6160.6160.7120.7120.7250.7250.7480.7480.7570.757

The dictionary rows are flat, because they fit only a scale and two cutpoints. On this grid, plain logistic regression first matches the dictionary at n=1,000n = 1{,}000, for both forms of it. But the grid jumps from 300300 to 1,0001{,}000, and its 1,0001{,}000 and 1,5001{,}500 columns are one sample each. A finer grid, with ten random samples at each nn, counts the samples on which logistic regression matches or beats each form of the dictionary:

labeled filings nn3003004004005005006006007007008008001,0001{,}0001,2001{,}200
matches or beats net tone5599101010101010101010101010
matches or beats the two counts0000000000003399

So net tone is worth 300300 to 400400 labeled filings. The two counts are worth 1,0001{,}000 to 1,2001{,}200 on this split and about 1,5001{,}500 on average: over the six splits, at all 1,5001{,}500 filings, logistic regression only ties them, ahead by 0.0006±0.0210.0006 \pm 0.021. Restricting the regression to the dictionary’s words, as Jegadeesh and Wu (2013) do with market reactions, climbs faster and ends at the same 0.7390.739. The priors are never more than 0.010.01 below the better of their two ends, and at 1,5001{,}500 filings the prior toward net tone beats plain logistic regression, 0.7660.766 to 0.7390.739. That lead is not an artifact of the grid. Plain logistic regression chose λ=0.01\lambda = 0.01, the top of its grid, on all six splits, but on a wider grid, from 11 to 0.0010.001, it scores 0.734±0.0090.734 \pm 0.009, unchanged, and the prior toward net tone still leads it by 0.031±0.0140.031 \pm 0.014, on all six. As a prior the dictionary is worth about a thousand labeled filings: with 300300 of them, the prior toward net tone scores 0.7310.731 on the same ten samples, which plain logistic regression reaches between 1,2001{,}200 and 1,5001{,}500. Along the penalty path at n=1,500n = 1{,}500, the prior’s accuracy rises from the dictionary’s 0.6390.639 at λ=104\lambda = 10^4 to 0.7660.766 at λ=0.1\lambda = 0.1, then falls to 0.7310.731 at λ=10−3\lambda = 10^{-3}. Even there it is not ordinary ridge logistic regression, which scores 0.7210.721 at that λ\lambda: the prior never penalizes its dictionary directions. At equal λ\lambda the prior leads at each of 0.10.1 (0.7660.766 against 0.7300.730), 0.010.01 (0.7530.753 against 0.7390.739), and 0.0010.001 (0.7310.731 against 0.7210.721). All six methods remain well below the corpus’s full-text Bayes accuracy of 0.8900.890, which needs the aspect structure that no bag of words sees. The Prior tab draws the curves and the path.


Inducing a dictionary

Loughran and McDonald built their lists by reading words in context. The alternative is to induce a list from unlabeled text: start from a few seed words of known polarity and spread polarity to words that keep their company (Hatzivassiloglou and McKeown 1997; Turney 2002; Hamilton and colleagues 2016). One way to spread it is to solve a Dirichlet problem on a word graph.

Let WW be a symmetric nonnegative matrix of edge weights on a vertex set S∪US \cup U, with seed values fS∈{−1,+1}Sf_S \in \{-1, +1\}^S, degrees dv=∑jWvjd_v = \sum_j W_{vj}, and D=diag⁡(d)D = \operatorname{diag}(d).

Theorem 3 (Harmonic polarity).

Suppose every vertex of UU is joined to some seed by a path of positive weight. Then (a) (D−W)UU(D - W)_{UU} is positive definite, so the system (D−W)UUfU=WUSfS(D - W)_{UU} f_U = W_{US} f_S has exactly one solution; (b) that solution is harmonic, fv=∑j(Wvj/dv)fjf_v = \sum_j (W_{vj}/d_v) f_j for v∈Uv \in U, and satisfies min⁡fS≤f≤max⁡fS\min f_S \le f \le \max f_S; (c) fv=2hv−1f_v = 2h_v - 1, where hvh_v is the probability that the random walk with steps Wvj/dvW_{vj}/d_v, started at vv, reaches a positive seed before a negative one; and (d) clamped label propagation, which repeats f←D−1Wff \leftarrow D^{-1}Wf and resets the seeds, converges to ff.

Proof.

(a) For gg on UU, g⊤(D−W)UU g=12∑i,j∈UWij(gi−gj)2+∑i∈Ugi2∑s∈SWis≥0g^\top (D - W)_{UU}\, g = \tfrac12 \sum_{i, j \in U} W_{ij}(g_i - g_j)^2 + \sum_{i \in U} g_i^2 \sum_{s \in S} W_{is} \ge 0. If it is 00, then gg is constant on each connected component of UU and vanishes at every vertex adjacent to a seed; every component contains such a vertex, so g=0g = 0.

(b) The averaging identity is row vv of the system. Let μ=max⁡Uf\mu = \max_U f and suppose μ>max⁡fS\mu \gt \max f_S. At a maximizer, fvf_v is an average of neighbors’ values that are all at most μ\mu, so every neighbor also equals μ\mu; following a path from vv to a seed reaches a seed of value μ>max⁡fS\mu \gt \max f_S, which is impossible. The minimum is symmetric.

(c) From every vertex the seeds are reachable, so the walk is absorbed almost surely. Conditioning on its first step gives hv=∑j(Wvj/dv)hjh_v = \sum_j (W_{vj}/d_v) h_j on UU, with h=1h = 1 on positive seeds and h=0h = 0 on negative ones. Then 2h−12h - 1 is harmonic on UU with the boundary values ±1\pm 1, and by (a) it equals ff.

(d) The iteration is the Jacobi method for the system of (a). Its matrix DUU−1WUUD_{UU}^{-1} W_{UU} is substochastic, and mass leaks to the seeds from every component, so its spectral radius is below 11.

∎

Zhu, Ghahramani, and Lafferty (2003) introduced this solution for semi-supervised learning, and Doyle and Snell (1984) give the classical theory. On the corpus we build the graph from the training filings: one vertex per word type in at least 3030 filings (699699 types), edge weights equal to the positive part of the words’ pointwise mutual information across documents, and seeds strong, robust against weak, adverse. We report each word’s harmonic value centered at the median and divided by the standard deviation, a score zz.

The signs come out mostly right: 2525 of the 2828 other stand-in polar words in the graph land on their own side (0.8930.893), and over 200200 random choices of two positive and two negative seeds the median is 0.8210.821. Positive filings contain more positive words, so positive words share documents with each other, and propagation finds that. The magnitudes are another matter. The polar words have mean ∣z∣\lvert z \rvert of 1.0851.085 and 1.0551.055, but the polysemes have 0.9070.907: liability (−1.462-1.462), taxes (−1.267-1.267), crude (−1.143-1.143), and tax (−0.911-0.911) land on the negative side, which reproduces part of the general list’s mistake. And the ten most positive words in the whole graph include just one lexicon word, strength; the rest are mostly sector words such as therapeutics and biosciences, along with on and headquartered, that happen to share documents with the seeds. Propagation is good at scoring a candidate list. It cannot choose the list, and choosing it is the curation Loughran and McDonald did by hand. The Induction tab plots every stand-in word’s score.


Where this sits

Dictionary tone entered finance with Tetlock (2007), who found that the Harvard-IV pessimism of a Wall Street Journal column predicts market returns. Loughran and McDonald (2011) showed that the same dictionary misreads 10-Ks and built the finance lists that replaced it, and their survey (2016) argues that a transparent list is worth some accuracy in research that others must replicate. Their lists also come with a tf–idf weighting, which formalRAG’s vector-space model topic derives; outside finance, Taboada and colleagues (2011) build lexicons with intensifiers and graded negation.

The next topic, aspect-based sentiment, attaches polarity to the aspect a sentence evaluates, which is what this page’s bare directions and cost-like verbs need. The capstone scores earnings calls with a dictionary and a learned model side by side.


Honest caveats


Implementation

The companion notebook (notebookPath) imports lexicon_sentiment_loughran_mcdonald.py, which owns every number on this page. That module imports the linear classifiers topic’s module for its train, development, and test split, its features, and its trust-region Newton fits, and the shared finance corpus through it. A harness of 2929 tests runs in about 4545 seconds on a laptop CPU, and --slow adds four checks that refit on all six of the linear classifiers topic’s random splits, on the finer learning-curve grid, and on 60,00060{,}000 fresh filings, about five minutes more. It checks:

  • Proposition 1 against the literal multinomial likelihood in random category worlds and tilt worlds, and on the corpus; with --slow, the plug-in rule against logistic regression on six splits and against the best count reader on fresh filings.
  • Theorem 1’s bound against the exact law of the score on 250250 instances, its exponent’s convergence, its prediction on the corpus and on all six splits, and the dense preset at the corpus’s length.
  • Proposition 2’s exact moments on 500500 random instances, and the general list’s effect on the corpus, on all six splits with the cut at zero and re-tuned, and on the EDGAR excerpts.
  • The example filing’s quotations, the construction table, the negation sweep, and the uncertainty and litigious profiles.
  • Theorem 2’s orthogonality, bound, slack, and 1/λ1/\lambda convergence for both dictionary subspaces, the learning curves, and plain logistic regression at the prior’s λ\lambda; with --slow, the finer curves and the wide grids.
  • Theorem 3’s uniqueness, maximum principle, label propagation, and a Monte Carlo random walk, and the induction on the corpus.
  • That no file in the repository looks like the Loughran–McDonald dictionary.

The module also includes load_lm_dictionary(), which loads the real dictionary into the stand-in’s format if you supply a copy (set LM_MASTER_DICTIONARY, or opt in to a download into ~/.cache/formalnlp/lm/). Nothing on this page or in the harness depends on it. The laboratory reads its data from a JSON file that one of the harness’s tests requires to equal the module’s viz_payload() exactly, so the figure cannot drift from the code.

References & Further Reading