morenolq commited on
Commit
bd5067e
·
verified ·
1 Parent(s): 445a460

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +54 -433
README.md CHANGED
@@ -14,16 +14,6 @@ tags:
14
  - grammar
15
  - acceptability
16
  configs:
17
- - config_name: both
18
- data_files:
19
- - split: train
20
- path: both/train-*
21
- - split: validation
22
- path: both/validation-*
23
- - split: test
24
- path: both/test-*
25
- - split: test_unseen_lemmas
26
- path: both/test_unseen_lemmas-*
27
  - config_name: en
28
  data_files:
29
  - split: train
@@ -44,6 +34,16 @@ configs:
44
  path: it/test-*
45
  - split: test_unseen_lemmas
46
  path: it/test_unseen_lemmas-*
 
 
 
 
 
 
 
 
 
 
47
  - config_name: parallel
48
  data_files:
49
  - split: train
@@ -54,453 +54,74 @@ configs:
54
  path: parallel/test-*
55
  - split: test_unseen_lemmas
56
  path: parallel/test_unseen_lemmas-*
57
- dataset_info:
58
- - config_name: both
59
- features:
60
- - name: id
61
- dtype: string
62
- - name: lang
63
- dtype: string
64
- - name: text
65
- dtype: string
66
- - name: tokens
67
- sequence: string
68
- - name: clean_text
69
- dtype: string
70
- - name: clean_text_raw
71
- dtype: string
72
- - name: binary
73
- dtype:
74
- class_label:
75
- names:
76
- '0': ok
77
- '1': not_ok
78
- - name: multiclass
79
- dtype:
80
- class_label:
81
- names:
82
- '0': none
83
- '1': word_order
84
- '2': missing_word
85
- '3': repeated_word
86
- '4': agreement
87
- '5': wrong_function_word
88
- '6': multiple
89
- - name: multilabel
90
- sequence: int8
91
- length: 5
92
- - name: token_tags
93
- sequence:
94
- class_label:
95
- names:
96
- '0': O
97
- '1': word_order
98
- '2': missing_word
99
- '3': repeated_word
100
- '4': agreement
101
- '5': wrong_function_word
102
- - name: token_binary
103
- sequence: int8
104
- - name: n_corruptions
105
- dtype: int8
106
- - name: source
107
- dtype: string
108
- - name: source_id
109
- dtype: string
110
- - name: source_author
111
- dtype: string
112
- - name: license
113
- dtype: string
114
- - name: split
115
- dtype: string
116
- splits:
117
- - name: train
118
- num_bytes: 9298419
119
- num_examples: 23865
120
- - name: validation
121
- num_bytes: 1179378
122
- num_examples: 2983
123
- - name: test
124
- num_bytes: 1162240
125
- num_examples: 2983
126
- - name: test_unseen_lemmas
127
- num_bytes: 1421536
128
- num_examples: 3000
129
- download_size: 4892903
130
- dataset_size: 13061573
131
- - config_name: en
132
- features:
133
- - name: id
134
- dtype: string
135
- - name: lang
136
- dtype: string
137
- - name: text
138
- dtype: string
139
- - name: tokens
140
- sequence: string
141
- - name: clean_text
142
- dtype: string
143
- - name: clean_text_raw
144
- dtype: string
145
- - name: binary
146
- dtype:
147
- class_label:
148
- names:
149
- '0': ok
150
- '1': not_ok
151
- - name: multiclass
152
- dtype:
153
- class_label:
154
- names:
155
- '0': none
156
- '1': word_order
157
- '2': missing_word
158
- '3': repeated_word
159
- '4': agreement
160
- '5': wrong_function_word
161
- '6': multiple
162
- - name: multilabel
163
- sequence: int8
164
- length: 5
165
- - name: token_tags
166
- sequence:
167
- class_label:
168
- names:
169
- '0': O
170
- '1': word_order
171
- '2': missing_word
172
- '3': repeated_word
173
- '4': agreement
174
- '5': wrong_function_word
175
- - name: token_binary
176
- sequence: int8
177
- - name: n_corruptions
178
- dtype: int8
179
- - name: source
180
- dtype: string
181
- - name: source_id
182
- dtype: string
183
- - name: source_author
184
- dtype: string
185
- - name: license
186
- dtype: string
187
- - name: split
188
- dtype: string
189
- splits:
190
- - name: train
191
- num_bytes: 4875568
192
- num_examples: 11865
193
- - name: validation
194
- num_bytes: 620158
195
- num_examples: 1483
196
- - name: test
197
- num_bytes: 612619
198
- num_examples: 1483
199
- - name: test_unseen_lemmas
200
- num_bytes: 742534
201
- num_examples: 1500
202
- download_size: 2590903
203
- dataset_size: 6850879
204
- - config_name: it
205
- features:
206
- - name: id
207
- dtype: string
208
- - name: lang
209
- dtype: string
210
- - name: text
211
- dtype: string
212
- - name: tokens
213
- sequence: string
214
- - name: clean_text
215
- dtype: string
216
- - name: clean_text_raw
217
- dtype: string
218
- - name: binary
219
- dtype:
220
- class_label:
221
- names:
222
- '0': ok
223
- '1': not_ok
224
- - name: multiclass
225
- dtype:
226
- class_label:
227
- names:
228
- '0': none
229
- '1': word_order
230
- '2': missing_word
231
- '3': repeated_word
232
- '4': agreement
233
- '5': wrong_function_word
234
- '6': multiple
235
- - name: multilabel
236
- sequence: int8
237
- length: 5
238
- - name: token_tags
239
- sequence:
240
- class_label:
241
- names:
242
- '0': O
243
- '1': word_order
244
- '2': missing_word
245
- '3': repeated_word
246
- '4': agreement
247
- '5': wrong_function_word
248
- - name: token_binary
249
- sequence: int8
250
- - name: n_corruptions
251
- dtype: int8
252
- - name: source
253
- dtype: string
254
- - name: source_id
255
- dtype: string
256
- - name: source_author
257
- dtype: string
258
- - name: license
259
- dtype: string
260
- - name: split
261
- dtype: string
262
- splits:
263
- - name: train
264
- num_bytes: 4422851
265
- num_examples: 12000
266
- - name: validation
267
- num_bytes: 559220
268
- num_examples: 1500
269
- - name: test
270
- num_bytes: 549621
271
- num_examples: 1500
272
- - name: test_unseen_lemmas
273
- num_bytes: 679002
274
- num_examples: 1500
275
- download_size: 2325203
276
- dataset_size: 6210694
277
- - config_name: parallel
278
- features:
279
- - name: id
280
- dtype: string
281
- - name: lang
282
- dtype: string
283
- - name: text
284
- dtype: string
285
- - name: tokens
286
- sequence: string
287
- - name: clean_text
288
- dtype: string
289
- - name: clean_text_raw
290
- dtype: string
291
- - name: binary
292
- dtype:
293
- class_label:
294
- names:
295
- '0': ok
296
- '1': not_ok
297
- - name: multiclass
298
- dtype:
299
- class_label:
300
- names:
301
- '0': none
302
- '1': word_order
303
- '2': missing_word
304
- '3': repeated_word
305
- '4': agreement
306
- '5': wrong_function_word
307
- '6': multiple
308
- - name: multilabel
309
- sequence: int8
310
- length: 5
311
- - name: token_tags
312
- sequence:
313
- class_label:
314
- names:
315
- '0': O
316
- '1': word_order
317
- '2': missing_word
318
- '3': repeated_word
319
- '4': agreement
320
- '5': wrong_function_word
321
- - name: token_binary
322
- sequence: int8
323
- - name: n_corruptions
324
- dtype: int8
325
- - name: source
326
- dtype: string
327
- - name: source_id
328
- dtype: string
329
- - name: source_author
330
- dtype: string
331
- - name: license
332
- dtype: string
333
- - name: split
334
- dtype: string
335
- - name: pair_id
336
- dtype: string
337
- splits:
338
- - name: train
339
- num_bytes: 44740
340
- num_examples: 120
341
- - name: validation
342
- num_bytes: 7170
343
- num_examples: 20
344
- - name: test
345
- num_bytes: 2451
346
- num_examples: 6
347
- - name: test_unseen_lemmas
348
- num_bytes: 1444
349
- num_examples: 4
350
- download_size: 60852
351
- dataset_size: 55805
352
  ---
353
 
354
  # Lapsus
355
 
356
- ## Purpose
357
 
358
- Lapsus is a bilingual (English and Italian) grammatical acceptability dataset for teaching NLP with transformers (BERT, RoBERTa, XLM-R). Clean sentences come from open corpora, pass a chain of filters, and half of them are corrupted with named operations whose output is verified by independent checks. The same rows support four tasks: binary acceptability, multiclass error type, multi-label error types and token-level error tagging.
359
 
360
- Canonical releases live on GitHub (https://github.com/MorenoLaQuatra/lapsus/releases); this Hub repository (morenolq/lapsus) is a mirror. Dataset version: 0.1.0, seed 42.
361
 
362
- ## Configs and splits
 
 
 
 
363
 
364
- | config | licence | train | validation | test | test_unseen_lemmas | test_ood_source | test_natural |
365
- |---|---|---|---|---|---|---|---|
366
- | en | apache-2.0 | 11865 | 1483 | 1483 | 1500 | | |
367
- | it | cc-by-2.0 | 12000 | 1500 | 1500 | 1500 | | |
368
- | both | cc-by-2.0 | 23865 | 2983 | 2983 | 3000 | | |
369
- | parallel | cc-by-2.0 | 120 | 20 | 6 | 4 | | |
370
 
371
- - `both` concatenates `en` and `it` (use the `lang` column).
372
- - `parallel` holds Tatoeba-linked English/Italian translation pairs (`pair_id`), both members in the same split, for cross-lingual demos. Members can be clean or corrupted independently.
373
 
374
- ## Schema
375
 
376
- One row per source sentence; no source sentence is reused.
377
 
378
- | column | type | description |
379
  |---|---|---|
380
- | id | string | `<lang>-<source>-<source_id>` |
381
- | lang | string | `en` or `it` |
382
- | text | string | the (possibly corrupted) sentence after normalization |
383
- | tokens | list of string | tokens of `text` (see Tokenization) |
384
- | clean_text | string | the clean sentence, same normalization |
385
- | clean_text_raw | string | the clean sentence as in the source (NFC, trimmed) |
386
- | binary | ClassLabel | ok, not_ok |
387
- | multiclass | ClassLabel | none, word_order, missing_word, repeated_word, agreement, wrong_function_word, multiple |
388
- | multilabel | 5 x int8 | fixed order: word_order, missing_word, repeated_word, agreement, wrong_function_word |
389
- | token_tags | list of ClassLabel | O, word_order, missing_word, repeated_word, agreement, wrong_function_word |
390
- | token_binary | list of int8 | 1 if the token carries an error tag |
391
- | n_corruptions | int8 | 0, 1, 2 or 3 |
392
- | source, source_id, source_author | string | provenance (Tatoeba sentence id and contributor username) |
393
- | license | string | SPDX licence of the sentence |
394
- | split | string | split name |
395
 
396
- In `test_natural` only `binary` and `token_binary` are defined (real errors have no operation type): `multiclass` and `token_tags` are -1 (null in csv/jsonl) and `multilabel`, `n_corruptions` are -1.
397
 
398
- CSV files store list columns as JSON strings and labels as names; JSONL stores labels as names; the Hub/DatasetDict version stores ClassLabel integers.
399
-
400
- Mix per split: 50 percent clean, 30 percent one corruption (balanced over the 5 operations), 20 percent two or three different corruptions.
401
-
402
- ## Corruption operations
403
-
404
- - **word_order**: swap two tokens at distance up to 3; both tokens are tagged. Swaps must involve a determiner, preposition, auxiliary, pronoun or verb; adverbs never move; English never swaps a subject with an auxiliary (that makes a valid question); Italian never swaps ADJ and NOUN, two NOUNs, two arguments of one verb, or a subject with its verb.
405
- - **missing_word**: delete one function word (article, preposition, non-modal auxiliary, infinitival "to"; Italian articles, simple and articulated prepositions, auxiliaries and reflexive clitics).
406
- - **repeated_word**: duplicate a token right after itself; the duplicate is tagged. Words whose doubling can be grammatical ("that that", "had had", "molto molto") are excluded.
407
- - **agreement**: EN subject-verb (LemmInflect VBZ/VBP, be, negative contractions), determiner-noun number (this/these, a + plural noun), a/an. IT gender and number across DET (articles, articulated prepositions, possessives, demonstratives), NOUN and ADJ; subject-verb person and number; predicative adjective and participle (with essere) agreement. Forms come from Morph-it! (same lemma, different feature) and must be real word forms that cannot also carry the original feature value. Only relations present in the clean parse (nsubj, det, amod) are targeted.
408
- - **wrong_function_word**: confusion sets. EN: in/on/at, to/for/of, and a restricted a/the confusion ("a" for "the" only before plural nouns or superlatives). IT: a/di/da/in/su/per/con, articulated prepositions (preposition part changed), article allomorphs il/lo, i/gli, un/uno (article gender/number changes belong to agreement).
409
- - **multiple**: 2 or 3 different operations applied sequentially on non-overlapping tokens.
410
-
411
- ## Missing-word tag convention
412
-
413
- A deleted word leaves no token to tag, so the token right after the gap is tagged `missing_word`; if the gap is at the end of the sentence, the last token is tagged.
414
-
415
- ## Tokenization and normalization
416
-
417
- Tokens are whitespace separated. In Italian, elided forms are split off and keep their apostrophe ("l'uomo" -> "l'", "uomo"; "dell'acqua" -> "dell'", "acqua") and `text` glues them back. Punctuation stays attached to words. Normalization: `lower_nopunct` (lowercase and strip the final punctuation by default); `clean_text_raw` keeps the original form.
418
-
419
- ## Sources and attribution
420
-
421
- - **tatoeba** (https://downloads.tatoeba.org/exports/per_language/), licence CC-BY-2.0, export date(s): Sat, 31 Oct 2026 06:39:48 GMT, Sat, 31 Oct 2026 06:41:23 GMT, Sat, 31 Oct 2026 06:52:53 GMT. Sentences from Tatoeba (https://tatoeba.org), by the Tatoeba contributors named in the source_author column. Licensed CC BY 2.0 FR unless marked CC0 1.0.
422
-
423
- Full attribution, including every Tatoeba contributor, is in ATTRIBUTION.md.
424
-
425
- ## Licence mode and pool sizes
426
-
427
- Requested mode: `auto`. Labels, corruptions and annotations are Apache-2.0.
428
-
429
- | lang | mode used | reason | permissive pool | total pool | threshold | config licence |
430
- |---|---|---|---|---|---|---|
431
- | en | apache-strict | auto: permissive pool 16632 >= threshold 15000 | 16632 | 30492 | 15000 | apache-2.0 |
432
- | it | source-licenses | auto: permissive pool 7 < threshold 15000, falling back to source licences | 7 | 30890 | 15000 | cc-by-2.0 |
433
-
434
- Hub repository licence (most restrictive across configs): `cc-by-2.0`.
435
-
436
-
437
- ## Filters and verification
438
-
439
- Clean-sentence filters: (a) NFC, one sentence, 5 to 20 tokens; (b) no digits, URLs, emoji, quotes, brackets, symbols, all-caps, at most one proper noun, any single proper noun capped at 2 percent of the pool; (c) language ID (lingua); (d) LanguageTool with no grammar or typo match (style, casing and punctuation rules ignored); (e) Stanza parse with exactly one root and no X tags; (f) causal LM filter dropping the lowest 5 percent mean log-prob per length bucket; (g) exact, normalized and MinHash near-duplicate removal on lemma shingles.
440
-
441
- - en rejections: a_normalize_length 376302, b_lexical 360959, c_langid 390, d_languagetool 1128, e_parse 113, f_lm 1839, g_dedup_exact 0, g_dedup_normalized 3, g_dedup_near 271, b2_name_cap 4208
442
- - it rejections: a_normalize_length 300398, b_lexical 80147, c_langid 745, d_languagetool 1128, e_parse 35, f_lm 2004, g_dedup_exact 0, g_dedup_normalized 169, g_dedup_near 3428, b2_name_cap 3609
443
-
444
- Verification of corrupted rows: differs from the clean sentence; equals no clean-pool sentence; agreement re-checked against the lexicon and the clean parse; tags aligned and label views consistent; causal-LM minimal pair mean_logprob(clean) - mean_logprob(corrupted) >= delta. LanguageTool flag rates are diagnostic only.
445
 
446
- | lang | op | acceptance rate | LM diff (clean minus corrupted) | LanguageTool flag rate |
447
  |---|---|---|---|---|
448
- | en | delta | 0.2931 | | |
449
- | en | agreement | 0.8463 | mean 0.6704, p05 0.2088, p50 0.6329, p95 1.2737 (n=1501) | 0.6663 |
450
- | en | missing_word | 0.9432 | mean 1.1297, p05 0.334, p50 1.0809, p95 2.1028 (n=1501) | 0.098 |
451
- | en | multiple | 0.9924 | mean 2.2748, p05 0.7465, p50 2.2206, p95 4.0155 (n=4963) | 0.7964 |
452
- | en | repeated_word | 0.7986 | mean 0.5242, p05 0.1246, p50 0.5014, p95 1.0081 (n=1033) | 0.9705 |
453
- | en | word_order | 0.9879 | mean 2.1046, p05 0.7121, p50 2.0346, p95 3.748 (n=1501) | 0.2878 |
454
- | en | wrong_function_word | 0.8187 | mean 0.7581, p05 0.1189, p50 0.6938, p95 1.6234 (n=1501) | 0.1082 |
455
- | it | delta | 0.0 | | |
456
- | it | agreement | 0.8042 | mean 0.4275, p05 -0.1925, p50 0.423, p95 1.0904 (n=1517) | 0.0455 |
457
- | it | missing_word | 0.8075 | mean 0.7946, p05 -0.038, p50 0.7511, p95 1.7632 (n=1517) | 0.001 |
458
- | it | multiple | 0.8154 | mean 1.1644, p05 -0.0937, p50 1.103, p95 2.6638 (n=5014) | 0.5776 |
459
- | it | repeated_word | 0.6762 | mean 0.1622, p05 -0.4701, p50 0.1878, p95 0.7297 (n=1517) | 0.998 |
460
- | it | word_order | 0.8433 | mean 1.1832, p05 0.0676, p50 1.1512, p95 2.4112 (n=1517) | 0.0545 |
461
- | it | wrong_function_word | 0.8639 | mean 0.4446, p05 -0.1298, p50 0.4316, p95 1.129 (n=1517) | 0.0081 |
462
-
463
- Human audit: audit/clean_{lang}.csv (200 clean rows) and audit/corrupted_{lang}.csv (200 corrupted rows, stratified by type) are provided for annotation; results are not filled in yet.
464
 
465
- ## Splits
466
 
467
- Splits are built per language and grouped by source sentence, with automated leakage tests. `test_unseen_lemmas` uses reserved content lemmas that never occur in train, validation or test. `test_ood_source` uses a different source when enabled and allowed by the licence mode. `test_natural` contains real learner errors (CoEdIT src vs tgt aligned with difflib for English; Italian only from user-supplied files). The `parallel` config keeps translation pairs in the same split, and Italian translations of English sentences are forced into the English sentence's split.
 
468
 
469
- - en: 335 reserved lemmas; dropped: {"unused": 1}
470
- - it: 329 reserved lemmas; dropped: {"forced_unseen_without_reserved_lemma": 9, "unused": 11081}
471
 
472
- ## Tool and model licences
473
 
474
- | tool or model | version | licence | notes |
475
- |---|---|---|---|
476
- | Stanza | 1.15.0 | Apache-2.0 | Library code. |
477
- | Stanza English models (default "combined" package) | | CC-BY-SA-4.0 (EWT) plus other UD English treebanks | Trained on UD English treebanks; the combined package mixes EWT, GUM and others. Check each treebank licence before redistributing parses. |
478
- | Stanza Italian models (default "combined" package) | | CC-BY-NC-SA (ISDT, VIT, PoSTWITA, TWITTIRO training data) **NON-COMMERCIAL** | Model weights derive from non-commercial treebanks. Used only as a tool; no parses are redistributed. |
479
- | LanguageTool | 6.6 | LGPL-2.1-or-later | |
480
- | Morph-it! | 0.48 | CC-BY-SA-2.0 OR LGPL-3.0 | Used as a lexicon to generate and validate Italian word forms; not redistributed. |
481
- | LemmInflect | 0.2.3 | MIT | |
482
- | lingua-language-detector | 2.1.1 | Apache-2.0 | |
483
- | datasketch | 2.0.0 | MIT | |
484
- | openai-community/gpt2 | | MIT | English causal LM for the LM filter and the minimal-pair verifier. |
485
- | Qwen/Qwen2.5-0.5B | | Apache-2.0 | Italian causal LM for the LM filter and the verifier (multilingual model). sapienzanlp/Minerva-350M-base-v1.0 (Apache-2.0, Italian-specific, gated) is a drop-in alternative via lm.it in the config. |
486
 
487
- Tool outputs (parses, LM scores) are not redistributed; they only drive filtering, target selection and verification.
488
-
489
- ## Related work
490
-
491
- - **BLiMP**: Warstadt et al. (2020), The Benchmark of Linguistic Minimal Pairs for English, TACL.
492
- - **CoLA**: Warstadt, Singh and Bowman (2019), Neural Network Acceptability Judgments, TACL.
493
- - **ItaCoLA**: Trotta et al. (2021), Monolingual and Cross-Lingual Acceptability Judgments with the Italian CoLA corpus, Findings of EMNLP.
494
- - **BLiMP-IT**: Italian minimal-pair benchmarks modelled on BLiMP (see the BLiMP-IT and related Italian minimal-pair releases).
495
- - **AcCompl-it**: Brunato et al. (2020), AcCompl-it at EVALITA 2020: acceptability and complexity prediction for Italian.
496
- - **DaLA**: Danish linguistic acceptability dataset built by corrupting correct sentences with controlled error types.
497
 
498
  ## Limitations
499
 
500
- - Corruptions are synthetic and rule based: they cover five error families, not the full range of learner errors (see test_natural for real errors).
501
- - Verification is automatic. A corrupted sentence can occasionally still be grammatical (for example a preposition swap that yields another valid reading), and filters can let through awkward clean sentences. The audit files estimate both error rates.
502
- - Tatoeba sentences are short, conversational and dominated by a few contributors and recurring names; the proper-noun cap reduces but does not remove this.
503
- - Default normalization lowercases text and strips final punctuation, so capitalization and punctuation cues are not available to models.
504
- - Surface cues: repeated words and some word-order swaps are detectable with shallow features; see the TF-IDF baselines before claiming a model learned syntax.
505
- - The Italian LanguageTool grammar coverage is limited, so the Italian clean filter relies more on the parser and LM filters.
506
 
 
 
 
 
 
 
 
 
14
  - grammar
15
  - acceptability
16
  configs:
 
 
 
 
 
 
 
 
 
 
17
  - config_name: en
18
  data_files:
19
  - split: train
 
34
  path: it/test-*
35
  - split: test_unseen_lemmas
36
  path: it/test_unseen_lemmas-*
37
+ - config_name: both
38
+ data_files:
39
+ - split: train
40
+ path: both/train-*
41
+ - split: validation
42
+ path: both/validation-*
43
+ - split: test
44
+ path: both/test-*
45
+ - split: test_unseen_lemmas
46
+ path: both/test_unseen_lemmas-*
47
  - config_name: parallel
48
  data_files:
49
  - split: train
 
54
  path: parallel/test-*
55
  - split: test_unseen_lemmas
56
  path: parallel/test_unseen_lemmas-*
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  ---
58
 
59
  # Lapsus
60
 
61
+ Lapsus is a small dataset of grammatical and ungrammatical sentences in English and Italian. It was made for the course **Elaborazione del Linguaggio Naturale** at [Kore University of Enna](https://www.uke.it), for hands-on exercises with BERT-style models. The code that builds it is on [GitHub](https://github.com/MorenoLaQuatra/lapsus).
62
 
63
+ ## How it works
64
 
65
+ We take clean sentences from [Tatoeba](https://tatoeba.org) and break some of them on purpose, keeping track of what we broke and where. There are five kinds of errors:
66
 
67
+ - `word_order`: two nearby words are swapped (*"i never your cut hair"*)
68
+ - `missing_word`: a function word is deleted (*"she went the station"*)
69
+ - `repeated_word`: a word is doubled (*"he is is tired"*)
70
+ - `agreement`: a form no longer agrees (*"the dogs runs"*, *"la ragazzi"*)
71
+ - `wrong_function_word`: the wrong preposition or article (*"in"* instead of *"on"*, *"di"* instead of *"da"*)
72
 
73
+ In every split 50% of the sentences are clean, 30% have one error and 20% have two or three (labelled `multiple`).
 
 
 
 
 
74
 
75
+ Each broken sentence is checked before it is kept: the new word must be a real form, the result must not be another clean sentence, and a small language model must like it less than the original, that is $\log p(\text{clean}) - \log p(\text{corrupted}) \geq \delta$ (average per token). The checks are automatic, so a few mistakes are still in there.
 
76
 
77
+ ## Tasks
78
 
79
+ The same rows support four tasks. For *"the dogs runs fast"*:
80
 
81
+ | task | column | label |
82
  |---|---|---|
83
+ | binary | `binary` | `not_ok` |
84
+ | error type | `multiclass` | `agreement` |
85
+ | error types (multi-label) | `multilabel` | $[0, 0, 0, 1, 0]$ |
86
+ | token tagging | `token_tags` | *runs* is tagged `agreement`, the rest `O` |
 
 
 
 
 
 
 
 
 
 
 
87
 
88
+ The `multilabel` order is `word_order`, `missing_word`, `repeated_word`, `agreement`, `wrong_function_word`. When a word is missing, the token right after the gap gets the tag.
89
 
90
+ ## Configs and splits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
91
 
92
+ | config | `train` | `validation` | `test` | `test_unseen_lemmas` |
93
  |---|---|---|---|---|
94
+ | `en` | 11865 | 1483 | 1483 | 1500 |
95
+ | `it` | 12000 | 1500 | 1500 | 1500 |
96
+ | `both` | 23865 | 2983 | 2983 | 3000 |
97
+ | `parallel` | 120 | 20 | 6 | 4 |
 
 
 
 
 
 
 
 
 
 
 
 
98
 
99
+ `both` is `en` plus `it` with a `lang` column. `parallel` is a small set of English-Italian translation pairs (`pair_id`). In `test_unseen_lemmas` the content words never appear in the other splits, so it tests generalization rather than memorization.
100
 
101
+ ```python
102
+ from datasets import load_dataset
103
 
104
+ ds = load_dataset("morenolq/lapsus", "it")
105
+ ```
106
 
107
+ Other useful columns: `tokens`, `clean_text` (the original sentence), `n_corruptions`, `source_id`, `source_author` and `license`. Text is lowercased and the final punctuation is removed; Italian elisions are split (*l'uomo* becomes *l'* + *uomo*).
108
 
109
+ ## Licence
 
 
 
 
 
 
 
 
 
 
 
110
 
111
+ The dataset is released as `cc-by-2.0` because it follows its Tatoeba sources: English sentences are CC0 (public domain), Italian sentences are CC BY 2.0 FR. Each row has its own `license` column and every contributor is listed in `ATTRIBUTION.md`. Labels and code are Apache-2.0.
 
 
 
 
 
 
 
 
 
112
 
113
  ## Limitations
114
 
115
+ - The errors are synthetic and cover only five families, not everything learners do.
116
+ - Tatoeba sentences are short and conversational.
117
+ - Some errors (like repeated words) are easy to spot with shallow features, so try a TF-IDF baseline before claiming a model learned syntax.
118
+
119
+ ## Citation
 
120
 
121
+ ```bibtex
122
+ @misc{lapsus,
123
+ title = {Lapsus: a bilingual grammatical acceptability dataset for teaching NLP},
124
+ howpublished = {\url{https://github.com/MorenoLaQuatra/lapsus}},
125
+ year = {2026}
126
+ }
127
+ ```