| 1 |
/* manual_gram.cpp |
| 2 |
* |
| 3 |
* Copyright (C) 1997-2011,2013-2017,2019-2023,2025 Paul Boersma |
| 4 |
* |
| 5 |
* This code is free software; you can redistribute it and/or modify |
| 6 |
* it under the terms of the GNU General Public License as published by |
| 7 |
* the Free Software Foundation; either version 3 of the License, or (at |
| 8 |
* your option) any later version. |
| 9 |
* |
| 10 |
* This code is distributed in the hope that it will be useful, but |
| 11 |
* WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 |
* See the GNU General Public License for more details. |
| 14 |
* |
| 15 |
* You should have received a copy of the GNU General Public License |
| 16 |
* along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 |
*/ |
| 18 |
|
| 19 |
#include "ManPagesM.h" |
| 20 |
#include "OTGrammar.h" |
| 21 |
|
| 22 |
static void draw_NoCoda_pat (Graphics g) { |
| 23 |
autoOTGrammar ot = OTGrammar_create_NoCoda_grammar (); |
| 24 |
OTGrammar_drawTableau (ot.get(), g, false, U"pat"); |
| 25 |
} |
| 26 |
static void draw_NoCoda_reverse (Graphics g) { |
| 27 |
autoOTGrammar ot = OTGrammar_create_NoCoda_grammar (); |
| 28 |
ot -> index [1] = 2; |
| 29 |
ot -> index [2] = 1; |
| 30 |
OTGrammar_drawTableau (ot.get(), g, false, U"pat"); |
| 31 |
} |
| 32 |
static void draw_NPA_assimilate_anpa (Graphics g) { |
| 33 |
autoOTGrammar ot = OTGrammar_create_NPA_grammar (); |
| 34 |
ot -> index [1] = 3; |
| 35 |
ot -> index [2] = 1; |
| 36 |
ot -> index [3] = 2; |
| 37 |
OTGrammar_drawTableau (ot.get(), g, false, U"an+pa"); |
| 38 |
} |
| 39 |
static void draw_NPA_assimilate_atma (Graphics g) { |
| 40 |
autoOTGrammar ot = OTGrammar_create_NPA_grammar (); |
| 41 |
ot -> index [1] = 3; |
| 42 |
ot -> index [2] = 1; |
| 43 |
ot -> index [3] = 2; |
| 44 |
OTGrammar_drawTableau (ot.get(), g, false, U"at+ma"); |
| 45 |
} |
| 46 |
static void draw_NPA_faithful_anpa (Graphics g) { |
| 47 |
autoOTGrammar ot = OTGrammar_create_NPA_grammar (); |
| 48 |
ot -> index [1] = 3; |
| 49 |
ot -> index [2] = 2; |
| 50 |
ot -> index [3] = 1; |
| 51 |
OTGrammar_drawTableau (ot.get(), g, false, U"an+pa"); |
| 52 |
} |
| 53 |
static void draw_NPA_faithful_atma (Graphics g) { |
| 54 |
autoOTGrammar ot = OTGrammar_create_NPA_grammar (); |
| 55 |
ot -> index [1] = 3; |
| 56 |
ot -> index [2] = 2; |
| 57 |
ot -> index [3] = 1; |
| 58 |
OTGrammar_drawTableau (ot.get(), g, false, U"at+ma"); |
| 59 |
} |
| 60 |
static void draw_Wolof_ItI (Graphics g) { |
| 61 |
autoOTGrammar ot = OTGrammar_create_tongueRoot_grammar |
| 62 |
(kOTGrammar_createTongueRootGrammar_constraintSet::FIVE, kOTGrammar_createTongueRootGrammar_ranking::WOLOF); |
| 63 |
OTGrammar_drawTableau (ot.get(), g, false, U"\\ict\\ic"); |
| 64 |
} |
| 65 |
static void draw_Wolof_itE (Graphics g) { |
| 66 |
autoOTGrammar ot = OTGrammar_create_tongueRoot_grammar |
| 67 |
(kOTGrammar_createTongueRootGrammar_constraintSet::FIVE, kOTGrammar_createTongueRootGrammar_ranking::WOLOF); |
| 68 |
OTGrammar_drawTableau (ot.get(), g, false, U"it\\ef"); |
| 69 |
} |
| 70 |
static void draw_Wolof_etE (Graphics g) { |
| 71 |
autoOTGrammar ot = OTGrammar_create_tongueRoot_grammar |
| 72 |
(kOTGrammar_createTongueRootGrammar_constraintSet::FIVE, kOTGrammar_createTongueRootGrammar_ranking::WOLOF); |
| 73 |
OTGrammar_drawTableau (ot.get(), g, false, U"et\\ef"); |
| 74 |
} |
| 75 |
static void draw_Wolof_schwatschwa (Graphics g) { |
| 76 |
autoOTGrammar ot = OTGrammar_create_tongueRoot_grammar |
| 77 |
(kOTGrammar_createTongueRootGrammar_constraintSet::FIVE, kOTGrammar_createTongueRootGrammar_ranking::WOLOF); |
| 78 |
OTGrammar_drawTableau (ot.get(), g, false, U"\\swt\\sw"); |
| 79 |
} |
| 80 |
static void draw_Infant_swtI (Graphics g) { |
| 81 |
autoOTGrammar ot = OTGrammar_create_tongueRoot_grammar |
| 82 |
(kOTGrammar_createTongueRootGrammar_constraintSet::FIVE, kOTGrammar_createTongueRootGrammar_ranking::INFANT); |
| 83 |
ot -> constraints [1]. disharmony = 3; |
| 84 |
ot -> constraints [2]. disharmony = 4; |
| 85 |
ot -> constraints [3]. disharmony = 2; |
| 86 |
ot -> constraints [4]. disharmony = 1; |
| 87 |
ot -> constraints [5]. disharmony = 5; |
| 88 |
OTGrammar_sort (ot.get()); |
| 89 |
OTGrammar_drawTableau (ot.get(), g, false, U"\\swt\\ic"); |
| 90 |
} |
| 91 |
|
| 92 |
void manual_gram_init (ManPages me); |
| 93 |
void manual_gram_init (ManPages me) { |
| 94 |
|
| 95 |
MAN_PAGES_BEGIN |
| 96 |
R"~~~( |
| 97 |
################################################################################ |
| 98 |
"constraints" |
| 99 |
© Paul Boersma 20021105 |
| 100 |
|
| 101 |
In @@Optimality Theory@, the “rules” that an output form has to satisfy. Since there can be many constraints |
| 102 |
and these constraints can conflict with each other, the constraints are %violable and the highest-ranked constraints |
| 103 |
have the largest say in determining the optimal output. |
| 104 |
|
| 105 |
See the @@OT learning@ tutorial for many examples. |
| 106 |
|
| 107 |
################################################################################ |
| 108 |
"Create NoCoda grammar" |
| 109 |
© Paul Boersma 2023 |
| 110 |
|
| 111 |
A command in the ##Constraint grammars# submenu of the @@New menu@, |
| 112 |
for creating an @OTGrammar object with a N\s{O}C\s{ODA} grammar. |
| 113 |
|
| 114 |
The grammar has a structural constraint N\s{O}C\s{ODA}, and a faithfulness constraint P\s{ARSE}. |
| 115 |
There are only two underlying forms: “pa” and “pat”, |
| 116 |
where the latter can have “pa” and “pat” as surface forms. |
| 117 |
|
| 118 |
For a examples using this grammar, see @@OT learning 2.1. Viewing a grammar@. |
| 119 |
|
| 120 |
################################################################################ |
| 121 |
"Create tongue-root grammar..." |
| 122 |
© Paul Boersma 2014,2023 |
| 123 |
|
| 124 |
A command in the ##Constraint grammars# submenu of the @@New menu@, |
| 125 |
for creating an @OTGrammar object with a tongue-root-harmony grammar. |
| 126 |
|
| 127 |
These OTGrammar grammars only accept inputs of the form V_1tV_2, where V_1 and V_2 are |
| 128 |
chosen from the six front vowels i, ɪ, e, ɛ, ə, and a. |
| 129 |
|
| 130 |
The following phonological features are relevant: |
| 131 |
|
| 132 |
| | ATR | RTR |
| 133 |
| high | i | ɪ |
| 134 |
| mid | e | ɛ |
| 135 |
| low | ə | a |
| 136 |
|
| 137 |
Constraints |
| 138 |
=========== |
| 139 |
The resulting OTGrammar will usually contain at least the following five constraints: |
| 140 |
|
| 141 |
*[rtr / hi] |
| 142 |
: “do not implement [retracted tongue root] if the vowel is high.” |
| 143 |
|
| 144 |
*[atr / lo] |
| 145 |
: “do not implement [advanced tongue root] if the vowel is low.” |
| 146 |
|
| 147 |
P\s{ARSE} (rtr) |
| 148 |
: “make an underlying [retracted tongue root] specification surface.” |
| 149 |
|
| 150 |
P\s{ARSE} (atr) |
| 151 |
: “make an underlying [advanced tongue root] specification surface.” |
| 152 |
|
| 153 |
*G\s{ESTURE} (contour) |
| 154 |
: “do not go from advanced to retracted tongue root, nor the other way around, within a word.” |
| 155 |
|
| 156 |
This set of constraints thus comprises: |
| 157 |
• two %%##grounding conditions#% (@@Archangeli & Pulleyblank (1994)@), |
| 158 |
which we can see as gestural constraints; |
| 159 |
• two %%##faithfulness constraints#%, which favour the similarity between input and output, |
| 160 |
and can be seen as implementing the principle of maximization of perceptual contrast; |
| 161 |
• a %%##harmony constraint#%, which, if crucially ranked higher than at least one faithfulness constraint, |
| 162 |
forces %%##tongue-root harmony#%. |
| 163 |
|
| 164 |
In addition, there may be the following four constraints: |
| 165 |
|
| 166 |
*[rtr / mid] |
| 167 |
: “do not implement [retracted tongue root] if the vowel is mid”; universally ranked lower |
| 168 |
than *[rtr / hi]. |
| 169 |
|
| 170 |
*[rtr / lo] |
| 171 |
: “do not implement [retracted tongue root] if the vowel is low”; universally ranked lower |
| 172 |
than *[rtr / mid]. |
| 173 |
|
| 174 |
*[atr / mid] |
| 175 |
: “do not implement [advanced tongue root] if the vowel is mid”; universally ranked lower |
| 176 |
than *[atr / lo]. |
| 177 |
|
| 178 |
*[atr / hi] |
| 179 |
: “do not implement [advanced tongue root] if the vowel is high”; universally ranked lower |
| 180 |
than *[atr / mid]. |
| 181 |
|
| 182 |
The universal rankings referred to are due to the %%##local-ranking principle#% (@@Boersma (1998)@). |
| 183 |
A learning algorithm may enforce this principle, e.g., if *[rtr / hi] falls down the ranking scale, |
| 184 |
*[rtr / mid] may be pushed along. |
| 185 |
|
| 186 |
For information on learning these tongue-root grammars, see @@OT learning@ |
| 187 |
and @@Boersma (2000)@. |
| 188 |
|
| 189 |
################################################################################ |
| 190 |
"Optimality Theory" |
| 191 |
© Paul Boersma 20021105 |
| 192 |
|
| 193 |
A framework for transferring one linguistic representation into another, |
| 194 |
e.g. transferring an underlying form into a surface form. Before @@Prince & Smolensky (1993)@, |
| 195 |
phonologists tended to this with a sequentially ordered set of rules, each of which transferred a representation |
| 196 |
into another. With @OT (that’s the abbreviation), there are no intermediate steps in the derivation, but a set of ranked |
| 197 |
@constraints chooses the optimal output form from a set of candidates. |
| 198 |
|
| 199 |
In Praat, you can draw Optimality-Theoretic tableaus and simulate Optimality-Theoretic learning. |
| 200 |
See the @@OT learning@ tutorial. |
| 201 |
|
| 202 |
################################################################################ |
| 203 |
"OT" |
| 204 |
© Paul Boersma 20021105 |
| 205 |
|
| 206 |
An abbreviation for @@Optimality Theory@. |
| 207 |
|
| 208 |
################################################################################ |
| 209 |
"OT learning" |
| 210 |
© Paul Boersma 20070423 |
| 211 |
|
| 212 |
This tutorial describes how you can draw Optimality-Theoretic and Harmonic-Grammar tableaus and |
| 213 |
simulate Optimality-Theoretic and Harmonic-Grammar learning with Praat. |
| 214 |
|
| 215 |
You can read this tutorial sequentially with the help of the “##< 1#” and “##1 >#” buttons. |
| 216 |
|
| 217 |
1. @@OT learning 1. ||Kinds of grammars@ (ordinal and stochastic, @OTGrammar) |
| 218 |
2. @@OT learning 2. ||The grammar@ |
| 219 |
2.1. @@OT learning 2.1. ||Viewing a grammar@ (N\s{O}C\s{ODA} example, @OTGrammarEditor) |
| 220 |
2.2. @@OT learning 2.2. ||Inside the grammar@ (saving, inspecting) |
| 221 |
2.3. @@OT learning 2.3. ||Defining your own grammar@ |
| 222 |
2.4. @@OT learning 2.4. ||Evaluation@ (noise) |
| 223 |
2.5. @@OT learning 2.5. ||Editing a grammar@ |
| 224 |
2.6. @@OT learning 2.6. ||Variable output@ (place assimilation example) |
| 225 |
2.7. @@OT learning 2.7. ||Tableau pictures@ (printing, EPS) |
| 226 |
2.8. @@OT learning 2.8. ||Asking for one output@ |
| 227 |
2.9. @@OT learning 2.9. ||Output distributions@ |
| 228 |
3. @@OT learning 3. ||Generating language data@ |
| 229 |
3.1. @@OT learning 3.1. ||Data from a pair distribution@ |
| 230 |
3.2. @@OT learning 3.2. ||Data from another grammar@ (tongue-root-harmony example) |
| 231 |
4. @@OT learning 4. ||Learning an ordinal grammar@ |
| 232 |
5. @@OT learning 5. ||Learning a stochastic grammar@ |
| 233 |
6. @@OT learning 6. ||Shortcut to grammar learning@ |
| 234 |
7. @@OT learning 7. ||Learning from overt forms@ |
| 235 |
|
| 236 |
################################################################################ |
| 237 |
"OT learning 1. Kinds of grammars" |
| 238 |
© Paul Boersma 20190331 |
| 239 |
|
| 240 |
This is chapter 1 of the @@OT learning@ tutorial. |
| 241 |
|
| 242 |
According to @@Prince & Smolensky (1993)@, an @@Optimality Theory|Optimality-Theoretic@ (@OT) grammar |
| 243 |
consists of a number of ranked @constraints. |
| 244 |
For every possible input (usually an underlying form), GEN (the generator) generates a (possibly very large) number of |
| 245 |
%%output candidates%, and the ranking order of the constraints determines the winning candidate, |
| 246 |
which becomes the single optimal output. |
| 247 |
|
| 248 |
According to @@Prince & Smolensky (1993)@ and @@Smolensky & Legendre (2006)@, a Harmonic Grammar (HG) |
| 249 |
consists of a number of weighted @constraints. |
| 250 |
The winning candidate, which becomes the single optimal output, is the one with the greatest %harmony, which |
| 251 |
is a measure of goodness determined by the weights of the constraints violated by each candidate. |
| 252 |
|
| 253 |
In OT, ranking is %strict, i.e., if a constraint %A is ranked higher than the constraints %B, %C, and %D, |
| 254 |
a candidate that violates only constraint %A will always be beaten by any candidate that respects %A |
| 255 |
(and any higher constraints), even if it violates %B, %C, and %D. |
| 256 |
|
| 257 |
In HG, weighting is %additive, i.e., a candidate that only violates a constraint %A with a weight of 100 |
| 258 |
has a harmony of -100 and will therefore beat a candidate that violates both a constraint %B with a weight of 70 |
| 259 |
and a constraint %C with a weight of 40 and therefore has a harmony of only -110. Also, two violations of constraint %B |
| 260 |
(harmony 2 * -70 = -140) are worse than one violation of constraint %A (harmony -100). |
| 261 |
|
| 262 |
1. Ordinal OT grammars |
| 263 |
====================== |
| 264 |
Because only the ranking order of the constraints plays a role in evaluating the output candidates, |
| 265 |
Prince & Smolensky took an OT grammar to contain no absolute ranking values, i.e., they accepted only an ordinal relation |
| 266 |
between the constraint rankings. For such a grammar, @@Tesar & Smolensky (1998)@ devised an on-line learning algorithm |
| 267 |
(Error-Driven Constraint Demotion, EDCD) that changes the ranking order |
| 268 |
whenever the form produced by the learner is different from the adult form |
| 269 |
(a corrected version of the algorithm can be found in @@Boersma (2009b)@). Such a learning step |
| 270 |
can sometimes lead to a large change in the behaviour of the grammar. |
| 271 |
|
| 272 |
2. Stochastic OT grammars |
| 273 |
========================= |
| 274 |
The EDCD algorithm is fast and convergent. As a model of language acquisition, however, its drawbacks are that it |
| 275 |
is extremely sensitive to errors in the learning data and that it does not show realistic gradual learning curves. |
| 276 |
For these reasons, @@Boersma (1997)@ |
| 277 |
proposed stochastic OT grammars in which every constraint has a %%ranking value% along a continuous ranking scale, |
| 278 |
and a small amount of %noise is added to this ranking value at evaluation time. |
| 279 |
The associated error-driven on-line learning algorithm (Gradual Learning Algorithm, GLA) effects small changes in the |
| 280 |
ranking values of the constraints with every learning step. An added virtue of the GLA is that it can learn |
| 281 |
languages with optionality and variation, which was something that EDCD could not do. |
| 282 |
For how this algorithm works on some traditional phonological problems, see @@Boersma & Hayes (2001)@. |
| 283 |
|
| 284 |
Ordinal OT grammars can be seen as a special case of the more general stochastic OT grammars: |
| 285 |
they have integer ranking values (%strata) and zero evaluation noise. |
| 286 |
In Praat, therefore, every constraint is taken to have a ranking value, |
| 287 |
so that you can do stochastic as well as ordinal OT. |
| 288 |
|
| 289 |
3. Categorical Harmonic Grammars |
| 290 |
================================ |
| 291 |
@@Jäger (2003)@ and @@Soderstrom, Mathis & Smolensky (2006)@ devised an on-line learning algorithm |
| 292 |
for Harmonic Grammars (stochastic gradient ascent). As proven by @@Fischer (2005)@, |
| 293 |
this algorithm is guaranteed to converge upon a correct grammar, if there exists one that handles the data. |
| 294 |
|
| 295 |
4. Stochastic Harmonic Grammars |
| 296 |
=============================== |
| 297 |
There are two kinds of stochastic models of HG, namely MaxEnt (= Maximum Entropy) grammars |
| 298 |
(@@Smolensky (1986)@, @@Jäger (2003)@), in which the probablity of a candidate winning depends on its harmony, |
| 299 |
and Noisy HG (@@Boersma & Escudero (2008)@, @@Boersma & Pater (2016)@), in which noise is added to constraint weights |
| 300 |
at evaluation time, as in Stochastic OT. |
| 301 |
|
| 302 |
The algorithm by @@Jäger (2003)@ and @@Soderstrom, Mathis & Smolensky (2006)@ |
| 303 |
can learn languages with optionality and variation (@@Boersma & Pater (2016)@). |
| 304 |
|
| 305 |
The OTGrammar object |
| 306 |
==================== |
| 307 |
An OT grammar is implemented as an @OTGrammar object. |
| 308 |
In an OTGrammar object, you specify all the constraints, all the possible inputs and all their possible outputs. |
| 309 |
|
| 310 |
################################################################################ |
| 311 |
"OT learning 2. The grammar" |
| 312 |
© Paul Boersma 20000122 |
| 313 |
|
| 314 |
This is chapter 2 of the @@OT learning@ tutorial. |
| 315 |
|
| 316 |
We can ask the grammar to produce an output form for any input form that is in its list of tableaus. |
| 317 |
|
| 318 |
2.1. @@OT learning 2.1. ||Viewing a grammar@ (N\s{O}C\s{ODA} example, @OTGrammarEditor) |
| 319 |
2.2. @@OT learning 2.2. ||Inside the grammar@ (saving, inspecting) |
| 320 |
2.3. @@OT learning 2.3. ||Defining your own grammar@ |
| 321 |
2.4. @@OT learning 2.4. ||Evaluation@ (noise) |
| 322 |
2.5. @@OT learning 2.5. ||Editing a grammar@ |
| 323 |
2.6. @@OT learning 2.6. ||Variable output@ (place assimilation example) |
| 324 |
2.7. @@OT learning 2.7. ||Tableau pictures@ (printing, EPS files) |
| 325 |
2.8. @@OT learning 2.8. ||Asking for one output@ |
| 326 |
2.9. @@OT learning 2.9. ||Output distributions@ |
| 327 |
|
| 328 |
################################################################################ |
| 329 |
"OT learning 2.1. Viewing a grammar" |
| 330 |
© Paul Boersma 20070725 |
| 331 |
|
| 332 |
Consider a language where the underlying form /pat/ leads to the surface form [pa], |
| 333 |
presumably because the structural constraint N\s{O}C\s{ODA} outranks the faithfulness constraint P\s{ARSE}. |
| 334 |
|
| 335 |
To create such a grammar in Praat, choose @@Create NoCoda grammar@ from the ##Constraint grammmars# submenu of the @@New menu@. |
| 336 |
An @OTGrammar object will then appear in the list of objects. |
| 337 |
If you click ##View & Edit#, an @OTGrammarEditor will show up, containing: |
| 338 |
|
| 339 |
1. the constraint list, sorted by %#disharmony (= ranking value + noise): |
| 340 |
, |
| 341 |
| | %%ranking value% | %disharmony | %plasticity | |
| 342 |
| ##N\s{O}C\s{ODA}# | 100.000 | 100.000 | 1.000 | |
| 343 |
| ##P\s{ARSE}# | 90.000 | 90.000 | 1.000 | |
| 344 |
, |
| 345 |
2. the tableaus for the two possible inputs /pat/ and /pa/: |
| 346 |
{- 3x1 |
| 347 |
Create NoCoda grammar |
| 348 |
Draw tableau: “pat” |
| 349 |
} |
| 350 |
{- 3x0.7 |
| 351 |
Create NoCoda grammar |
| 352 |
Draw tableau: “pa” |
| 353 |
} |
| 354 |
From the first tableau, we see that the underlying form /pat/ will surface as [pa], |
| 355 |
because the alternative [pat] violates a constraint (namely, N\s{O}C\s{ODA}) with a higher disharmony than does [pa], |
| 356 |
which only violates P\s{ARSE}, which has a lower disharmony. |
| 357 |
|
| 358 |
Note the standard OT tableau layout: asterisks (*) showing violations, exclamation marks (!) showing crucial violations, |
| 359 |
greying of cells that do not contribute to determining the winning candidate, and a finger (☞) pointing to the winner |
| 360 |
(this may look like a plus sign (+) if you don’t have the Zapf Dingbats font installed on your computer or printer). |
| 361 |
An HG tableau contains asterisks and a pointing finger, but no exclamation marks or grey cells. |
| 362 |
|
| 363 |
The second tableau shows that /pa/ always surfaces as [pa], which is no wonder since this is |
| 364 |
the only candidate. All cells are grey because none of them contributes to the determination of the winner. |
| 365 |
|
| 366 |
################################################################################ |
| 367 |
)~~~" |
| 368 |
MAN_PAGES_END |
| 369 |
|
| 370 |
MAN_BEGIN (U"OT learning 2.2. Inside the grammar", U"ppgb", 20110129) |
| 371 |
NORMAL (U"You can save an @OTGrammar grammar as a text file by choosing @@Save as text file...@ from the @@Save menu@ " |
| 372 |
"of the Objects window. For the N\\s{O}C\\s{ODA} example, the contents of the file will look like:") |
| 373 |
CODE (U"File type = \"ooTextFile\"") |
| 374 |
CODE (U"Object class = \"OTGrammar 2\"") |
| 375 |
CODE (U"decisionStrategy = <OptimalityTheory>") |
| 376 |
CODE (U"leak = 0") |
| 377 |
CODE (U"2 constraints") |
| 378 |
CODE (U"constraint [1]: \"N\\s{O}C\\s{ODA}\" 100 100 1 ! NOCODA") |
| 379 |
CODE (U"constraint [2]: \"P\\s{ARSE}\" 90 90 1 ! PARSE") |
| 380 |
CODE (U" ") |
| 381 |
CODE (U"0 fixed rankings") |
| 382 |
CODE (U" ") |
| 383 |
CODE (U"2 tableaus") |
| 384 |
CODE (U"input [1]: \"pat\" 2") |
| 385 |
CODE1 (U"candidate [1]: \"pa\" 0 1") |
| 386 |
CODE1 (U"candidate [2]: \"pat\" 1 0") |
| 387 |
CODE (U"input [2]: \"pa\" 1") |
| 388 |
CODE1 (U"candidate [1]: \"pa\" 0 0") |
| 389 |
NORMAL (U"To understand more about this data structure, consult the @OTGrammar class description " |
| 390 |
"or click #Inspect after selecting the OTGrammar object. The “`\\s{...}`” braces ensure that " |
| 391 |
"the constraint names show up with their traditional small capitals (see @@Text styles@).") |
| 392 |
NORMAL (U"You can read this text file into Praat again with @@Read from file...@ from the #Open menu in the Objects window.") |
| 393 |
MAN_END |
| 394 |
|
| 395 |
MAN_BEGIN (U"OT learning 2.3. Defining your own grammar", U"ppgb", 20110129) |
| 396 |
NORMAL (U"By editing a text file created from an example in the @@New menu@, you can define your own OT grammars.") |
| 397 |
NORMAL (U"As explained at @@Save as text file...@, Praat is quite resilient about its text file formats. " |
| 398 |
"As long as the strings and numbers appear in the correct order, you can redistribute the data " |
| 399 |
"across the lines, add all kinds of comments, or leave the comments out. " |
| 400 |
"For the N\\s{O}C\\s{ODA} example, the text file could also have looked like:") |
| 401 |
CODE (U"\"ooTextFile\"") |
| 402 |
CODE (U"\"OTGrammar 2\"") |
| 403 |
CODE (U"<OptimalityTheory>") |
| 404 |
CODE (U"0.0 ! leak") |
| 405 |
CODE (U"2 ! number of constraints") |
| 406 |
CODE (U"\"N\\s{O}C\\s{ODA}\" 100 100 1") |
| 407 |
CODE (U"\"P\\s{ARSE}\" 90 90 1") |
| 408 |
CODE (U"0 ! number of fixed rankings") |
| 409 |
CODE (U"2 ! number of accepted inputs") |
| 410 |
CODE (U"\"pat\" 2 ! input form with number of output candidates") |
| 411 |
CODE1 (U"\"pa\" 0 1 ! first candidate with violations") |
| 412 |
CODE1 (U"\"pat\" 1 0 ! second candidate with violations") |
| 413 |
CODE (U"\"pa\" 1 ! input form with number of candidates") |
| 414 |
CODE1 (U"\"pa\" 0 0") |
| 415 |
NORMAL (U"To define your own grammar, you just provide a number of constraints and their rankings, " |
| 416 |
"and all the possible input forms with all their output candidates, and all the constraint violations " |
| 417 |
"for each candidate. The order in which you specify the constraints is free (you don't have to specify " |
| 418 |
"the highest-ranked first), as long as the violations are in the same order; you could also have reversed " |
| 419 |
"the order of the two input forms, as long as the corresponding candidates follow them; " |
| 420 |
"and, you could also have reversed the order of the candidates within the /pat/ tableau, " |
| 421 |
"as long as the violations follow the output forms. Thus, you could just as well have written:") |
| 422 |
CODE (U"\"ooTextFile\"") |
| 423 |
CODE (U"\"OTGrammar 2\"") |
| 424 |
CODE (U"<OptimalityTheory> 0.0") |
| 425 |
CODE (U"2") |
| 426 |
CODE (U"\"P\\s{ARSE}\" 90 90 1.0") |
| 427 |
CODE (U"\"N\\s{O}C\\s{ODA}\" 100 100 1.0") |
| 428 |
CODE (U"0") |
| 429 |
CODE (U"2") |
| 430 |
CODE (U"\"pa\" 1") |
| 431 |
CODE1 (U"\"pa\" 0 0") |
| 432 |
CODE (U"\"pat\" 2") |
| 433 |
CODE1 (U"\"pat\" 0 1") |
| 434 |
CODE1 (U"\"pa\" 1 0") |
| 435 |
NORMAL (U"The `<OptimalityTheory>` thing in the above refers to the %%decision strategy%. " |
| 436 |
"In this tutorial I mostly assume OT’s strict ranking, " |
| 437 |
"but you can experiment with Smolensky’s `<HarmonicGrammar>` (where the constraint disharmonies represent addable, " |
| 438 |
"possibly negative weights), or with Frank Keller’s `<LinearOT>` (like Harmonic Grammar, but with the restriction " |
| 439 |
"that negative disharmonies do not count), or with `<PositiveHG>` (like Harmonic Grammar, but with the restriction " |
| 440 |
"that disharmonies below 1.0 have weight 1.0), or with `<ExponentialHG>` (where the weights are exp(disharmony), somewhere " |
| 441 |
"between Harmonic Grammar and Linear OT), or with a `<MaximumEntropy>` grammar " |
| 442 |
"(where the probability that a candidate is chosen is proportional to exp(-disharmony)).") |
| 443 |
NORMAL (U"The `leak` thing in the above refers to the amount to which constraint weights (especially in Harmonic Grammar) " |
| 444 |
"can leak while learning.") |
| 445 |
MAN_END |
| 446 |
|
| 447 |
MAN_BEGIN (U"OT learning 2.4. Evaluation", U"ppgb", 20070725) |
| 448 |
NORMAL (U"In an Optimality-Theoretic model of grammar, %#evaluation refers to the determination " |
| 449 |
"of the winning candidate on the basis of the constraint ranking.") |
| 450 |
NORMAL (U"In an ordinal OT model of grammar, repeated evaluations will yield the same winner again and again. " |
| 451 |
"We can simulate this behaviour with our N\\s{O}C\\s{ODA} example. " |
| 452 |
"In the editor, you can choose ##Evaluate (zero noise)# or use its keyboard shortcut @@Keyboard shortcuts|Command-0@ (= Command-zero). " |
| 453 |
"Repeated evaluations (keep Command-0 pressed) will always yield the following grammar:") |
| 454 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 455 |
LIST_ITEM1 (U"\t##N\\s{O}C\\s{ODA}#\t 100.000\t 100.000\t 1.000") |
| 456 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 90.000\t 90.000\t 1.000") |
| 457 |
NORMAL (U"In a stochastic OT model of grammar, repeated evaluations will yield different disharmonies each time. " |
| 458 |
"To see this, choose ##Evaluate (noise 2.0)# or use its keyboard shortcut @@Keyboard shortcuts|Command-2@. " |
| 459 |
"Repeated evaluations will yield grammars like the following:") |
| 460 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 461 |
LIST_ITEM1 (U"\t##N\\s{O}C\\s{ODA}#\t 100.000\t 100.427\t 1.000") |
| 462 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 90.000\t 87.502\t 1.000") |
| 463 |
NORMAL (U"and") |
| 464 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 465 |
LIST_ITEM1 (U"\t##N\\s{O}C\\s{ODA}#\t 100.000\t 101.041\t 1.000") |
| 466 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 90.000\t 90.930\t 1.000") |
| 467 |
NORMAL (U"and") |
| 468 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 469 |
LIST_ITEM1 (U"\t##N\\s{O}C\\s{ODA}#\t 100.000\t 96.398\t 1.000") |
| 470 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 90.000\t 89.482\t 1.000") |
| 471 |
NORMAL (U"The disharmonies vary around the ranking values, " |
| 472 |
"according to a Gaussian distribution with a standard deviation of 2.0. " |
| 473 |
"The winner will still be [pa] in almost all cases, because the probability of bridging " |
| 474 |
"the gap between the two ranking values is very low, namely 0.02 per cent according " |
| 475 |
"to @@Boersma (1998)@, page 332.") |
| 476 |
NORMAL (U"With a noise much higher than 2.0, the chances of P\\s{ARSE} outranking N\\s{O}C\\s{ODA} will rise. " |
| 477 |
"To see this, choose ##Evaluate...# and supply 5.0 for the noise. Typical outcomes are:") |
| 478 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 479 |
LIST_ITEM1 (U"\t##N\\s{O}C\\s{ODA}#\t 100.000\t 92.634\t 1.000") |
| 480 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 90.000\t 86.931\t 1.000") |
| 481 |
NORMAL (U"and") |
| 482 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 483 |
LIST_ITEM1 (U"\t##N\\s{O}C\\s{ODA}#\t 100.000\t 101.162\t 1.000") |
| 484 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 90.000\t 85.311\t 1.000") |
| 485 |
NORMAL (U"and") |
| 486 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 487 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 90.000\t 99.778\t 1.000") |
| 488 |
LIST_ITEM1 (U"\t##N\\s{O}C\\s{ODA}#\t 100.000\t 98.711\t 1.000") |
| 489 |
NORMAL (U"In the last case, the order of the constraints has been reversed. " |
| 490 |
"You will see that [pat] has become the winning candidate:") |
| 491 |
PICTURE (3.0, 1.0, draw_NoCoda_reverse) |
| 492 |
NORMAL (U"However, in the remaining part of this tutorial, we will stick with a noise " |
| 493 |
"with a standard deviation of 2.0. This specific number ensures that we can " |
| 494 |
"model fairly rigid rankings by giving the constraints a ranking difference of 10, a nice round number. " |
| 495 |
"Also, the learning algorithm will separate many constraints in such a way that " |
| 496 |
"the differences between their ranking values are in the vicinity of 10.") |
| 497 |
MAN_END |
| 498 |
|
| 499 |
MAN_BEGIN (U"OT learning 2.5. Editing a grammar", U"ppgb", 20161028) |
| 500 |
NORMAL (U"In the N\\s{O}C\\s{ODA} example, the winning candidate for the input /pat/ was always [pa].") |
| 501 |
NORMAL (U"To make [pat] the winner instead, N\\s{O}C\\s{ODA} should be ranked lower than P\\s{ARSE}. " |
| 502 |
"To achieve this even with zero noise, " |
| 503 |
"go to the OTGrammar window and select the N\\s{O}C\\s{ODA} constraint by clicking on it " |
| 504 |
"(a spade symbol ♠︎ will mark the selected constraint), " |
| 505 |
"and choose ##Edit ranking...# from the Edit menu, or use the keyboard shortcut @@Keyboard shortcuts|Command-E.") |
| 506 |
NORMAL (U"In the resulting command window, we lower the ranking of the constraint from 100 to 80, and click #OK. " |
| 507 |
"This is what you will then see in the OTGrammar window:") |
| 508 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 509 |
LIST_ITEM1 (U"\t♠︎ ##N\\s{O}C\\s{ODA}#\t 80.000\t 103.429\t 1.000") |
| 510 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 90.000\t 88.083\t 1.000") |
| 511 |
PICTURE (3.0, 1.0, draw_NoCoda_pat) |
| 512 |
NORMAL (U"Nothing has happened to the tableau, because the disharmonies still have their old values. So choose " |
| 513 |
"##Evaluate (noise 2.0)# (@@Keyboard shortcuts|Command-2@) or ##Evaluate (zero noise)# (@@Keyboard shortcuts|Command-0@). The new disharmonies " |
| 514 |
"will centre around the new ranking values, and we see that [pat] becomes the new winner:") |
| 515 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 516 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 90.000\t 90.743\t 1.000") |
| 517 |
LIST_ITEM1 (U"\t##N\\s{O}C\\s{ODA}#\t 80.000\t 81.581\t 1.000") |
| 518 |
PICTURE (3.0, 1.0, draw_NoCoda_reverse) |
| 519 |
MAN_END |
| 520 |
|
| 521 |
MAN_BEGIN (U"OT learning 2.6. Variable output", U"ppgb", 20070725) |
| 522 |
NORMAL (U"Each time you press (@@Keyboard shortcuts|Command-2@), which invokes the command ##Evaluate (noise 2.0)# from the #Edit menu, " |
| 523 |
"you will see the disharmonies changing. If the distance between the constraint rankings is 10, however, " |
| 524 |
"the winning candidates will very probably stay the same.") |
| 525 |
NORMAL (U"So starting from the N\\s{O}C\\s{ODA} example, we edit the rankings of the constraints again, " |
| 526 |
"setting the ranking value of P\\s{ARSE} to 88 and that of N\\s{O}C\\s{ODA} to 85. If we now press @@Keyboard shortcuts|Command-2@ " |
| 527 |
"repeatedly, we will get [pat] in most of the cases, " |
| 528 |
"but we will see the finger pointing at [pa] in 14 percent of the cases:") |
| 529 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 530 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 88.000\t 87.421\t 1.000") |
| 531 |
LIST_ITEM1 (U"\t##N\\s{O}C\\s{ODA}#\t 85.000\t 85.585\t 1.000") |
| 532 |
PICTURE (3.0, 1.0, draw_NoCoda_reverse) |
| 533 |
NORMAL (U"but") |
| 534 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 535 |
LIST_ITEM1 (U"\t##N\\s{O}C\\s{ODA}#\t 85.000\t 87.128\t 1.000") |
| 536 |
LIST_ITEM1 (U"\t##P\\s{ARSE}#\t 88.000\t 85.076\t 1.000") |
| 537 |
PICTURE (3.0, 1.0, draw_NoCoda_pat) |
| 538 |
NORMAL (U"As a more functionally oriented example, we consider nasal place assimilation. " |
| 539 |
"Suppose that the underlying sequence /an+pa/ surfaces as the assimilated [ampa] " |
| 540 |
"in 80 percent of the cases, and as the faithful [anpa] in the remaining 20 percent, " |
| 541 |
"while the non-nasal stop /t/ never assimilates. " |
| 542 |
"This can be achieved by having the articulatory constraint *G\\s{ESTURE} " |
| 543 |
"ranked at a short distance above *R\\s{EPLACE} (n, m):") |
| 544 |
CODE (U"\"ooTextFile\"") |
| 545 |
CODE (U"\"OTGrammar 2\"") |
| 546 |
CODE (U"decisionStrategy = <OptimalityTheory>") |
| 547 |
CODE (U"leak = 0.0") |
| 548 |
CODE (U"3 constraints") |
| 549 |
CODE (U"\"*G\\s{ESTURE}\" 102.7 0 1") |
| 550 |
CODE (U"\"*R\\s{EPLACE} (n, m)\" 100.0 0 1") |
| 551 |
CODE (U"\"*R\\s{EPLACE} (t, p)\" 112.0 0 1") |
| 552 |
CODE (U"0 fixed rankings") |
| 553 |
CODE (U"2 tableaus") |
| 554 |
CODE (U"\"an+pa\" 2") |
| 555 |
CODE1 (U"\"anpa\" 1 0 0") |
| 556 |
CODE1 (U"\"ampa\" 0 1 0") |
| 557 |
CODE (U"\"at+ma\" 2") |
| 558 |
CODE1 (U"\"atma\" 1 0 0") |
| 559 |
CODE1 (U"\"apma\" 0 0 1") |
| 560 |
NORMAL (U"You can create this grammar with ##Create place assimilation grammar# from the @@New menu@. " |
| 561 |
"In the editor, it will often look like follows:") |
| 562 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 563 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (t, p)#\t 112.000\t 109.806\t 1.000") |
| 564 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE}#\t 102.700\t 102.742\t 1.000") |
| 565 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (n, m)#\t 100.000\t 101.044\t 1.000") |
| 566 |
PICTURE (4.0, 1.0, draw_NPA_assimilate_anpa) |
| 567 |
PICTURE (4.0, 1.0, draw_NPA_assimilate_atma) |
| 568 |
NORMAL (U"If you keep the Command-2 keys pressed, however, you will see that the tableaus change " |
| 569 |
"into something like the following in approximately 20 percent of the cases:") |
| 570 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 571 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (t, p)#\t 112.000\t 113.395\t 1.000") |
| 572 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (n, m)#\t 100.000\t 103.324\t 1.000") |
| 573 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE}#\t 102.700\t 101.722\t 1.000") |
| 574 |
PICTURE (4.0, 1.0, draw_NPA_faithful_anpa) |
| 575 |
PICTURE (4.0, 1.0, draw_NPA_faithful_atma) |
| 576 |
NORMAL (U"We see that /at+ma/ always surfaces at [atma], because *R\\s{EPLACE} (t, p) is ranked much higher " |
| 577 |
"than the other two, and that the output of /an+pa/ is variable because of the close rankings " |
| 578 |
"of *G\\s{ESTURE} and *R\\s{EPLACE} (n, m).") |
| 579 |
NORMAL (U"If you try this with a Harmonic Grammar or in Linear OT, you will see the same kind of variation. " |
| 580 |
"Although in HG, e.g. in @@Smolensky & Legendre (2006)@, the variation is usually obtained at the candidate level, " |
| 581 |
"namely by giving each candidate a probability proportional to exp(%harmony/%temperature), " |
| 582 |
"in our version of HG the variation comes about at the constraint level, " |
| 583 |
"namely by the noise that is temporarily added to the ranking of each constraint at evaluation time.") |
| 584 |
MAN_END |
| 585 |
|
| 586 |
MAN_BEGIN (U"OT learning 2.7. Tableau pictures", U"ppgb", 20110129) |
| 587 |
NORMAL (U"To show a tableau in the @@Picture window@ instead of in the editor, " |
| 588 |
"you select an @OTGrammar object and click ##Draw tableau...#. " |
| 589 |
"After you specify the input form, a tableau is drawn with the current font and size " |
| 590 |
"at the location of the current selection (%viewport) in the Picture window. The top left corner of the tableau " |
| 591 |
"is aligned with the top left corner of the selection. You can draw more than one object into the Picture " |
| 592 |
"window, whose menus also allow you to add a lot of graphics of your own design.") |
| 593 |
NORMAL (U"Besides printing the entire picture (with @@Print...@), you can save a part of it to an EPS file " |
| 594 |
"for inclusion into your favourite word processor (with @@Save as EPS file...@). " |
| 595 |
"For the latter to succeed, make sure that the selection includes at least your tableau; " |
| 596 |
"otherwise, some part of your tableau may end up truncated.") |
| 597 |
MAN_END |
| 598 |
|
| 599 |
MAN_BEGIN (U"OT learning 2.8. Asking for one output", U"ppgb", 20110808) |
| 600 |
NORMAL (U"To ask the grammar to produce a single output for a specified input form, " |
| 601 |
"you can choose @@OTGrammar: Input to output...@. The command window will ask you to provide " |
| 602 |
"an input form and the strength of the noise (the standard value is 2.0 again). " |
| 603 |
"This will perform an evaluation and write the result into the Info window.") |
| 604 |
NORMAL (U"If you are viewing the grammar in the @OTGrammarEditor, you will see the disharmonies change, " |
| 605 |
"and if the grammar allows variation, you will see that the winner in the tableau in the editor " |
| 606 |
"varies with the winner shown in the Info window.") |
| 607 |
NORMAL (U"Since the editor shows more information than the Info window, " |
| 608 |
"this command is not very useful except for purposes of scripting. " |
| 609 |
"See the following page for some related but more useful commands.") |
| 610 |
MAN_END |
| 611 |
|
| 612 |
MAN_BEGIN (U"OT learning 2.9. Output distributions", U"ppgb", 20110808) |
| 613 |
NORMAL (U"To ask the grammar to produce %many outputs for a specified input form, " |
| 614 |
"and collect them in a @Strings object, " |
| 615 |
"you select an @OTGrammar and choose @@OTGrammar: Input to outputs...|Input to outputs...@.") |
| 616 |
NORMAL (U"For example, select the object “OTGrammar assimilation” from our place assimilation example " |
| 617 |
"(@@OT learning 2.6. Variable output|§2.6@), and click ##Input to outputs...#. " |
| 618 |
"In the resulting command window, you specify 1000 trials, a noise strength of 2.0, and “an+pa” for the input form.") |
| 619 |
NORMAL (U"After you click #OK, a @Strings object will appear in the list. " |
| 620 |
"If you click Info, you will see that it contains 1000 strings. " |
| 621 |
"If you click Inspect, you will see that most of the strings are “ampa”, " |
| 622 |
"but some of them are “anpa”. These are the output forms computed from 1000 evaluations " |
| 623 |
"for the input /an+pa/.") |
| 624 |
NORMAL (U"To count how many instances of [ampa] and [anpa] were generated, you select the @Strings object " |
| 625 |
"and click @@Strings: To Distributions|To Distributions@. You will see a new @Distributions object appear in the list. " |
| 626 |
"If you draw this to the Picture window (with ##Draw as numbers...#), you will see something like:") |
| 627 |
LIST_ITEM (U"\tampa\t815") |
| 628 |
LIST_ITEM (U"\tanpa\t185") |
| 629 |
NORMAL (U"which means that our grammar, when fed with 1000 /an+pa/ inputs, produced [ampa] 815 times, " |
| 630 |
"and [anpa] 185 times, which is consistent with our initial guess that a ranking difference of 2.7 " |
| 631 |
"would cause approximately an 80\\% - 20\\% distribution of [ampa] and [anpa].") |
| 632 |
ENTRY (U"Checking the distribution hypothesis") |
| 633 |
NORMAL (U"To see whether the guess of a 2.7 ranking difference is correct, we perform 1,000,000 trials instead of 1000. " |
| 634 |
"The output distribution (if you have enough memory in your computer) becomes something like " |
| 635 |
"(set the %Precision to 7 in the #Draw command window):") |
| 636 |
LIST_ITEM (U"\tampa\t830080") |
| 637 |
LIST_ITEM (U"\tanpa\t169920") |
| 638 |
NORMAL (U"The expected values under the 80\\% - 20\\% distribution hypothesis are:") |
| 639 |
LIST_ITEM (U"\tampa\t800000") |
| 640 |
LIST_ITEM (U"\tanpa\t200000") |
| 641 |
NORMAL (U"We compute (e.g. with @@Calculator...@) a %χ^2 of 30080^2/800000 + 30080^2/200000 = 5655.04, " |
| 642 |
"which, of course, is much too high for a distribution with a single degree of freedom. " |
| 643 |
"So the ranking difference must be smaller. If it is 2.4 (change the ranking of *G\\s{ESTURE} to 102.4), " |
| 644 |
"the numbers become something like") |
| 645 |
LIST_ITEM (U"\tampa\t801974") |
| 646 |
LIST_ITEM (U"\tanpa\t198026") |
| 647 |
NORMAL (U"which gives a %χ^2 of 24.35. By using the Calculator with the formula `chiSquareQ (24.35, 1)`, " |
| 648 |
"we find that values larger than this have a probability of 8·10^^-7^ " |
| 649 |
"under the 80\\% - 20\\% distribution hypothesis, which must therefore be rejected again.") |
| 650 |
NORMAL (U"Rather than continuing this iterative procedure to find the correct ranking values for an " |
| 651 |
"80\\% - 20\\% grammar, we will use the Gradual Learning Algorithm " |
| 652 |
"(@@OT learning 5. Learning a stochastic grammar|§5@) to determine the rankings automatically, " |
| 653 |
"without any memory of past events other than the memory associated with maintaining the ranking values.") |
| 654 |
ENTRY (U"Measuring all inputs") |
| 655 |
NORMAL (U"To measure the outcomes of all the possible inputs at once, you select an @OTGrammar " |
| 656 |
"and choose @@OTGrammar: To output Distributions...|To output Distributions...@. " |
| 657 |
"As an example, try this on our place assimilation grammar. You can supply 1000000 for the number of trials, " |
| 658 |
"and the usual 2.0 for the standard deviation of the noise. " |
| 659 |
"After you click #OK, a @Distributions object will appear in the list. " |
| 660 |
"If you draw this to the Picture window, the result will look like:") |
| 661 |
LIST_ITEM (U"\t/an+pa/ \\-> anpa\t169855") |
| 662 |
LIST_ITEM (U"\t/an+pa/ \\-> ampa\t830145") |
| 663 |
LIST_ITEM (U"\t/at+ma/ \\-> atma\t999492") |
| 664 |
LIST_ITEM (U"\t/at+ma/ \\-> apma\t508") |
| 665 |
NORMAL (U"We see that the number of [apma] outputs is not zero. This is due to the difference of 9.3 " |
| 666 |
"between the rankings of *R\\s{EPLACE} (t, p) and *G\\s{ESTURE}. If you rank " |
| 667 |
"*R\\s{EPLACE} (t, p) at 116.0, the number of produced [apma] reduces to about one in a million, " |
| 668 |
"as you can easily check with some patience.") |
| 669 |
MAN_END |
| 670 |
|
| 671 |
MAN_BEGIN (U"OT learning 3. Generating language data", U"ppgb", 20021204) |
| 672 |
NORMAL (U"A learner needs two things: a grammar that she can adjust (@@OT learning 2. The grammar|\\SS2@), and language data.") |
| 673 |
LIST_ITEM (U"3.1. @@OT learning 3.1. Data from a pair distribution|Data from a pair distribution@") |
| 674 |
LIST_ITEM (U"3.2. @@OT learning 3.2. Data from another grammar|Data from another grammar@ (tongue-root-harmony example)") |
| 675 |
MAN_END |
| 676 |
|
| 677 |
MAN_BEGIN (U"OT learning 3.1. Data from a pair distribution", U"ppgb", 20110131) |
| 678 |
NORMAL (U"If the grammar contains faithfulness constraints, the learner needs pairs of " |
| 679 |
"underlying and adult surface forms. For our place assimilation example, she needs a lot of " |
| 680 |
"/at+ma/ - [atma] pairs, and four times as many /an+pa/ - [ampa] pairs as /an+pa/ - [anpa] pairs. " |
| 681 |
"We can specify this language-data distribution in a @PairDistribution object, " |
| 682 |
"which we could simply save as a text file:") |
| 683 |
CODE (U"\"ooTextFile\"") |
| 684 |
CODE (U"\"PairDistribution\"") |
| 685 |
CODE (U"4 pairs") |
| 686 |
CODE (U"\"at+ma\" \"atma\" 100") |
| 687 |
CODE (U"\"at+ma\" \"apma\" 0") |
| 688 |
CODE (U"\"an+pa\" \"anpa\" 20") |
| 689 |
CODE (U"\"an+pa\" \"ampa\" 80") |
| 690 |
NORMAL (U"The values appear to represent percentages, but they could also have been 1.0, 0.0, 0.2, and 0.8, " |
| 691 |
"or any other values with the same proportions. We could also have left out the second pair " |
| 692 |
"and specified “3 pairs” instead of “4 pairs” in the third line.") |
| 693 |
NORMAL (U"We can create this pair distribution with ##Create place assimilation distribution# from the " |
| 694 |
"Optimality Theory submenu of the @@New menu@ in the Objects window. To see that it really contains " |
| 695 |
"the above data, you can draw it to the Picture window. To change the values, use Inspect " |
| 696 |
"(in which case you should remember to click Change after any change).") |
| 697 |
NORMAL (U"To generate input-output pairs from the above distribution, select the @PairDistribution and click " |
| 698 |
"@@PairDistribution: To Stringses...|To Stringses...@. " |
| 699 |
"If you then just click #OK, there will appear two @Strings objects in the list, called “input” " |
| 700 |
"(underlying forms) and “output” (surface forms). Both contain 1000 strings. If you Inspect them both, " |
| 701 |
"you can see that e.g. the 377th string in “input” corresponds to the 377th string in “output”, " |
| 702 |
"i.e., the two series of strings are aligned. See also the example at @@PairDistribution: To Stringses...@.") |
| 703 |
NORMAL (U"These two Strings objects are sufficient to help an @OTGrammar grammar to change its constraint rankings " |
| 704 |
"in such a way that the output distributions generated by the grammar match the output distributions " |
| 705 |
"in the language data. See @@OT learning 5. Learning a stochastic grammar|§5@.") |
| 706 |
MAN_END |
| 707 |
|
| 708 |
MAN_BEGIN (U"OT learning 3.2. Data from another grammar", U"ppgb", 20110128) |
| 709 |
NORMAL (U"Instead of generating input-output pairs directly from a @PairDistribution object, " |
| 710 |
"you can also generate input forms and their winning outputs from an @OTGrammar grammar. Of course, " |
| 711 |
"that’s what the language data presented to real children comes from. Our example will be " |
| 712 |
"a tongue-root harmony grammar.") |
| 713 |
NORMAL (U"Choose @@Create tongue-root grammar...@ from the Optimality Theory submenu of the @@New menu@. " |
| 714 |
"Set ##Constraint set# to #Five, and #Ranking to #Wolof. Click #OK. An object called " |
| 715 |
"“OTGrammar Wolof” will appear in the list. Click ##View & Edit#. You will see the following grammar " |
| 716 |
"appear in the @OTGrammarEditor:") |
| 717 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 718 |
LIST_ITEM1 (U"\t##*[rtr / hi]#\t 100.000\t 100.000\t 1.000") |
| 719 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (rtr)#\t 50.000\t 50.000\t 1.000") |
| 720 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE} (contour)#\t 30.000\t 30.000\t 1.000") |
| 721 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (atr)#\t 20.000\t 20.000\t 1.000") |
| 722 |
LIST_ITEM1 (U"\t##*[atr / lo]#\t 10.000\t 10.000\t 1.000") |
| 723 |
NORMAL (U"This simplified Wolof grammar, with five constraints with clearly different rankings, is equivalent " |
| 724 |
"to the traditional OT ranking") |
| 725 |
EQUATION (U"*[rtr / hi] >> P\\s{ARSE} (rtr) >> *G\\s{ESTURE} (contour) >> P\\s{ARSE} (atr) >> *[atr / lo]") |
| 726 |
NORMAL (U"These constraints are based on a description of Wolof by " |
| 727 |
"@@Archangeli & Pulleyblank (1994)|Archangeli & Pulleyblank (1994: 225–239)@. " |
| 728 |
"For the meaning of these constraints, see @@Boersma (1998)|Boersma (1998: 295)@, " |
| 729 |
"or the @@Create tongue-root grammar...@ manual page.") |
| 730 |
NORMAL (U"For each input, there are four output candidates: " |
| 731 |
"the vowel heights will be the same as those in the input, but the tongue-root values of V__1_ and V__2_ are varied. " |
| 732 |
"For example, for the input [ita] we will have the four candidates " |
| 733 |
"[ita], [itə], [ɪta], and [ɪtə].") |
| 734 |
NORMAL (U"With this way of generating candidates, we see that the five constraints are completely ranked. " |
| 735 |
"First, the absolute prohibition on surface [ɪ] shows that *[rtr / hi] outranks RTR faithfulness " |
| 736 |
"(otherwise, [ɪtɪ] would have been the winner):") |
| 737 |
PICTURE (4.0, 1.5, draw_Wolof_ItI) |
| 738 |
NORMAL (U"Second, the faithful surfacing of the disharmonic /itɛ/ shows that RTR faithfulness must outrank " |
| 739 |
"the harmony (anti-contour) constraint (otherwise, [ite] would have been the winner):") |
| 740 |
PICTURE (4.0, 1.5, draw_Wolof_itE) |
| 741 |
NORMAL (U"Third, the RTR-dominant harmonicization of underlying disharmonic /etɛ/ shows that harmony must outrank ATR faithfulness " |
| 742 |
"(otherwise, [etɛ] would have won):") |
| 743 |
PICTURE (4.0, 1.5, draw_Wolof_etE) |
| 744 |
NORMAL (U"Finally, the faithful surfacing of the low ATR vowel /ə/ even if not forced by harmony, shows that " |
| 745 |
"ATR faithfulness outranks *[atr / lo] (otherwise, [ata] would have been the winning candidate):") |
| 746 |
PICTURE (4.0, 1.5, draw_Wolof_schwatschwa) |
| 747 |
NORMAL (U"These four ranking arguments clearly establish the crucial rankings of all five constraints.") |
| 748 |
ENTRY (U"Generating inputs from the grammar") |
| 749 |
NORMAL (U"According to @@Prince & Smolensky (1993)@, the input to an OT grammar can be %anything. " |
| 750 |
"This is the idea of %%##richness of the base%#. " |
| 751 |
"When doing a practical investigation, however, we are only interested in the inputs " |
| 752 |
"that will illustrate the properties of our partial grammars. " |
| 753 |
"In the case of simplified Wolof, this means the 36 possible V__1_tV__2_ sequences " |
| 754 |
"where V__1_ and V__2_ are any of the six front vowels i, ɪ, e, ɛ, ə, and a " |
| 755 |
"(see @@Create tongue-root grammar...@).") |
| 756 |
NORMAL (U"A set of inputs can be generated from an @OTGrammar object by inspecting the list of tableaus. " |
| 757 |
"So select the Wolof tongue-root grammar and choose @@OTGrammar: Generate inputs...|Generate inputs...@. " |
| 758 |
"Set %%Number of trials% to 100, and click #OK. A @Strings object named `Wolof_in` " |
| 759 |
"will appear in the list. Click Inspect and examine the 100 input strings. " |
| 760 |
"You will see that they have been randomly chosen from the 36 possible V__1_tV__2_ sequences " |
| 761 |
"as described at @@Create tongue-root grammar...@:") |
| 762 |
EQUATION (U"ɛta, etɛ, ɛti, itɛ, ɛtɛ, iti, ɛtɪ, itɪ, ɪti, etɛ, ...") |
| 763 |
NORMAL (U"Thus, when asked to generate a random input, these grammars produce any of the 36 possible V__1_tV__2_ " |
| 764 |
"sequences, all with equal probability.") |
| 765 |
ENTRY (U"Generating outputs from the grammar") |
| 766 |
NORMAL (U"To compute the outputs for the above set of input forms, select %both the @OTGrammar object " |
| 767 |
"%and the input @Strings object, and choose @@OTGrammar & Strings: Inputs to outputs...|Inputs to outputs...@, " |
| 768 |
"perhaps specifying zero evaluation noise. " |
| 769 |
"A new Strings objects called `Wolof_out` will appear in the list. " |
| 770 |
"If you Inspect it, you will see that it contains a string sequence aligned with the original input strings:") |
| 771 |
EQUATION (U"ɛta, ɛtɛ, ɛti, itɛ, ɛtɛ, iti, ɛti, iti, iti, ɛtɛ, ...") |
| 772 |
NORMAL (U"In this way, we have created two Strings objects, which together form a series of input-output pairs " |
| 773 |
"needed for learning a grammar that contains faithfulness constraints.") |
| 774 |
MAN_END |
| 775 |
|
| 776 |
MAN_BEGIN (U"OT learning 4. Learning an ordinal grammar", U"ppgb", 20190331) |
| 777 |
NORMAL (U"With the data from a tongue-root-harmony language with five completely ranked constraints, " |
| 778 |
"we can have a throw at learning this language, starting with a grammar in which all the constraints " |
| 779 |
"are ranked at the same height, or randomly ranked, or with articulatory constraints outranking " |
| 780 |
"faithfulness constraints.") |
| 781 |
NORMAL (U"Let’s try the third of these. Create an infant tongue-root grammar by choosing " |
| 782 |
"@@Create tongue-root grammar...@ and specifying “Five” for the constraint set " |
| 783 |
"and “Infant” for the ranking. The result after a single evaluation will be like:") |
| 784 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 785 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE} (contour)#\t 100.000\t 100.631\t 1.000") |
| 786 |
LIST_ITEM1 (U"\t##*[atr / lo]#\t 100.000\t 100.244\t 1.000") |
| 787 |
LIST_ITEM1 (U"\t##*[rtr / hi]#\t 100.000\t 97.086\t 1.000") |
| 788 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (rtr)#\t 50.000\t 51.736\t 1.000") |
| 789 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (atr)#\t 50.000\t 46.959\t 1.000") |
| 790 |
NORMAL (U"Such a grammar produces all kinds of non-adult results. For instance, the input /ətɪ/ " |
| 791 |
"will surface as [atɪ]:") |
| 792 |
PICTURE (4.0, 1.5, draw_Infant_swtI) |
| 793 |
NORMAL (U"The adult form is very different: [əti]. The cause of the discrepancy is in the order of " |
| 794 |
"the constraints *[atr / lo] and *[rtr / hi], which militate against [ə] and [ɪ], respectively. " |
| 795 |
"Simply reversing the rankings of these two constraints would solve the problem in this case. " |
| 796 |
"More generally, @@Tesar & Smolensky (1998)@ claim that demoting all the constraints that cause the " |
| 797 |
"adult form to lose into the stratum just below the highest-ranked constraint " |
| 798 |
"violated in the learner's form (here, moving *[atr / lo] just below *[rtr / hi] " |
| 799 |
"into the same stratum as P\\s{ARSE} (rtr)), " |
| 800 |
"will guarantee convergence to the target grammar, " |
| 801 |
"%%if there is no variation in the data% (Tesar & Smolensky's algorithm is actually incorrect, " |
| 802 |
"but can be repaired easily, as shown by @@Boersma (2009b)@).") |
| 803 |
NORMAL (U"But Tesar & Smolensky's algorithm cannot be used for variable data, since all constraints would be " |
| 804 |
"tumbling down, exchanging places and producing wildly different grammars at each learning step. " |
| 805 |
"Since language data do tend to be variable, we need a gradual and balanced learning algorithm, " |
| 806 |
"and the following algorithm is guaranteed to converge " |
| 807 |
"to the target language, if that language can be described by a stochastic OT grammar.") |
| 808 |
NORMAL (U"The reaction of the learner to hearing the mismatch between the adult [əti] and her own [atɪ], " |
| 809 |
"is simply:") |
| 810 |
LIST_ITEM (U"1. to move the constraints violated in her own form, i.e. *[rtr / hi] and P\\s{ARSE} (atr), " |
| 811 |
"up by a small step along the ranking scale, thus decreasing the probability that her form will be the winner " |
| 812 |
"at the next evaluation of the same input;") |
| 813 |
LIST_ITEM (U"2. and to move the constraints violated in the adult form, namely *[atr / lo] and P\\s{ARSE} (rtr), " |
| 814 |
"down along the ranking scale, thus increasing the probability that the adult form will be the learner's " |
| 815 |
"winner the next time.") |
| 816 |
NORMAL (U"If the small reranking step (the %#plasticity) is 0.1, the grammar will become:") |
| 817 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 818 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE} (contour)#\t 100.000\t 100.631\t 1.000") |
| 819 |
LIST_ITEM1 (U"\t##*[atr / lo]#\t 99.900\t 100.244\t 1.000") |
| 820 |
LIST_ITEM1 (U"\t##*[rtr / hi]#\t 100.100\t 97.086\t 1.000") |
| 821 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (rtr)#\t 49.900\t 51.736\t 1.000") |
| 822 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (atr)#\t 50.100\t 46.959\t 1.000") |
| 823 |
NORMAL (U"The disharmonies, of course, will be different at the next evaluation, with a probability slightly higher " |
| 824 |
"than 50\\% that *[rtr / hi] will outrank *[atr / lo]. Thus the relative rankings of these two grounding " |
| 825 |
"constraints have moved into the direction of the adult grammar, in which they are ranked at opposite " |
| 826 |
"ends of the grammar.") |
| 827 |
NORMAL (U"Note that the relative rankings of P\\s{ARSE} (atr) and P\\s{ARSE} (rtr) are " |
| 828 |
"now moving in a direction opposite to where they will have to end up in this RTR-dominant language. " |
| 829 |
"This does not matter: the procedure will converge nevertheless.") |
| 830 |
NORMAL (U"We are now going to simulate the infant who learns simplified Wolof. Take an adult Wolof grammar " |
| 831 |
"and generate 1000 input strings and the corresponding 1000 output strings " |
| 832 |
"following the procedure described in @@OT learning 3.2. Data from another grammar|§3.2@. " |
| 833 |
"Now select the infant @OTGrammar and both @Strings objects, and choose @@OTGrammar & 2 Strings: Learn...|Learn...@. " |
| 834 |
"After you click #OK, the learner processes each of the 1000 input-output pairs in succession, " |
| 835 |
"gradually changing the constraint ranking in case of a mismatch. The resulting grammar may look like:") |
| 836 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 837 |
LIST_ITEM1 (U"\t##*[rtr / hi]#\t 100.800\t 98.644\t 1.000") |
| 838 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE} (contour)#\t 89.728\t 94.774\t 1.000") |
| 839 |
LIST_ITEM1 (U"\t##*[atr / lo]#\t 89.544\t 86.442\t 1.000") |
| 840 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (rtr)#\t 66.123\t 65.010\t 1.000") |
| 841 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (atr)#\t 63.553\t 64.622\t 1.000") |
| 842 |
NORMAL (U"We already see some features of the target grammar, namely the top ranking of *[rtr / hi] " |
| 843 |
"and RTR dominance (the mutual ranking of the P\\s{ARSE} constraints). The steps have not been exactly 0.1, " |
| 844 |
"because we also specified a relative plasticity spreading of 0.1, thus giving steps typically in the range of 0.7 to 1.3. " |
| 845 |
"The step is also multiplied by the %%constraint plasticity%, which is simply 1.000 in all examples in this tutorial; " |
| 846 |
"you could set it to 0.0 to prevent a constraint from moving up or down at all. " |
| 847 |
"The %leak is the part of the constraint weight (especially in Harmonic Grammar) that is thrown away whenever a constraint is reranked; " |
| 848 |
"e.g if the leak is 0.01 and the step is 0.11, the constraint weight is multiplied by (1 – 0.01·0.11) = 0.9989 before " |
| 849 |
"the learning step is taken; in this way you could implement forgetful learning of correlations.") |
| 850 |
NORMAL (U"After learning once more with the same data, the result is:") |
| 851 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 852 |
LIST_ITEM1 (U"\t##*[rtr / hi]#\t 100.800\t 104.320\t 1.000") |
| 853 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (rtr)#\t 81.429\t 82.684\t 1.000") |
| 854 |
LIST_ITEM1 (U"\t##*[atr / lo]#\t 79.966\t 78.764\t 1.000") |
| 855 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE} (contour)#\t 81.316\t 78.166\t 1.000") |
| 856 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (atr)#\t 77.991\t 77.875\t 1.000") |
| 857 |
NORMAL (U"This grammar now sometimes produces faithful disharmonic utterances, because the P\\s{ARSE} now often " |
| 858 |
"outrank the gestural constraints at evaluation time. But there is still a lot of variation produced. " |
| 859 |
"Learning once more with the same data gives:") |
| 860 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 861 |
LIST_ITEM1 (U"\t##*[rtr / hi]#\t 100.800\t 100.835\t 1.000") |
| 862 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (rtr)#\t 86.392\t 82.937\t 1.000") |
| 863 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE} (contour)#\t 81.855\t 81.018\t 1.000") |
| 864 |
LIST_ITEM1 (U"\t##*[atr / lo]#\t 78.447\t 78.457\t 1.000") |
| 865 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (atr)#\t 79.409\t 76.853\t 1.000") |
| 866 |
NORMAL (U"By inspecting the first column, you can see that the ranking values are already in the same order as in the target grammar, " |
| 867 |
"so that the learner will produce 100 percent correct adult utterances if her evaluation noise is zero. However, " |
| 868 |
"with a noise of 2.0, there will still be variation. For instance, the disharmonies above will " |
| 869 |
"produce [ata] instead of [ətə] for underlying /ətə/. Learning seven times more " |
| 870 |
"with the same data gives a reasonable proficiency:") |
| 871 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 872 |
LIST_ITEM1 (U"\t##*[rtr / hi]#\t 100.800\t 99.167\t 1.000") |
| 873 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (rtr)#\t 91.580\t 93.388\t 1.000") |
| 874 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE} (contour)#\t 85.487\t 86.925\t 1.000") |
| 875 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (atr)#\t 80.369\t 78.290\t 1.000") |
| 876 |
LIST_ITEM1 (U"\t##*[atr / lo]#\t 75.407\t 74.594\t 1.000") |
| 877 |
NORMAL (U"No input forms have error rates above 4 percent now, so the child has learned a lot with only 10,000 data, " |
| 878 |
"which may be on the order of the number of input data she receives every day.") |
| 879 |
NORMAL (U"We could have sped up the learning process appreciably by using a plasticity of 1.0 instead of 0.1. " |
| 880 |
"This would have given a comparable grammar after only 1000 data. After 10,000 data, we would have") |
| 881 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 882 |
LIST_ITEM1 (U"\t##*[rtr / hi]#\t 107.013\t 104.362\t 1.000") |
| 883 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (rtr)#\t 97.924\t 99.984\t 1.000") |
| 884 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE} (contour)#\t 89.679\t 89.473\t 1.000") |
| 885 |
LIST_ITEM1 (U"\t##P\\s{ARSE} (atr)#\t 81.479\t 83.510\t 1.000") |
| 886 |
LIST_ITEM1 (U"\t##*[atr / lo]#\t 73.067\t 72.633\t 1.000") |
| 887 |
NORMAL (U"With this grammar, all the error rates are below 0.2 percent. We see that crucially ranked constraints " |
| 888 |
"will become separated after a while by a gap of about 10 along the ranking scale.") |
| 889 |
NORMAL (U"If we have three constraints obligatorily ranked as A >> B >> C in the adult grammar, with ranking differences of 8 between " |
| 890 |
"A and B and between B and C in the learner's grammar (giving an error rate of 0.2\\% ), the ranking A >> C has a chance of less than 1 in 100 million " |
| 891 |
"to be reversed at evaluation time. This relativity of error rates is an empirical prediction of our stochastic OT grammar model.") |
| 892 |
NORMAL (U"Our Harmonic Grammars with constraint noise (Noisy HG) are slightly different in that respect, " |
| 893 |
"but are capable of learning a constraint ranking for any language that can be generated from an ordinal ranking. " |
| 894 |
"As proved by @@Boersma & Pater (2016)@, the same learning rule as was devised for MaxEnt grammars by @@Jäger (2003)@ " |
| 895 |
"is able to learn all languages generated by %nonnoisy HG grammars as well; " |
| 896 |
"the GLA, by contrast, failed to converge on 0.4 percent of randomly generated OT languages " |
| 897 |
"(failures of the GLA on ordinal grammars were discovered first by @@Pater (2008)@). " |
| 898 |
"This learning rule for HG and MaxEnt is the same as the GLA described above, " |
| 899 |
"except that the learning step of each constraint is multiplied by " |
| 900 |
"the difference of the number of violations of this constraint between the correct form and the incorrect winner; " |
| 901 |
"this multiplication is crucial (without it, stochastic gradient ascent is not guaranteed to converge), " |
| 902 |
"as was noted by Jäger for MaxEnt. The same procedure for updating weights occurs " |
| 903 |
"in @@Soderstrom, Mathis & Smolensky (2006)@, who propose " |
| 904 |
"an incremental version (formulas 21 and 35d) of the harmony version (formulas 14 and 18) " |
| 905 |
"of the learning equation for Boltzmann machines (formula 13). " |
| 906 |
"The differences between the three implementations is that in Stochastic OT and Noisy HG the evaluation noise (or %temperature) is in the constraint rankings, " |
| 907 |
"in MaxEnt it is in the candidate probabilities, and in Boltzmann machines it is in the activities (i.e. the constraint violations). " |
| 908 |
"The upate procedure is also similar to that of the %perceptron, a neural network invented by @@Rosenblatt (1962)@ " |
| 909 |
"for classifying continuous inputs.") |
| 910 |
MAN_END |
| 911 |
|
| 912 |
MAN_BEGIN (U"OT learning 5. Learning a stochastic grammar", U"ppgb", 20070725) |
| 913 |
NORMAL (U"Having shown that the algorithm can learn deep obligatory rankings, we will now see " |
| 914 |
"that it also performs well in replicating the variation in the language environment.") |
| 915 |
NORMAL (U"Create a place assimilation grammar as described in @@OT learning 2.6. Variable output|§2.6@, " |
| 916 |
"and set all its rankings to 100.000:") |
| 917 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 918 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE}#\t 100.000\t 100.000\t 1.000") |
| 919 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (t, p)#\t 100.000\t 100.000\t 1.000") |
| 920 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (n, m)#\t 100.000\t 100.000\t 1.000") |
| 921 |
NORMAL (U"Create a place assimilation distribution and generate 1000 string pairs (@@OT learning 3.1. Data from a pair distribution|§3.1@). " |
| 922 |
"Select the grammar and the two @Strings objects, and learn with a plasticity of 0.1:") |
| 923 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 924 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (t, p)#\t 104.540\t 103.140\t 1.000") |
| 925 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (n, m)#\t 96.214\t 99.321\t 1.000") |
| 926 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE}#\t 99.246\t 97.861") |
| 927 |
NORMAL (U"The output distributions are now (using @@OTGrammar: To output Distributions...@, see @@OT learning 2.9. Output distributions|§2.9@):") |
| 928 |
LIST_ITEM1 (U"\t/an+pa/ \\-> anpa\t14.3\\% ") |
| 929 |
LIST_ITEM1 (U"\t/an+pa/ \\-> ampa\t85.7\\% ") |
| 930 |
LIST_ITEM1 (U"\t/at+ma/ \\-> atma\t96.9\\% ") |
| 931 |
LIST_ITEM1 (U"\t/at+ma/ \\-> apma\t3.1\\% ") |
| 932 |
NORMAL (U"After another 10,000 new string pairs, we have:") |
| 933 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 934 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (t, p)#\t 106.764\t 107.154\t 1.000") |
| 935 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE}#\t 97.899\t 97.161\t 1.000") |
| 936 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (n, m)#\t 95.337\t 96.848\t 1.000") |
| 937 |
NORMAL (U"With the following output distributions (measured with a million draws):") |
| 938 |
LIST_ITEM1 (U"\t/an+pa/ \\-> anpa\t18.31\\% ") |
| 939 |
LIST_ITEM1 (U"\t/an+pa/ \\-> ampa\t81.69\\% ") |
| 940 |
LIST_ITEM1 (U"\t/at+ma/ \\-> atma\t99.91\\% ") |
| 941 |
LIST_ITEM1 (U"\t/at+ma/ \\-> apma\t0.09\\% ") |
| 942 |
NORMAL (U"The error rate is acceptably low, but the accuracy in reproducing the 80\\% - 20\\% " |
| 943 |
"distribution could be better. This is because the relatively high plasticity of 0.1 " |
| 944 |
"can only give a coarse approximation. So we lower the plasticity to 0.001, " |
| 945 |
"and supply 100,000 new data:") |
| 946 |
LIST_ITEM1 (U"\t\t %%ranking value\t %disharmony\t %plasticity") |
| 947 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (t, p)#\t 106.810\t 107.184\t 1.000") |
| 948 |
LIST_ITEM1 (U"\t##*G\\s{ESTURE}#\t 97.782\t 99.682\t 1.000") |
| 949 |
LIST_ITEM1 (U"\t##*R\\s{EPLACE} (n, m)#\t 95.407\t 98.760\t 1.000") |
| 950 |
NORMAL (U"With the following output distributions:") |
| 951 |
LIST_ITEM1 (U"\t/an+pa/ \\-> anpa\t20.08\\% ") |
| 952 |
LIST_ITEM1 (U"\t/an+pa/ \\-> ampa\t79.92\\% ") |
| 953 |
LIST_ITEM1 (U"\t/at+ma/ \\-> atma\t99.94\\% ") |
| 954 |
LIST_ITEM1 (U"\t/at+ma/ \\-> apma\t0.06\\% ") |
| 955 |
NORMAL (U"So besides learning obligatory rankings like a child does, " |
| 956 |
"the algorithm can also replicate very well the probabilities of the environment. " |
| 957 |
"This means that a GLA learner can learn stochastic grammars.") |
| 958 |
MAN_END |
| 959 |
|
| 960 |
MAN_BEGIN (U"OT learning 6. Shortcut to grammar learning", U"ppgb", 20070523) |
| 961 |
INTRO (U"Once you have mastered the tedious procedures of making Praat learn stochastic grammars, " |
| 962 |
"as described in the previous chapters of this tutorial, you can try a faster procedure, " |
| 963 |
"which simply involves selecting an @OTGrammar object together with a @PairDistribution object, " |
| 964 |
"and clicking ##Learn...#. Once you click #OK, Praat will feed the selected grammar with input/output " |
| 965 |
"pairs drawn from the selected distribution, and the grammar will be modified every time its output " |
| 966 |
"is different from the given output. Here is the meaning of the arguments:") |
| 967 |
TERM (U"%%Evaluation noise% (standard value: 2.0)") |
| 968 |
DEFINITION (U"the standard deviation of the noise added to the ranking of each constraint at evaluation time.") |
| 969 |
TERM (U"%%Strategy% (standard value: Symmetric all)") |
| 970 |
DEFINITION (U"what to do when the learner's output is different from the given output. Possibilities:") |
| 971 |
LIST_ITEM1 (U"Demotion only: lower the ranking of every constraint that is violated more in the correct output " |
| 972 |
"than in the learner's output. This algorithm crashes if there is variation in the data, i.e. if some inputs " |
| 973 |
"can have more than one possible adult outputs.") |
| 974 |
LIST_ITEM1 (U"Symmetric one: lower the ranking of the highest-ranked constraint that is violated more in the adult output " |
| 975 |
"than in the learner's output, and raise the ranking of the highest-ranked constraint that is violated more " |
| 976 |
"in the learner's output than in the adult output. This is the \"minimal\" algorithm described and refuted in " |
| 977 |
"@@Boersma (1998)@, chapters 14-15.") |
| 978 |
LIST_ITEM1 (U"Symmetric all: lower the ranking of all constraints that are violated more in the adult output " |
| 979 |
"than in the learner's output, and raise the ranking of all constraints that are violated more " |
| 980 |
"in the learner's output than in the adult output. This is the algorithm described in @@Boersma & Hayes (2001)@.") |
| 981 |
LIST_ITEM1 (U"Weighted uncancelled: the same as \"Symmetric all\", but the size of the learning step " |
| 982 |
"is divided by the number of moving constraints. This makes sure that the average ranking of all the constraints " |
| 983 |
"is constant.") |
| 984 |
LIST_ITEM1 (U"Weighted all: the \"Symmetric all\" strategy can reworded as follows: \"lower the ranking of all constraints " |
| 985 |
"that are violated in the adult output, and raise the ranking of all constraints that are violated in the learner's output\". " |
| 986 |
"Do that, but divide the size of the learning step by the number of moving constraints.") |
| 987 |
LIST_ITEM1 (U"EDCD: Error-Driven Constraint Demotion, the algorithm described by @@Tesar & Smolensky (1998)@. " |
| 988 |
"All constraints that prefer the adult form and are ranked above the highest-ranked constraint that prefers the learner's form, " |
| 989 |
"are demoted to the ranking of that last constraint minus 1.0.") |
| 990 |
TERM (U"%%Initial plasticity% (standard value: 1.0)") |
| 991 |
TERM (U"%%Replications per plasticity% (standard value: 100000)") |
| 992 |
TERM (U"%%Plasticity decrement% (standard value: 0.1)") |
| 993 |
TERM (U"%%Number of plasticities% (standard value: 4)") |
| 994 |
DEFINITION (U"these four arguments determine the %%learning scheme%, i.e. the number of times the grammar will " |
| 995 |
"receive data at a certain plasticity. With the standard values, there will be 100000 data while the plasticity is 1.0 " |
| 996 |
"(the initial plasticity), 100000 data while the plasticity is 0.1, 100000 data while the plasticity is 0.01, " |
| 997 |
"and 100000 data while the plasticity is 0.001. If you want learning at a constant plasticity, set the " |
| 998 |
"%%number of plasticities% to 1. Note that for the decision strategies of HarmonicGrammar, LinearOT, PositiveHG or MaximumEntropy " |
| 999 |
"the learning step for a constraint equals the plasticity multiplied by the difference between the " |
| 1000 |
"numbers of violations of this constraint in the adult output and in the learner's output.") |
| 1001 |
TERM (U"%%Rel. plasticity spreading% (standard value: 0.1)") |
| 1002 |
DEFINITION (U"if this is not 0, the size of the learning step will vary randomly. For instance, if the plasticity is set to 0.01, " |
| 1003 |
"and the relative plasticity spreading is 0.1, you will get actual learning steps that could be anywhere between 0.007 " |
| 1004 |
"and 0.013, according to a Gaussian distribution with mean 0.01 and standard deviation 0.001.") |
| 1005 |
TERM (U"%%Honour local rankings% (standard value: on)") |
| 1006 |
DEFINITION (U"if this is on, the fixed rankings that you supplied in the grammar will be maintained during learning: " |
| 1007 |
"if a constraint falls below a constraint that is supposed to be universally lower-ranked, this second constraint " |
| 1008 |
"will be demoted as well.") |
| 1009 |
TERM (U"%%Number of chews% (standard value: 1)") |
| 1010 |
DEFINITION (U"the number of times that each input-output pair is fed to the grammar. Setting this number to 20 " |
| 1011 |
"will give a slightly different (perhaps more accurate) result than simply raising the plasticity by a factor of 20.") |
| 1012 |
MAN_END |
| 1013 |
|
| 1014 |
MAN_BEGIN (U"OT learning 7. Learning from overt forms", U"ppgb", 20031220) |
| 1015 |
INTRO (U"In order to be able to learn phonological production, both EDCD and GLA require pairs of underlying form " |
| 1016 |
"and surface form. However, the language-learning child hears neither of these forms: she only hears ##%%overt forms%#, " |
| 1017 |
"with less structural information than the underlying and surface forms contain.") |
| 1018 |
ENTRY (U"Interpretive parsing") |
| 1019 |
NORMAL (U"The language-learning child has to construct both the surface form and the underlying form from the overt form " |
| 1020 |
"that she hears. @@Tesar & Smolensky (1998)@ proposed that the child computes a surface form from the " |
| 1021 |
"overt form by using the same constraint ranking as in production. For instance, the overt form [σ σ σ], which " |
| 1022 |
"is a sequence of three syllables with stress on the second syllable, will be interpreted as the surface form " |
| 1023 |
"/(σ σˈ) σ/ in iambic left-aligning languages (I\\s{AMBIC} >> T\\s{ROCHAIC}, and A\\s{LL}F\\s{EET}L\\s{EFT} " |
| 1024 |
">> A\\s{LL}F\\s{EET}R\\s{IGHT}), but as the surface form /σ (σˈ σ)/ in trochaic right-aligning languages. " |
| 1025 |
"Tesar & Smolensky call this procedure @@Robust Interpretive Parsing@, because it works even if the listener's grammar " |
| 1026 |
"would never produce such a form. For instance, if I\\s{AMBIC} >> A\\s{LL}F\\s{EET}R\\s{IGHT} >> T\\s{ROCHAIC} >> " |
| 1027 |
"A\\s{LL}F\\s{EET}L\\s{EFT}, the listener herself would produce the iambic right-aligned /σ (σ σˈ)/ " |
| 1028 |
"for any trisyllabic underlying form, though she will still interpret [σ σˈ σ] as /(σ σˈ) σ/, " |
| 1029 |
"which is illegal in her own grammar. Hearing forms that are illegal in one's own grammar is of course a common " |
| 1030 |
"situation for language-learning children.") |
| 1031 |
NORMAL (U"In Tesar & Smolensky's view, the underlying form can be trivially computed from the surface form, " |
| 1032 |
"since the surface form %contains enough information. For instance, the surface form /(σ σˈ) σ/ must " |
| 1033 |
"lead to the underlying form |σ σ σ| if all parentheses and stress marks are removed. Since " |
| 1034 |
"@@McCarthy & Prince (1995)@, this %containment view of surface representations has been abandoned. " |
| 1035 |
"In Praat, therefore, the underlying form is not trivially computed from the surface form, " |
| 1036 |
"but all the tableaus are scanned for the surface form that violates the least high-ranked constraints (in the usual " |
| 1037 |
"OT sense), as long as it contains the given overt form. For instance, if I\\s{AMBIC} >> A\\s{LL}F\\s{EET}R\\s{IGHT} " |
| 1038 |
">> T\\s{ROCHAIC} >> A\\s{LL}F\\s{EET}L\\s{EFT}, the overt form [σ σˈ σ] occurs in two candidates: " |
| 1039 |
"the surface form /(σ σˈ) σ/ in the tableau for the underlying form |σ σ σ|, and " |
| 1040 |
"the surface form /σ (σˈ σ)/ in the tableau for the underlying form |σ σ σ|. The best candidate " |
| 1041 |
"is the surface form /(σ σˈ) σ/ in the tableau for the underlying form |σ σ σ|. Hence, " |
| 1042 |
"Praat's version of Robust Interpretive Parsing will map the overt form [σ σˈ σ] to the underlying form " |
| 1043 |
"|σ σ σ| (the ‘winning tableau’) and to the surface form /(σ σˈ) σ/ (to be sure, " |
| 1044 |
"this is the same result as in Tesar & Smolensky's " |
| 1045 |
"version, but crucial differences between the two versions will appear when faithfulness constraints are involved).") |
| 1046 |
NORMAL (U"In Praat, you can do interpretive parsing. For example, create a grammar with ##Create metrics grammar...# " |
| 1047 |
"from the @@New menu@. Then choose ##Get interpretive parse...# from the @@Query submenu@ and supply \"[L1 L L]\" for the " |
| 1048 |
"overt form, which means a sequence of three light syllables with a main stress on the first. The Info window will show you " |
| 1049 |
"the optimal underlying and surface forms, given the current constraint ranking.") |
| 1050 |
ENTRY (U"Learning from partial forms") |
| 1051 |
NORMAL (U"Now that the learning child can convert an overt form to an underlying-surface pair, she can compare this " |
| 1052 |
"surface form to the surface form that she herself would have derived from this underlying form. For instance, " |
| 1053 |
"If I\\s{AMBIC} >> A\\s{LL}F\\s{EET}R\\s{IGHT} >> T\\s{ROCHAIC} >> A\\s{LL}F\\s{EET}L\\s{EFT}, the winning " |
| 1054 |
"tableau is |σ σ σ|, and the perceived adult surface form is /(σ σˈ) σ/. " |
| 1055 |
"But from the underlying form |σ σ σ|, the learner will derive /σ (σ σˈ)/ as her own surface form. " |
| 1056 |
"The two surface forms are different, so that the learner can take action by reranking one or more constraints, " |
| 1057 |
"perhaps with EDCD or GLA.") |
| 1058 |
NORMAL (U"In Praat, you can learn from partial forms. Select the metrics grammar and choose ##Learn from one partial output...#, " |
| 1059 |
"and supply \"[L1 L L]\". If you do this several times, you will see that the winner for the tableau \"|L L L|\" will become one of " |
| 1060 |
"the two forms with overt part \"[L1 L L]\".") |
| 1061 |
NORMAL (U"To run a whole simulation, you supply a @Distributions object with one column, perhaps from a text file. The following " |
| 1062 |
"text file shows the overt forms for Latin, with the bisyllabic forms occurring more often than the trisyllabic forms:") |
| 1063 |
CODE (U"\"ooTextFile\"") |
| 1064 |
CODE (U"\"Distributions\"") |
| 1065 |
CODE (U"1 column with numeric data") |
| 1066 |
CODE (U" \"Latin\"") |
| 1067 |
CODE (U"28 rows") |
| 1068 |
CODE (U"\"[L1 L]\" 25") |
| 1069 |
CODE (U"\"[L1 H]\" 25") |
| 1070 |
CODE (U"\"[H1 L]\" 25") |
| 1071 |
CODE (U"\"[H1 H]\" 25") |
| 1072 |
CODE (U"\"[L1 L L]\" 5") |
| 1073 |
CODE (U"\"[H1 L L]\" 5") |
| 1074 |
CODE (U"\"[L H1 L]\" 5") |
| 1075 |
CODE (U"\"[H H1 L]\" 5") |
| 1076 |
CODE (U"\"[L1 L H]\" 5") |
| 1077 |
CODE (U"\"[H1 L H]\" 5") |
| 1078 |
CODE (U"\"[L H1 H]\" 5") |
| 1079 |
CODE (U"\"[H H1 H]\" 5") |
| 1080 |
CODE (U"\"[L L1 L L]\" 1") |
| 1081 |
CODE (U"\"[L H1 L L]\" 1") |
| 1082 |
CODE (U"\"[L L H1 L]\" 1") |
| 1083 |
CODE (U"\"[L H H1 L]\" 1") |
| 1084 |
CODE (U"\"[L L1 L H]\" 1") |
| 1085 |
CODE (U"\"[L H1 L H]\" 1") |
| 1086 |
CODE (U"\"[L L H1 H]\" 1") |
| 1087 |
CODE (U"\"[L H H1 H]\" 1") |
| 1088 |
CODE (U"\"[H L1 L L]\" 1") |
| 1089 |
CODE (U"\"[H H1 L L]\" 1") |
| 1090 |
CODE (U"\"[H L H1 L]\" 1") |
| 1091 |
CODE (U"\"[H H H1 L]\" 1") |
| 1092 |
CODE (U"\"[H L1 L H]\" 1") |
| 1093 |
CODE (U"\"[H H1 L H]\" 1") |
| 1094 |
CODE (U"\"[H L H1 H]\" 1") |
| 1095 |
CODE (U"\"[H H H1 H]\" 1") |
| 1096 |
NORMAL (U"Read this file into Praat with @@Read from file...@. A @Distributions object then appears in the object list. " |
| 1097 |
"Click @@Distributions: To Strings...|To Strings...@, then #OK. A @Strings object containing 1000 strings, drawn randomly " |
| 1098 |
"from the distribution, with relative frequencies as in the text file, will appear in the list. Click @Inspect to check the contents.") |
| 1099 |
NORMAL (U"You can now select the @OTGrammar together with the @Strings and choose ##Learn from partial outputs...#. " |
| 1100 |
"A thousand times, Praat will construct a surface form from the overt form by interpretive parsing, " |
| 1101 |
"and also construct the underlying form in the same way, from which it will construct another surface form by evaluating the " |
| 1102 |
"tableau. Whenever the two surface forms are not identical, some constraints will be reranked. In the current implementation, " |
| 1103 |
"the disharmonies for interpretive parsing and for production are the same, i.e., " |
| 1104 |
"if the evaluation noise is not zero, the disharmonies are randomly renewed before each interpretive parsing " |
| 1105 |
"but stay the same for the subsequent virtual production.") |
| 1106 |
MAN_END |
| 1107 |
|
| 1108 |
/* |
| 1109 |
MAN_BEGIN (U"OTGrammar examples", U"ppgb", 20001027) |
| 1110 |
ENTRY (U"Safety margin and stochastic evaluation") |
| 1111 |
NORMAL (U"What is a %small demotion step? This must be taken relative to another quantity. " |
| 1112 |
"This quantity is the evaluation noise.") |
| 1113 |
NORMAL (U"If the %%ranking spreading% were zero, the demotions in the GLA would immediately stop once that " |
| 1114 |
"a constraint has fallen below its competitors. If the data contain an error, the grammar " |
| 1115 |
"will change to an incorrect state, and the learner has to make an error to correct it. " |
| 1116 |
"Though the error ratio is now one (because of the constant demotion step), " |
| 1117 |
"the learner's behaviour can still be described as a “tit-for-tat” strategy, " |
| 1118 |
"which is an unknown phenomenon in human speech variation.") |
| 1119 |
NORMAL (U"The solution is to have a finite ranking spreading: in this way, the learner will continue making " |
| 1120 |
"errors (though less than 50\\% ) after the constraint has fallen below its competitors. " |
| 1121 |
"For instance, with a ranking spreading of 2.0, the distance between the constraints will be about " |
| 1122 |
"10 after a few thousand relevant data: the %%safety margin%. " |
| 1123 |
"If the mean demotion step is 0.1, there is no chance " |
| 1124 |
"that a modest amount of erroneous data will reverse the ranking. It is true, however, that " |
| 1125 |
"one erroneous datum will decrease the constraint distance by 0.1, so that the learner will have to " |
| 1126 |
"make one mistake herself to restore the original distance. But this is only natural, " |
| 1127 |
"as she may well wait a long time before doing this: " |
| 1128 |
"on the average, the same number of thousands of data. This is the %%patient error-matching learner%.") |
| 1129 |
ENTRY (U"Learning from surface data alone") |
| 1130 |
NORMAL (U"Many a young learner will take the adult surface forms, as perceived by herself, " |
| 1131 |
"as her underlying forms. In other words, the input to her grammar will equal " |
| 1132 |
"the output of the adult grammar.") |
| 1133 |
NORMAL (U"We can simulate what happens here by taking the adult output as the input to the learning algorithms:") |
| 1134 |
LIST_ITEM (U"1. Create a five-constraint Wolof grammar.") |
| 1135 |
LIST_ITEM (U"2. Generate 1000 input strings.") |
| 1136 |
LIST_ITEM (U"3. Compute the 1000 output strings.") |
| 1137 |
LIST_ITEM (U"4. Create a five-constraint \"equal\" grammar.") |
| 1138 |
LIST_ITEM (U"5. Select this monostratal grammar and the output strings only, " |
| 1139 |
"and click ##Learn output (T&S)#. See @@OTAnyGrammar & Strings: Learn output (T&S)@.") |
| 1140 |
NORMAL (U"The result will be a grammar where the faithfulness constraints outrank all the " |
| 1141 |
"gestural constraints that can be violated in any output string:") |
| 1142 |
LIST_ITEM (U"##*[rtr / hi]# 100.000 100.000") |
| 1143 |
LIST_ITEM (U"##P\\s{ARSE} (atr)# 100.000 100.000") |
| 1144 |
LIST_ITEM (U"##P\\s{ARSE} (rtr)# 100.000 100.000") |
| 1145 |
LIST_ITEM (U"##*G\\s{ESTURE} (contour)# 99.000 99.000") |
| 1146 |
LIST_ITEM (U"##*[atr / lo]# 99.000 99.000") |
| 1147 |
NORMAL (U"You will get a comparable result with @@OTAnyGrammar & Strings: Learn output (GLA)...@.") |
| 1148 |
NORMAL (U"The resulting grammar represents the learner's state after the acquisition of " |
| 1149 |
"all the relevant gestures. The learner will now faithfully reproduce /etɛ/ " |
| 1150 |
"if that were in her lexicon. Before being able to render such an underlying form as [ɛtɛ], " |
| 1151 |
"she must learn that faithfulness can be violated.") |
| 1152 |
ENTRY (U"Example 2: When underlying forms are irrelevant") |
| 1153 |
NORMAL (U"Underlying forms are relevant only if faithfulness constraints are involved. " |
| 1154 |
"If a grammar only contains constraints that evaluate the output, " |
| 1155 |
"we need no input strings for our simulations. However, " |
| 1156 |
"if the relevant constraint had fixed rankings, there would only be a single possible output, " |
| 1157 |
"which seems uninteresting. An interesting output-only grammar, therefore, necessarily " |
| 1158 |
"features stochastic evaluation, and at least some of the constraints wil have rankings that " |
| 1159 |
"are close to each other.") |
| 1160 |
NORMAL (U"#%Example. @@Hayes & MacEachern (1998)@ identify 11 output-oriented constraints " |
| 1161 |
"for the forms of quatrains in English folk verse.") |
| 1162 |
LIST_ITEM (U"1. Create a folk-verse grammar with equal constraint rankings (all 100). " |
| 1163 |
"You may find it in the file ##folkVerse.OTGrammar# in the #demo folder of your #Praat distribution, " |
| 1164 |
"or get it from ##https://www.fon.hum.uva.nl/praat/folkVerse.OTGrammar#.") |
| 1165 |
LIST_ITEM (U"2. Generate 1000 input strings. They will all be empty strings.") |
| 1166 |
LIST_ITEM (U"3. Read the file that contains the surface distribution of the possible outputs. " |
| 1167 |
"It is in the #demo folder or at ##https://www.fon.hum.uva.nl/praat/folkVerse.Distributions#. " |
| 1168 |
"A @Distributions object will appear in the list. " |
| 1169 |
"Column \"Actual\" is the last column of table (10) in Hayes & MacEachern (1998).") |
| 1170 |
LIST_ITEM (U"4. From this surface distribution, create a list of 1000 output strings, " |
| 1171 |
"using @@Distributions: To Strings...@ (set %column to 1).") |
| 1172 |
LIST_ITEM (U"5. Select the grammar, the \"input strings\", and the output strings, " |
| 1173 |
"and learn in the usual way. After learning, you can see that some constraints have risen above 100, " |
| 1174 |
"and some have fallen below 100.") |
| 1175 |
NORMAL (U"With each of the 1000 outputs, the learner can be regarded as having generated a quatrain herself " |
| 1176 |
"and compared it to a quatrain in her folk-verse environment. If these quatrains are equal " |
| 1177 |
"(a 10\\% chance or so), nothing happens. Otherwise, the learner will demote the highest " |
| 1178 |
"violated constraint (i.e., the one that is most disharmonic during her stochastic evaluation) " |
| 1179 |
"in the heard quatrain that is not (or less) violated in the winner (the quatrain that she generated herself). " |
| 1180 |
"She will also promote the highest violated constraint in the winner " |
| 1181 |
"that is not (or less) violated in the heard quatrain.") |
| 1182 |
NORMAL (U"We are next going to generate a set of 589 quatrains, in order to be able to compare " |
| 1183 |
"the behaviours of our folk-verse grammar and the English folk-verse writers:") |
| 1184 |
LIST_ITEM (U"1. Select the learned grammar and generate 589 (empty) input strings.") |
| 1185 |
LIST_ITEM (U"2. Select the learned grammar and the so-called input strings, " |
| 1186 |
"and generate the output strings.") |
| 1187 |
LIST_ITEM (U"3. To see the distribution of the output strings, choose @@Strings: To Distributions@, " |
| 1188 |
"and draw the resulting @Distributions object to your Picture window.") |
| 1189 |
LIST_ITEM (U"4. You can now compare the two distributions.") |
| 1190 |
NORMAL (U"Instead of generating the data from a @Distributions, you could have generated them from " |
| 1191 |
"the target grammar in table (9) of Hayes & MacEachern (1998). " |
| 1192 |
"Such a grammar is in your #demo folder (##folkVerse59.OTGrammar#) " |
| 1193 |
"or at ##https://www.fon.hum.uva.nl/praat/folkVerse59.OTGrammar#. " |
| 1194 |
"Because of the loosening of the tie between two of the constraints (see H & McE, fn. 43), " |
| 1195 |
"this grammar will give different distributions from the \"actual\" values, " |
| 1196 |
"but our algorithm will learn them correctly, provided you choose ##Symmetric all# " |
| 1197 |
"or ##weighted uncancelled# for the learning strategy.") |
| 1198 |
MAN_END |
| 1199 |
*/ |
| 1200 |
|
| 1201 |
MAN_BEGIN (U"OTGrammar", U"ppgb", 20141001) |
| 1202 |
INTRO (U"One of the @@types of objects@ in Praat. See the @@OT learning@ tutorial.") |
| 1203 |
ENTRY (U"Inside an OTGrammar") |
| 1204 |
NORMAL (U"With @Inspect, you will see the following attributes:") |
| 1205 |
TERM (U"%constraints") |
| 1206 |
DEFINITION (U"a list of constraints. Each constraint contains the following attributes:") |
| 1207 |
TERM1 (U"%name") |
| 1208 |
DEFINITION1 (U"the fixed name of the constraint, for instance \"P\\s{ARSE}\".") |
| 1209 |
TERM1 (U"%ranking") |
| 1210 |
DEFINITION1 (U"the continuous ranking value; will change during learning.") |
| 1211 |
TERM1 (U"%disharmony") |
| 1212 |
DEFINITION1 (U"the effective ranking value during stochastic evaluation; with a non-zero evaluation noise, " |
| 1213 |
"this will be different from %ranking.") |
| 1214 |
TERM (U"%fixedRankings") |
| 1215 |
DEFINITION (U"an often empty list of locally ranked pairs of constraints. " |
| 1216 |
"Each local-ranking pair contains the following attributes:") |
| 1217 |
TERM1 (U"%higher") |
| 1218 |
DEFINITION1 (U"the index of the universally higher-ranked of the two constraints, " |
| 1219 |
"a number between 1 and the number of constraints.") |
| 1220 |
TERM1 (U"%lower") |
| 1221 |
DEFINITION1 (U"the index of the universally lower-ranked of the two constraints.") |
| 1222 |
TERM (U"%tableaus") |
| 1223 |
DEFINITION (U"a list of tableaus. Each tableau contains the following attributes:") |
| 1224 |
TERM1 (U"%input") |
| 1225 |
DEFINITION1 (U"the input string of the tableau. For production grammaras, the underlying form of the utterance, for example " |
| 1226 |
"|an+pa| or |bɹɪŋ + \\s{PAST}|.") |
| 1227 |
TERM1 (U"%candidates") |
| 1228 |
DEFINITION1 (U"a list of output candidates. Each output candidate consists of:") |
| 1229 |
TERM2 (U"%output") |
| 1230 |
DEFINITION2 (U"the output string of the tableau. In two-level phonology: the surface form of the utterance, for example " |
| 1231 |
"[anpa] or [ampa] or [bɹɔːt] or [bɹæŋ]. In multi-level phonology: the combination of phonological surface " |
| 1232 |
"and phonetic results, for example /anpa/[anpa] or /ampa/[ampa] or /bɹɔːt/[bɹɔːt] or " |
| 1233 |
"/bɹæŋ/[bɹæŋ].") |
| 1234 |
TERM2 (U"%marks") |
| 1235 |
DEFINITION2 (U"a list of the number of violations of each constraint for this output form. If there are 13 constraints, " |
| 1236 |
"this list will contain 13 integer numbers for each candidate.") |
| 1237 |
ENTRY (U"OTGrammar creation") |
| 1238 |
NORMAL (U"You can easily create some #OTGrammar examples from the @@New menu@, " |
| 1239 |
"or type your own grammars into a text file and read the file into Praat. See the @@OT learning@ tutorial.") |
| 1240 |
ENTRY (U"OTGrammar actions") |
| 1241 |
NORMAL (U"You can perform the following actions on selected #OTGrammar objects:") |
| 1242 |
LIST_ITEM (U"@@OTGrammar: Generate inputs...@") |
| 1243 |
/*LIST_ITEM (U"@@OTGrammar: Sort...@")*/ |
| 1244 |
LIST_ITEM (U"@@OTGrammar: Input to output...@") |
| 1245 |
LIST_ITEM (U"@@OTGrammar: Input to outputs...@ (compute the output distribution for a given input)") |
| 1246 |
LIST_ITEM (U"@@OTGrammar: To output Distributions...@") |
| 1247 |
LIST_ITEM (U"@@OTGrammar & Strings: Inputs to outputs...@") |
| 1248 |
LIST_ITEM (U"@@OTGrammar: Learn one...@") |
| 1249 |
LIST_ITEM (U"@@OTGrammar & 2 Strings: Learn...@") |
| 1250 |
NORMAL (U"You can view an #OTGrammar in an @OTGrammarEditor.") |
| 1251 |
MAN_END |
| 1252 |
|
| 1253 |
MAN_BEGIN (U"OTGrammar: Generate inputs...", U"ppgb", 19981230) |
| 1254 |
INTRO (U"A command to create a @Strings object from a selected @OTGrammar.") |
| 1255 |
NORMAL (U"A practical grammar-specific implementation of the %%richness of the base%: " |
| 1256 |
"the inputs are drawn at random with equal probabilities from the inputs associated with the tableaus. " |
| 1257 |
"For an example, see @@OT learning 3.2. Data from another grammar@.") |
| 1258 |
ENTRY (U"Setting") |
| 1259 |
TERM (U"##Number of trials") |
| 1260 |
DEFINITION (U"the number of times a string will be drawn from the possible inputs to the grammar.") |
| 1261 |
MAN_END |
| 1262 |
|
| 1263 |
MAN_BEGIN (U"OTGrammar: Input to output...", U"ppgb", 20030916) |
| 1264 |
INTRO (U"A command to ask the selected @OTGrammar object to evaluate the candidates associated with a specified input form.") |
| 1265 |
NORMAL (U"See @@OT learning 2.8. Asking for one output@ for tutorial information.") |
| 1266 |
ENTRY (U"Settings") |
| 1267 |
TERM (U"##Input form") |
| 1268 |
DEFINITION (U"the input form whose surface form you want to know. If this string is not in the list " |
| 1269 |
"of the possible inputs of the selected OTGrammar, you will get an error message.") |
| 1270 |
TERM (U"##Noise# (standard value: 2.0)") |
| 1271 |
DEFINITION (U"the standard deviation of the noise added to the ranking value of every constraint during evaluation. " |
| 1272 |
"See @@OT learning 2.4. Evaluation@.") |
| 1273 |
MAN_END |
| 1274 |
|
| 1275 |
MAN_BEGIN (U"OTGrammar: Input to outputs...", U"ppgb", 20030916) |
| 1276 |
INTRO (U"A command to ask the selected @OTGrammar object to evaluate a number of times the candidates associated " |
| 1277 |
"with a specified input form. The result is a @Distributions object.") |
| 1278 |
NORMAL (U"See @@OT learning 2.9. Output distributions@ for tutorial information and examples.") |
| 1279 |
ENTRY (U"Settings") |
| 1280 |
TERM (U"##Trials# (standard value: 1000)") |
| 1281 |
DEFINITION (U"the number of evaluations that you want to perform.") |
| 1282 |
TERM (U"##Noise# (standard value: 2.0)") |
| 1283 |
DEFINITION (U"the standard deviation of the noise added to the ranking value of every constraint during the evaluations. " |
| 1284 |
"See @@OT learning 2.4. Evaluation@.") |
| 1285 |
TERM (U"##Input form") |
| 1286 |
DEFINITION (U"the input form whose surface forms you want to measure. If this string is not in the list " |
| 1287 |
"of the possible inputs of the selected OTGrammar, you will get an error message.") |
| 1288 |
MAN_END |
| 1289 |
|
| 1290 |
MAN_BEGIN (U"OTGrammar: Learn one...", U"ppgb", 20011120) |
| 1291 |
INTRO (U"Causes every selected @OTGrammar object to process one input/output pair " |
| 1292 |
"according to the Gradual Learning Algorithm " |
| 1293 |
"by @@Boersma (1998)@ and @@Boersma (2000)@. See @@OT learning 4. Learning an ordinal grammar@ " |
| 1294 |
"and @@OT learning 5. Learning a stochastic grammar@.") |
| 1295 |
MAN_END |
| 1296 |
|
| 1297 |
MAN_BEGIN (U"OTGrammar: To output Distributions...", U"ppgb", 19981230) |
| 1298 |
INTRO (U"A command to ask the selected @OTGrammar object to evaluate a number of times the candidates associated " |
| 1299 |
"with every input form. The result is a @Distributions object. See @@OT learning 2.9. Output distributions@.") |
| 1300 |
MAN_END |
| 1301 |
|
| 1302 |
MAN_BEGIN (U"OTGrammar & PairDistribution: Find positive weights...", U"ppgb", 20080331) |
| 1303 |
INTRO (U"A command to change the weights of the selected @OTGrammar on the basis of the language data " |
| 1304 |
"in the selected @PairDistribution.") |
| 1305 |
NORMAL (U"This command works only if the decision strategy of the selected OTGrammar is " |
| 1306 |
"HarmonicGrammar, LinearOT, PositiveHG, or ExponentialHG. Also, " |
| 1307 |
"the selected PairDistribution must contain exactly one non-zero-probability output for every possible input of the grammar.") |
| 1308 |
NORMAL (U"The procedure follows the linear programming method by @@Pater, Potts & Bhatt (2007)@. " |
| 1309 |
"This method tries to find a special correct weighting of the constraints, " |
| 1310 |
"namely one that minimizes the sum of the constraint weights.") |
| 1311 |
ENTRY (U"Settings") |
| 1312 |
TERM (U"##Weight floor# (standard value: 1.0)") |
| 1313 |
DEFINITION (U"After the command finishes, every weight will have at least this value.") |
| 1314 |
TERM (U"##Margin of separation# (standard value: 1.0)") |
| 1315 |
DEFINITION (U"After the command finishes, the harmony of every optimal (and correct) output candidate " |
| 1316 |
"will be at least this much greater than the harmony of any competitor in the same tableau.") |
| 1317 |
MAN_END |
| 1318 |
|
| 1319 |
MAN_BEGIN (U"OTGrammar & Strings: Inputs to outputs...", U"ppgb", 19981230) |
| 1320 |
INTRO (U"An action that creates a @Strings object from a selected @OTGrammar and a selected @Strings.") |
| 1321 |
NORMAL (U"The selected Strings object is considered as a list of inputs to the OTGrammar grammar.") |
| 1322 |
ENTRY (U"Settings") |
| 1323 |
TERM (U"##Noise") |
| 1324 |
DEFINITION (U"the standard deviation of the noise that will be temporarily added to the ranking value at each evaluation.") |
| 1325 |
NORMAL (U"The resulting Strings object will contain the output string of the grammar for each of the input strings.") |
| 1326 |
NORMAL (U"See @@OT learning 3.2. Data from another grammar@.") |
| 1327 |
MAN_END |
| 1328 |
|
| 1329 |
MAN_BEGIN (U"OTGrammar & 2 Strings: Learn...", U"ppgb", 20100331) |
| 1330 |
INTRO (U"Causes the selected @OTGrammar object to process a number of input/output pairs " |
| 1331 |
"according to the Gradual Learning Algorithm by @@Boersma (1997)@ and @@Boersma & Hayes (2001)@ " |
| 1332 |
"or with any other reranking strategies. See @@OT learning 4. Learning an ordinal grammar@ " |
| 1333 |
"and @@OT learning 5. Learning a stochastic grammar@.") |
| 1334 |
MAN_END |
| 1335 |
|
| 1336 |
MAN_BEGIN (U"OTGrammarEditor", U"ppgb", 20030316) |
| 1337 |
INTRO (U"One of the @editors in Praat, for viewing and editing the grammar in an @OTGrammar object.") |
| 1338 |
NORMAL (U"See the @@OT learning@ tutorial for examples.") |
| 1339 |
ENTRY (U"Usage") |
| 1340 |
NORMAL (U"The menu command that you will probably use most often if you investigate variation, " |
| 1341 |
"is the ##Evaluate (noise 2.0)# command, which you can invoke from the #Edit menu or by pressing @@Keyboard shortcuts|Command-2@.") |
| 1342 |
NORMAL (U"This command performs a new evaluation with the current ranking values. Some noise is added to the " |
| 1343 |
"ranking values, so that the %#disharmonies of the constraint will change. This may cause a change in the " |
| 1344 |
"ranking order of the constraints, which in its turn may cause a different candidate to win in some tableaus.") |
| 1345 |
MAN_END |
| 1346 |
|
| 1347 |
MAN_BEGIN (U"Robust Interpretive Parsing", U"ppgb", 20021105) |
| 1348 |
INTRO (U"The mapping from overt forms to surface forms in the acquisition model by @@Tesar & Smolensky (1998)@.") |
| 1349 |
NORMAL (U"In Praat, you can do robust interpretive parsing on any @OTGrammar object. " |
| 1350 |
"See @@OT learning 7. Learning from overt forms@.") |
| 1351 |
MAN_END |
| 1352 |
|
| 1353 |
} |
| 1354 |
|
| 1355 |
/* End of file manual_gram.cpp */ |