Datasets:
Update README.md
Browse files
README.md
CHANGED
|
@@ -95,4 +95,129 @@ configs:
|
|
| 95 |
data_files:
|
| 96 |
- split: train
|
| 97 |
path: queries/train-*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 95 |
data_files:
|
| 96 |
- split: train
|
| 97 |
path: queries/train-*
|
| 98 |
+
license: cc-by-4.0
|
| 99 |
+
task_categories:
|
| 100 |
+
- sentence-similarity
|
| 101 |
+
language:
|
| 102 |
+
- az
|
| 103 |
+
tags:
|
| 104 |
+
- retrieval
|
| 105 |
+
- lquad
|
| 106 |
+
- azerbaijani
|
| 107 |
+
pretty_name: LDQuAd v2 Retrieval Dataset
|
| 108 |
+
size_categories:
|
| 109 |
+
- 100K<n<1M
|
| 110 |
---
|
| 111 |
+
# LDQuAd v2 Retrieval Dataset
|
| 112 |
+
|
| 113 |
+
A retrieval dataset built from [LocalDoc/LDQuAd_v2](https://huggingface.co/datasets/LocalDoc/LDQuAd_v2) — a question-answer dataset over Azerbaijani-language Wikipedia content. Designed for training and evaluating information retrieval, semantic search, and RAG pipelines in Azerbaijani.
|
| 114 |
+
|
| 115 |
+
## Dataset Configs
|
| 116 |
+
|
| 117 |
+
The dataset consists of three configs that can be joined via `passage_id`:
|
| 118 |
+
|
| 119 |
+
### `corpus`
|
| 120 |
+
|
| 121 |
+
The passage collection — one row per unique content passage.
|
| 122 |
+
|
| 123 |
+
| Column | Description |
|
| 124 |
+
|---|---|
|
| 125 |
+
| `passage_id` | Unique identifier of the passage (SHA-256 prefix) |
|
| 126 |
+
| `title` | Wikipedia article title |
|
| 127 |
+
| `content` | The text passage |
|
| 128 |
+
|
| 129 |
+
### `queries`
|
| 130 |
+
|
| 131 |
+
One question per passage, each as a separate row.
|
| 132 |
+
|
| 133 |
+
| Column | Description |
|
| 134 |
+
|---|---|
|
| 135 |
+
| `passage_id` | Links to the relevant passage in `corpus` |
|
| 136 |
+
| `title` | Wikipedia article title |
|
| 137 |
+
| `question` | The question in Azerbaijani |
|
| 138 |
+
|
| 139 |
+
### `hard_negatives`
|
| 140 |
+
|
| 141 |
+
BM25-mined hard negatives scored by a cross-encoder reranker ([BAAI/bge-reranker-v2-m3](https://huggingface.co/BAAI/bge-reranker-v2-m3)). Each row contains up to 10 hard negative passage IDs with their reranker scores.
|
| 142 |
+
|
| 143 |
+
| Column | Description |
|
| 144 |
+
|---|---|
|
| 145 |
+
| `passage_id` | Positive passage ID (links to `corpus`) |
|
| 146 |
+
| `question` | The question text in Azerbaijani |
|
| 147 |
+
| `pos_score` | Reranker score of the positive passage |
|
| 148 |
+
| `neg_{k}_id` | passage_id of the k-th hard negative |
|
| 149 |
+
| `neg_{k}_score` | Reranker score of the k-th hard negative |
|
| 150 |
+
|
| 151 |
+
## Source Dataset
|
| 152 |
+
|
| 153 |
+
Based on [LocalDoc/LDQuAd_v2](https://huggingface.co/datasets/LocalDoc/LDQuAd_v2) which contains 351,000 question-answer pairs derived from Azerbaijani-language content. Passages were filtered by content length (200–10,000 characters) and deduplicated before building the retrieval corpus.
|
| 154 |
+
|
| 155 |
+
## Hard Negative Mining Pipeline
|
| 156 |
+
|
| 157 |
+
1. Unique passages were extracted and deduplicated by content
|
| 158 |
+
2. For each question, top-100 candidates were retrieved using BM25
|
| 159 |
+
3. The positive passage was excluded from candidates
|
| 160 |
+
4. Each candidate was scored with a cross-encoder reranker (BAAI/bge-reranker-v2-m3)
|
| 161 |
+
5. Candidates with scores above 95% of the positive score were filtered out as likely false negatives
|
| 162 |
+
6. Top-10 remaining negatives were kept, sorted by score (hardest first)
|
| 163 |
+
|
| 164 |
+
## Example
|
| 165 |
+
|
| 166 |
+
```python
|
| 167 |
+
from datasets import load_dataset
|
| 168 |
+
|
| 169 |
+
corpus = load_dataset("LocalDoc/ldquad_v2_retrieval", "corpus")["train"]
|
| 170 |
+
queries = load_dataset("LocalDoc/ldquad_v2_retrieval", "queries")["train"]
|
| 171 |
+
hard_negs = load_dataset("LocalDoc/ldquad_v2_retrieval", "hard_negatives")["train"]
|
| 172 |
+
|
| 173 |
+
# Build lookups
|
| 174 |
+
passage_lookup = {row["passage_id"]: row for row in corpus}
|
| 175 |
+
neg_lookup = {row["passage_id"]: row for row in hard_negs}
|
| 176 |
+
|
| 177 |
+
# Pick a query
|
| 178 |
+
q = queries[0]
|
| 179 |
+
print(f"Question: {q['question']}")
|
| 180 |
+
|
| 181 |
+
# Positive passage
|
| 182 |
+
pos = passage_lookup[q["passage_id"]]
|
| 183 |
+
print(f"Positive: {pos['content'][:200]}...")
|
| 184 |
+
|
| 185 |
+
# Hard negatives
|
| 186 |
+
hn = neg_lookup[q["passage_id"]]
|
| 187 |
+
print(f"Positive score: {hn['pos_score']:.4f}")
|
| 188 |
+
|
| 189 |
+
for k in range(1, 4):
|
| 190 |
+
nid = hn[f"neg_{k}_id"]
|
| 191 |
+
nscore = hn[f"neg_{k}_score"]
|
| 192 |
+
if nid:
|
| 193 |
+
neg = passage_lookup[nid]
|
| 194 |
+
print(f"Neg-{k} [score={nscore:.4f}]: {neg['content'][:200]}...")
|
| 195 |
+
```
|
| 196 |
+
|
| 197 |
+
### Example Output
|
| 198 |
+
|
| 199 |
+
```
|
| 200 |
+
Question: 2006/2007-ci il Azərbaycan kubokunda "Xəzər Lənkəran" hansı mərhələdə yarışa qoşuldu?
|
| 201 |
+
|
| 202 |
+
✅ Positive [score=6.3750]:
|
| 203 |
+
2006/2007-ci il Azərbaycan kubokuna "Xəzər Lənkəran" 1/8 final mərhələsində qoşuldu.
|
| 204 |
+
Lənkəran təmsilçisi "Bakılı" klubunu 4:0 və 3:0 məğlub edərək növbəti mərhələyə keçdi.
|
| 205 |
+
1/4 final mərhələsində Lənkəran təmsilçisinin rəqibi "Bakı FK" oldu...
|
| 206 |
+
|
| 207 |
+
❌ Neg-1 [score=5.9414]:
|
| 208 |
+
Daha dəqiq olan Lənkəran təmsilçisi 3:5 hesablı qələbə qazandı və növbəti mərhələyə
|
| 209 |
+
keçdi. 1/4 final mərhələsində rəqib Bakının "Rəvan" klubu oldu. "Xəzər Lənkəran"
|
| 210 |
+
hər iki oyunda qalib gəldi (1:2 və 4:1) və növbəti mərhələyə keçdi...
|
| 211 |
+
|
| 212 |
+
❌ Neg-2 [score=3.2168]:
|
| 213 |
+
Rəqib Gəncənin "Kəpəz" klubu oldu. Reqlamentə əsasən cütlüyün taleyi 1 oyunda həll
|
| 214 |
+
olundu. 1:0 hesablı qələbə qazanan "Xəzər Lənkəran" növbəti mərhələyə keçdi...
|
| 215 |
+
|
| 216 |
+
❌ Neg-3 [score=2.6895]:
|
| 217 |
+
Ölkə birinciliyində Yakuba Bamba və Edmond Ntiamoah 5, Rəşad Abdullayev və Mario
|
| 218 |
+
Serjio Souza 4, Emin Quliyev, Nadir Nəbiyev və Junior Osvaldo 3, Elmar Baxşıyev 2...
|
| 219 |
+
```
|
| 220 |
+
|
| 221 |
+
## Contact
|
| 222 |
+
|
| 223 |
+
For more information, questions, or issues, please contact LocalDoc at [v.resad.89@gmail.com].
|