Hayes and Wilson (2008): A Maximum Entropy Model of Phonotactics and Phonotactic Learning #
This file formalizes Hayes and Wilson's maximum-entropy model of phonotactics. A constraint is a
sequence of feature matrices, one of which may be complemented, and a grammar assigns each form a
score, a maxent value, and a probability. The weights are learned by maximizing the probability
of the data, whose partial derivatives are differences between expected and observed violation
counts (hasDerivAt_logLik), and the weights that maximize it give the distribution of greatest
entropy among those that match the observed violations
(isGreatest_measureEntropy_of_isMaxOn_logLik).
The grammar the learner found for English onsets (Table 4) is stated over the paper's feature
chart (Table 3), and every score the paper reports is recomputed from it (rows_scores),
including the ten attested onsets the grammar penalizes (attested_penalized). The predicted
rating orders forms as the score does (rating_lt_iff), so the reported correlation with
Scholes's ratings is a claim about the score alone.
Implementation notes #
Weights are kept in hundredths over ℕ, so every score is computed by decide; the maxent
value and probability then live over ℝ. Scores computed from the two-decimal weights of
Table 4 can differ from the paper's reported values by one hundredth ([ð] 4.53 here against
4.54; [θw] 3.90 against 3.91; [θ] and [θr] 1.84 against 1.85), and rows_scores states the
reproduction to within that rounding. Complement matrices are read against the
underspecified chart, so [^+back] contains every consonant unspecified for backness, as
#15 requires. The probability (6) over the infinite set of forms is realized over a finite
form space, the subtype of a candidate set for the learned grammar (onsetProb); the paper's
finite-state approximation of the expected counts is not modelled. The ratings of Scholes's
experiment appear only as a scattergram (Figure 3), so the correlation of 0.946 and Table 5 stay
in prose.
TODO #
- The constraint search of §4 (accuracy O/E with the upper confidence limit, generality, the algorithm (10)) and the Gaussian prior of footnote 4.
- Projections (§6–§7), the Shona and stress simulations, and Wargamay (§8).
References #
- B. Hayes and C. Wilson, A Maximum Entropy Model of Phonotactics and Phonotactic Learning (2008)
- S. Della Pietra, V. J. Della Pietra and J. D. Lafferty, Inducing Features of Random Fields (1997)
- R. J. Scholes, Phonotactic Grammaticality (1966)
- G. N. Clements and S. J. Keyser, CV Phonology: A Generative Theory of the Syllable (1983)
- S. Goldwater and M. Johnson, Learning OT Constraint Rankings Using a Maximum Entropy Model (2003)
The segments of Table 3 #
Seg enumerates the English consonants of Table 3. Segments without an ASCII letter take
their ARPAbet names, with ch for [tʃ], jh for [dʒ], th for [θ], sh for [ʃ], hh for
[h], dh for [ð], zh for [ʒ], and ng for [ŋ].
- p : Seg
- t : Seg
- ch : Seg
- k : Seg
- b : Seg
- d : Seg
- jh : Seg
- g : Seg
- f : Seg
- th : Seg
- s : Seg
- sh : Seg
- hh : Seg
- v : Seg
- dh : Seg
- z : Seg
- zh : Seg
- m : Seg
- n : Seg
- ng : Seg
- l : Seg
- r : Seg
- j : Seg
- w : Seg
Instances For
Equations
- HayesWilson2008.instDecidableEqSeg x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
- HayesWilson2008.instReprSeg = { reprPrec := HayesWilson2008.instReprSeg.repr }
Equations
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.p prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.p")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.t prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.t")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.ch prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.ch")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.k prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.k")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.b prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.b")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.d prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.d")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.jh prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.jh")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.g prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.g")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.f prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.f")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.th prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.th")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.s prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.s")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.sh prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.sh")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.hh prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.hh")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.v prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.v")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.dh prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.dh")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.z prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.z")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.zh prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.zh")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.m prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.m")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.n prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.n")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.ng prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.ng")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.l prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.l")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.r prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.r")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.j prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.j")).group prec✝
- HayesWilson2008.instReprSeg.repr HayesWilson2008.Seg.w prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.Seg.w")).group prec✝
Instances For
The chart of Table 3 lists, for each feature, the segments specified + and then those
specified −. A segment in neither list is unspecified for the feature, as in the chart's
blanks (privative and contrastive underspecification, §4.1.2).
Equations
- One or more equations did not get rendered due to their size.
- HayesWilson2008.Seg.chart Phonology.Feature.nasal = ([HayesWilson2008.Seg.m, HayesWilson2008.Seg.n, HayesWilson2008.Seg.ng], [])
- HayesWilson2008.Seg.chart Phonology.Feature.spreadGlottis = ([HayesWilson2008.Seg.hh], [])
- HayesWilson2008.Seg.chart Phonology.Feature.lateral = ([HayesWilson2008.Seg.l], [])
- HayesWilson2008.Seg.chart Phonology.Feature.dorsal = ([HayesWilson2008.Seg.k, HayesWilson2008.Seg.g, HayesWilson2008.Seg.ng], [])
- HayesWilson2008.Seg.chart Phonology.Feature.high = ([HayesWilson2008.Seg.j, HayesWilson2008.Seg.w], [])
- HayesWilson2008.Seg.chart Phonology.Feature.back = ([HayesWilson2008.Seg.w], [HayesWilson2008.Seg.j])
- HayesWilson2008.Seg.chart x✝ = ([], [])
Instances For
The feature specification of a segment is read off the chart.
Equations
- x.spec f = if x ∈ (HayesWilson2008.Seg.chart f).1 then ↑true else if x ∈ (HayesWilson2008.Seg.chart f).2 then ↑false else ⊥
Instances For
ofChar reads the segment written by one IPA letter.
Equations
- HayesWilson2008.Seg.ofChar 'p' = some HayesWilson2008.Seg.p
- HayesWilson2008.Seg.ofChar 't' = some HayesWilson2008.Seg.t
- HayesWilson2008.Seg.ofChar 'k' = some HayesWilson2008.Seg.k
- HayesWilson2008.Seg.ofChar 'b' = some HayesWilson2008.Seg.b
- HayesWilson2008.Seg.ofChar 'd' = some HayesWilson2008.Seg.d
- HayesWilson2008.Seg.ofChar 'g' = some HayesWilson2008.Seg.g
- HayesWilson2008.Seg.ofChar 'f' = some HayesWilson2008.Seg.f
- HayesWilson2008.Seg.ofChar 'θ' = some HayesWilson2008.Seg.th
- HayesWilson2008.Seg.ofChar 's' = some HayesWilson2008.Seg.s
- HayesWilson2008.Seg.ofChar 'ʃ' = some HayesWilson2008.Seg.sh
- HayesWilson2008.Seg.ofChar 'h' = some HayesWilson2008.Seg.hh
- HayesWilson2008.Seg.ofChar 'v' = some HayesWilson2008.Seg.v
- HayesWilson2008.Seg.ofChar 'ð' = some HayesWilson2008.Seg.dh
- HayesWilson2008.Seg.ofChar 'z' = some HayesWilson2008.Seg.z
- HayesWilson2008.Seg.ofChar 'ʒ' = some HayesWilson2008.Seg.zh
- HayesWilson2008.Seg.ofChar 'm' = some HayesWilson2008.Seg.m
- HayesWilson2008.Seg.ofChar 'n' = some HayesWilson2008.Seg.n
- HayesWilson2008.Seg.ofChar 'ŋ' = some HayesWilson2008.Seg.ng
- HayesWilson2008.Seg.ofChar 'l' = some HayesWilson2008.Seg.l
- HayesWilson2008.Seg.ofChar 'r' = some HayesWilson2008.Seg.r
- HayesWilson2008.Seg.ofChar 'j' = some HayesWilson2008.Seg.j
- HayesWilson2008.Seg.ofChar 'w' = some HayesWilson2008.Seg.w
- HayesWilson2008.Seg.ofChar x✝ = none
Instances For
parse reads an onset off a row's IPA string, with the affricates written as digraphs.
Equations
- One or more equations did not get rendered due to their size.
- HayesWilson2008.Seg.parse [] = some []
- HayesWilson2008.Seg.parse ('t' :: 'ʃ' :: cs) = Option.map (fun (x : List HayesWilson2008.Seg) => HayesWilson2008.Seg.ch :: x) (HayesWilson2008.Seg.parse cs)
- HayesWilson2008.Seg.parse ('d' :: 'ʒ' :: cs) = Option.map (fun (x : List HayesWilson2008.Seg) => HayesWilson2008.Seg.jh :: x) (HayesWilson2008.Seg.parse cs)
Instances For
Constraints (§4.1.1) #
A matrix of a constraint (9) is a natural class [αF, βG, …], its complement
[^αF, βG, …] (the implication operator), or the word boundary #.
- cls (pat : Phonology.Segment) : Matrix
- compl (pat : Phonology.Segment) : Matrix
- boundary : Matrix
Instances For
A matrix matches one symbol of a boundary-padded form, read through the segment
specification spec; none is a word boundary.
Equations
- HayesWilson2008.Matrix.Matches spec (HayesWilson2008.Matrix.cls pat) (some x_2) = (pat ≤ spec x_2)
- HayesWilson2008.Matrix.Matches spec (HayesWilson2008.Matrix.compl pat) (some x_2) = ¬pat ≤ spec x_2
- HayesWilson2008.Matrix.Matches spec HayesWilson2008.Matrix.boundary none = True
- HayesWilson2008.Matrix.Matches spec x✝¹ x✝ = False
Instances For
Equations
- HayesWilson2008.instDecidableMatches spec (HayesWilson2008.Matrix.cls pat) (some val) = { decide := decide (∀ (i : Phonology.Feature), pat i ≤ spec val i), reflects_decide := ⋯ }
- HayesWilson2008.instDecidableMatches spec (HayesWilson2008.Matrix.compl pat) (some val) = { decide := !decide (pat ≤ spec val), reflects_decide := ⋯ }
- HayesWilson2008.instDecidableMatches spec HayesWilson2008.Matrix.boundary none = { decide := true, reflects_decide := ⋯ }
- HayesWilson2008.instDecidableMatches spec (HayesWilson2008.Matrix.cls pat) none = { decide := false, reflects_decide := ⋯ }
- HayesWilson2008.instDecidableMatches spec (HayesWilson2008.Matrix.compl pat) none = { decide := false, reflects_decide := ⋯ }
- HayesWilson2008.instDecidableMatches spec HayesWilson2008.Matrix.boundary (some val) = { decide := false, reflects_decide := ⋯ }
A phonotactic constraint (9) is a sequence of matrices.
Equations
Instances For
The matrices match the padded form from its first symbol on.
Equations
- HayesWilson2008.Cx.prefixMatch spec [] x✝ = true
- HayesWilson2008.Cx.prefixMatch spec (m :: ms) (x_2 :: xs) = (decide (HayesWilson2008.Matrix.Matches spec m x_2) && HayesWilson2008.Cx.prefixMatch spec ms xs)
- HayesWilson2008.Cx.prefixMatch spec (head :: tail) [] = false
Instances For
A constraint's violation count on a form is the number of positions of the boundary-padded form at which its matrices match, as (9) specifies.
Equations
- HayesWilson2008.Cx.violations spec c form = (List.filter (HayesWilson2008.Cx.prefixMatch spec c) (none :: List.map some form ++ [none]).tails).length
Instances For
The empty matrix [ ] matches any segment.
Equations
Instances For
Score, maxent value, and probability (§3.2) #
The score (4) of a form is its weighted violation count, with weights in hundredths.
Equations
- HayesWilson2008.score spec con w form = w ⬝ᵥ fun (j : Fin n) => HayesWilson2008.Cx.violations spec (con j) form
Instances For
The maxent value (5) of a form whose score in hundredths is k is exp (−h(x)).
Equations
- HayesWilson2008.maxentValue k = Real.exp (-↑k / 100)
Instances For
Forms with more violations get lower values.
A violation-free form has the highest possible maxent value, 1.
The predicted rating (12) is the maxent value raised to 1 / T for a temperature T.
Equations
- HayesWilson2008.rating T k = HayesWilson2008.maxentValue k ^ (1 / T)
Instances For
The rating orders forms exactly as the score does, so a correlation with the ratings is a claim about the score.
Equations
- HayesWilson2008.instDecidableEqCV x✝ y✝ = if h : x✝.ctorIdx = y✝.ctorIdx then isTrue ⋯ else isFalse ⋯
Equations
- HayesWilson2008.instReprCV = { reprPrec := HayesWilson2008.instReprCV.repr }
Equations
- HayesWilson2008.instReprCV.repr HayesWilson2008.CV.C prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.CV.C")).group prec✝
- HayesWilson2008.instReprCV.repr HayesWilson2008.CV.V prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "HayesWilson2008.CV.V")).group prec✝
Instances For
Table 1 has the constraints *#V and *C#.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The weights of Table 1 are written in hundredths.
Equations
- HayesWilson2008.table1W = ![300, 200]
Instances For
Table 1 gives CV, CVC, and V the maxent values 1, exp (−2), and exp (−3).
Learning the weights (§3.3) #
The observed number of violations of constraint i sums its counts over data given as
counts per form.
Equations
- HayesWilson2008.observed viol D i = ∑ x : Ω, D x * viol i x
Instances For
The log probability of the data (7) sums the log probabilities (6) of the forms, each weighted by its count, since the forms are independent.
Equations
- HayesWilson2008.logLik viol w D = ∑ x : Ω, ↑(D x) * Real.log ((HarmonicGrammar.maxEnt viol.violations w).real {x})
Instances For
The empirical distribution of data given as counts per form.
Equations
- HayesWilson2008.empirical D = ∑ x : Ω, (↑(D x) / ∑ y : Ω, ↑(D y)) • MeasureTheory.Measure.dirac x
Instances For
The log probability of the data is its size times the log-likelihood of its empirical distribution.
The empirical distribution's expected violations are the observed counts over the size of the data.
The partial derivative of the log probability of the data in the weight of constraint i
is its expected count (8), scaled by the size of the data, minus its observed count
([DPDPL97]). The paper's §3.3.2 states the two terms as
O[Cᵢ] − E[Cᵢ], with the penalty direction in mind.
Maximizing the probability of the data is maximizing entropy (§3.3.1, [DPDPL97]). Weights that make the data most probable give the distribution of greatest entropy among those whose expected violations average the observed ones.
The learned grammar for English onsets (Table 4) #
Table 4 lists 23 constraints in the order they were learned.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The weights of Table 4 are written in hundredths.
Equations
- HayesWilson2008.table4W = ![564, 328, 591, 517, 537, 666, 440, 131, 496, 484, 484, 317, 504, 280, 482, 269, 297, 206, 305, 206, 184, 210, 170]
Instances For
The learning data (11) are the onsets of the nonexotic corpus, read off the rows.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Every attested onset is penalized by at most 4.53; most score 0 (§5.3.1).
Exactly ten attested onsets receive penalties, the rarest ones, namely [θ], [z], [θr], [tw], [ʃr], [ð], [dw], [gw], [θw], and [skl] in the corpus order of (11) (§5.3.1).
These are the twelve unattested onsets with the best scores (§5.3.1).
Equations
- One or more equations did not get rendered due to their size.
Instances For
The accidental gap [stw] scores 3.76, followed by [dl] 4.40, [hl] and [hr] 4.82, [vl], [vr], [ʃl], and [ʃw] 4.84, [sr] 4.90, and [fw], [pw], and [spw] 4.96 (§5.3.1).
In the gang of §5.2, constraints #8, #14, and #22, each weighted below the threshold of about 4, together give *[stʃ] the bad score 6.21.
digits cs reads a decimal numeral.
Equations
- HayesWilson2008.digits cs = if cs ≠ [] ∧ cs.all Char.isDigit = true then some (List.foldl (fun (n : ℕ) (c : Char) => 10 * n + (c.toNat - '0'.toNat)) 0 cs) else none
Instances For
hundredths s reads a reported two-decimal score in hundredths.
Equations
- One or more equations did not get rendered due to their size.
Instances For
A row that reports a score is reproduced when its onset parses and the grammar's score is within one hundredth of the reported one.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- HayesWilson2008.instDecidablePredDatumReproduced e = id inferInstance
Every score the paper reports (§5.2–5.3) is reproduced by the grammar to within one hundredth, the rounding of the printed weights.
Probability over a candidate set (§3.2, (6)) #
The candidate set contains the attested onsets and the unattested ones discussed.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The constraints of Table 4 on the candidate set.
Equations
- HayesWilson2008.onsetCon k o = HayesWilson2008.viol k ↑o
Instances For
onsetProb is the probability (6) of each candidate under the learned grammar, with the
weights of Table 4 read as reals.
Equations
- HayesWilson2008.onsetProb o = (HarmonicGrammar.maxEnt HayesWilson2008.onsetCon.violations fun (k : Fin 23) => ↑(HayesWilson2008.table4W k) / 100).real {o}
Instances For
The probability (6) is the softmax of the negated scores (4).
On the candidate set, the probability (6) orders forms as the score does.
The accidental gap [stw] is more probable than [rt].