Update README: drop Q/P-ids from per-language schema
Browse files
README.md
CHANGED
|
@@ -125,37 +125,43 @@ configs:
|
|
| 125 |
|
| 126 |
# PolyFact
|
| 127 |
|
| 128 |
-
Parallel multilingual factual multiple-choice QA grounded in Wikidata. 100K facts
|
| 129 |
|
| 130 |
## Usage
|
| 131 |
|
| 132 |
```python
|
| 133 |
from datasets import load_dataset
|
| 134 |
|
| 135 |
-
# One language at a time (SFT / eval)
|
| 136 |
ds = load_dataset("jvonrad/PolyFact", "en")
|
| 137 |
print(ds["train"][0])
|
| 138 |
|
| 139 |
-
# All languages aligned per fact (cross-lingual training)
|
| 140 |
par = load_dataset("jvonrad/PolyFact", "parallel")
|
| 141 |
print(par["train"][0]["translations"]["en"])
|
| 142 |
-
|
| 143 |
-
Per-language configs (ar, bn, de, en, es, fr, id, ja, pt, ru, sw, zh) — flat, one row per (fact, language):
|
| 144 |
|
| 145 |
-
|
| 146 |
-
fact_id string Cross-language join key — `<subject_qid>language string ISO language code
|
| 147 |
-
subject string Subject entity label
|
| 148 |
-
relation string Relation name (e.g. educated at)
|
| 149 |
-
object string Object entity label (the canonical answer)
|
| 150 |
-
question string Natural-language question in language
|
| 151 |
-
option_a..option_d string Four multiple-choice options
|
| 152 |
-
answer_text string The correct option as text (matches one of option_a..option_d)
|
| 153 |
-
answer_index int 0-based index of the correct option
|
| 154 |
-
For Wikidata Q-/P-ids (subject_id, property_id, object_id), load the parallel config and join on fact_id.
|
| 155 |
|
| 156 |
-
|
| 157 |
|
| 158 |
-
Column
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 125 |
|
| 126 |
# PolyFact
|
| 127 |
|
| 128 |
+
Parallel multilingual factual multiple-choice QA grounded in Wikidata. 100K facts x 12 languages, fully aligned by `fact_id` across all per-language configs.
|
| 129 |
|
| 130 |
## Usage
|
| 131 |
|
| 132 |
```python
|
| 133 |
from datasets import load_dataset
|
| 134 |
|
|
|
|
| 135 |
ds = load_dataset("jvonrad/PolyFact", "en")
|
| 136 |
print(ds["train"][0])
|
| 137 |
|
|
|
|
| 138 |
par = load_dataset("jvonrad/PolyFact", "parallel")
|
| 139 |
print(par["train"][0]["translations"]["en"])
|
| 140 |
+
```
|
|
|
|
| 141 |
|
| 142 |
+
## Schema
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 143 |
|
| 144 |
+
**Per-language configs** (`ar`, `bn`, `de`, `en`, `es`, `fr`, `id`, `ja`, `pt`, `ru`, `sw`, `zh`) - flat, one row per (fact, language):
|
| 145 |
|
| 146 |
+
| Column | Type | Description |
|
| 147 |
+
|---|---|---|
|
| 148 |
+
| `fact_id` | string | Cross-language join key - `<subject_qid>\|<property_pid>\|<object_qid>` |
|
| 149 |
+
| `language` | string | ISO language code |
|
| 150 |
+
| `subject` | string | Subject entity label |
|
| 151 |
+
| `relation` | string | Relation name (e.g. `educated at`) |
|
| 152 |
+
| `object` | string | Object entity label (the canonical answer) |
|
| 153 |
+
| `question` | string | Natural-language question in `language` |
|
| 154 |
+
| `option_a`..`option_d` | string | Four multiple-choice options |
|
| 155 |
+
| `answer_text` | string | The correct option as text (matches one of `option_a`..`option_d`) |
|
| 156 |
+
| `answer_index` | int | 0-based index of the correct option |
|
| 157 |
+
|
| 158 |
+
For Wikidata Q-/P-ids (`subject_id`, `property_id`, `object_id`), load the `parallel` config and join on `fact_id`.
|
| 159 |
+
|
| 160 |
+
**`parallel` config** - one row per fact:
|
| 161 |
+
|
| 162 |
+
| Column | Type | Description |
|
| 163 |
+
|---|---|---|
|
| 164 |
+
| `fact_id`, `subject`, `subject_id`, `relation`, `property_id`, `object`, `object_id` | - | Shared across languages; Wikidata grounding lives here |
|
| 165 |
+
| `translations` | dict | `{lang_code: {question, option_a..d, answer_text, answer_index}}` |
|
| 166 |
+
|
| 167 |
+
Splits are parallel across languages: every `fact_id` in a split is present in all per-language configs.
|