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 |
+
license: mit
|
| 4 |
+
task_categories:
|
| 5 |
+
- token-classification
|
| 6 |
+
language:
|
| 7 |
+
- en
|
| 8 |
+
tags:
|
| 9 |
+
- word-sense-disambiguation
|
| 10 |
+
- wsd
|
| 11 |
+
- wordnet
|
| 12 |
+
- oewn
|
| 13 |
+
- semeval
|
| 14 |
+
- senseval
|
| 15 |
+
size_categories:
|
| 16 |
+
- 1K<n<10K
|
| 17 |
+
configs:
|
| 18 |
+
- config_name: en-senseval2-aw
|
| 19 |
+
data_files:
|
| 20 |
+
- split: test
|
| 21 |
+
path: data/en-senseval2-aw/test.parquet
|
| 22 |
+
- config_name: en-senseval3-aw
|
| 23 |
+
data_files:
|
| 24 |
+
- split: test
|
| 25 |
+
path: data/en-senseval3-aw/test.parquet
|
| 26 |
+
- config_name: en-semeval2007-aw
|
| 27 |
+
data_files:
|
| 28 |
+
- split: test
|
| 29 |
+
path: data/en-semeval2007-aw/test.parquet
|
| 30 |
+
- config_name: en-semeval2013-aw
|
| 31 |
+
data_files:
|
| 32 |
+
- split: test
|
| 33 |
+
path: data/en-semeval2013-aw/test.parquet
|
| 34 |
+
- config_name: en-semeval2015-aw
|
| 35 |
+
data_files:
|
| 36 |
+
- split: test
|
| 37 |
+
path: data/en-semeval2015-aw/test.parquet
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
# pywsd-datasets
|
| 41 |
+
|
| 42 |
+
Unified Word Sense Disambiguation benchmark datasets, normalized to **modern
|
| 43 |
+
`wn` lexicon sense IDs** (`oewn:2024` for English, OMW for other languages).
|
| 44 |
+
|
| 45 |
+
Companion to [pywsd](https://pypi.org/project/pywsd/) ≥ 1.3.0.
|
| 46 |
+
|
| 47 |
+
## What's in v0.1 (English-only, expanding)
|
| 48 |
+
|
| 49 |
+
| Config | Source | Instances | OEWN 2024 coverage |
|
| 50 |
+
|-----------------------|------------------------|-----------|--------------------|
|
| 51 |
+
| `en-senseval2-aw` | Raganato et al. 2017 | 2,282 | 99.43 % |
|
| 52 |
+
| `en-senseval3-aw` | Raganato et al. 2017 | 1,850 | 99.51 % |
|
| 53 |
+
| `en-semeval2007-aw` | Raganato et al. 2017 | 455 | 99.78 % |
|
| 54 |
+
| `en-semeval2013-aw` | Raganato et al. 2017 | 1,644 | 100.00 % |
|
| 55 |
+
| `en-semeval2015-aw` | Raganato et al. 2017 | 1,022 | 99.32 % |
|
| 56 |
+
| **Total** | | **7,253** | **99.59 %** |
|
| 57 |
+
|
| 58 |
+
## Install
|
| 59 |
+
|
| 60 |
+
```bash
|
| 61 |
+
pip install pywsd-datasets
|
| 62 |
+
```
|
| 63 |
+
|
| 64 |
+
## Use via HuggingFace `datasets`
|
| 65 |
+
|
| 66 |
+
```python
|
| 67 |
+
from datasets import load_dataset
|
| 68 |
+
ds = load_dataset("alvations/pywsd-datasets", "en-senseval2-aw")
|
| 69 |
+
ds["test"][0]
|
| 70 |
+
# {'instance_id': 'd000.s000.t000', 'dataset': 'senseval2_aw',
|
| 71 |
+
# 'split': 'test', 'lang': 'en',
|
| 72 |
+
# 'tokens': ['The', 'art', 'of', 'change-ringing', ...],
|
| 73 |
+
# 'target_idx': 1, 'target_lemma': 'art', 'target_pos': 'n',
|
| 74 |
+
# 'source_sense_id': 'art%1:09:00::',
|
| 75 |
+
# 'source_sense_system': 'pwn_sensekey_3.0',
|
| 76 |
+
# 'sense_ids_wordnet': ['oewn-05646832-n'],
|
| 77 |
+
# 'wordnet_lexicon': 'oewn:2024', ...}
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
## Use via the loader package
|
| 81 |
+
|
| 82 |
+
```python
|
| 83 |
+
from pywsd_datasets.loaders.raganato import iter_instances
|
| 84 |
+
for inst in iter_instances("senseval2"):
|
| 85 |
+
print(inst.target_lemma, inst.sense_ids_wordnet)
|
| 86 |
+
```
|
| 87 |
+
|
| 88 |
+
## Rebuild locally
|
| 89 |
+
|
| 90 |
+
```bash
|
| 91 |
+
pip install pywsd-datasets[dev]
|
| 92 |
+
python -m pywsd_datasets.scripts.build_all # parquet in data/
|
| 93 |
+
python -m pywsd_datasets.scripts.coverage_report # OEWN 2024 resolution %
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
## Schema
|
| 97 |
+
|
| 98 |
+
Every row follows [`WSDInstance`](src/pywsd_datasets/schema.py):
|
| 99 |
+
|
| 100 |
+
```
|
| 101 |
+
instance_id, dataset, split, task, lang,
|
| 102 |
+
tokens[], pos_tags[], lemmas[],
|
| 103 |
+
target_idx, target_lemma, target_pos,
|
| 104 |
+
source_sense_id, source_sense_system,
|
| 105 |
+
sense_ids_wordnet[], wordnet_lexicon,
|
| 106 |
+
doc_id, sent_id
|
| 107 |
+
```
|
| 108 |
+
|
| 109 |
+
`sense_ids_wordnet` is list-valued to handle multi-gold instances and any
|
| 110 |
+
PWN-3.0 key that splits into multiple OEWN 2024 synsets.
|
| 111 |
+
|
| 112 |
+
## Roadmap
|
| 113 |
+
|
| 114 |
+
* **v0.2** — UFSAC corpora (SemCor, WNGT, MASC, OMSTI, Senseval lexical-sample).
|
| 115 |
+
* **v0.3** — WiC (CC-BY-NC), CoarseWSD-20.
|
| 116 |
+
* **v0.4** — XL-WSD multilingual via BabelNet → WordNet → OMW. Initial
|
| 117 |
+
languages: it, de, fr, es, ja (then the full XL-WSD 18 over time).
|
| 118 |
+
|
| 119 |
+
Loader stubs already live under `src/pywsd_datasets/loaders/` for ufsac
|
| 120 |
+
and xl_wsd.
|
| 121 |
+
|
| 122 |
+
## Citation
|
| 123 |
+
|
| 124 |
+
If you use these datasets please cite the original sources:
|
| 125 |
+
|
| 126 |
+
* Raganato, Camacho-Collados, Navigli (2017). *Word Sense Disambiguation:
|
| 127 |
+
A Unified Evaluation Framework and Empirical Comparison.* EACL.
|
| 128 |
+
* Plus the paper for whichever specific evaluation set you use
|
| 129 |
+
(Senseval-2 / 3, SemEval-2007 T17, SemEval-2013 T12, SemEval-2015 T13).
|
| 130 |
+
|
| 131 |
+
## License
|
| 132 |
+
|
| 133 |
+
MIT for the code. Each dataset keeps its original license — see the source
|
| 134 |
+
papers. Raganato bundle and SemEval shared-task data are research-unrestricted.
|
| 135 |
+
|
| 136 |
+
## Sense-ID mapping details
|
| 137 |
+
|
| 138 |
+
PWN 3.0 sense keys are resolved against OEWN 2024 via
|
| 139 |
+
[`wn.compat.sensekey`](https://github.com/goodmami/wn). The few percent of
|
| 140 |
+
keys that fail to resolve are typically WN 3.0 synsets that OEWN split,
|
| 141 |
+
merged, or removed — those rows ship with an empty `sense_ids_wordnet` list
|
| 142 |
+
so the coverage report can flag them. Background:
|
| 143 |
+
|
| 144 |
+
* Kaf (2023). *Mapping Wordnets on the Fly with Permanent Sense Keys.*
|
| 145 |
+
arXiv:2303.01847.
|
| 146 |
+
|
| 147 |
+
## Known issues
|
| 148 |
+
|
| 149 |
+
* `lcl.uniroma1.it` serves a mismatched TLS cert; the loader fetches the
|
| 150 |
+
Raganato bundle over HTTP. When this repo matures we'll mirror the zip
|
| 151 |
+
to the HF Hub release assets.
|
| 152 |
+
* UFSAC v2.1 distribution is a Google Drive zip last updated 2018; same
|
| 153 |
+
mirror plan applies once licensing is confirmed.
|