Upload complete model with all files
Browse files- 2025-11-25-15.12.27.png +3 -0
- 2025-11-25-15.14.32.png +3 -0
- README.md +286 -0
- corpus/train-00000-of-00001.parquet +3 -0
- data/train-00000-of-00001.parquet +3 -0
- ozelge_queries_per_doc.png +3 -0
- ozelge_text_length_hist.png +3 -0
- queries/train-00000-of-00001.parquet +3 -0
2025-11-25-15.12.27.png
ADDED
|
Git LFS Details
|
2025-11-25-15.14.32.png
ADDED
|
Git LFS Details
|
README.md
ADDED
|
@@ -0,0 +1,286 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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.0
|
| 5 |
+
task_categories:
|
| 6 |
+
- text-retrieval
|
| 7 |
+
- question-answering
|
| 8 |
+
pretty_name: Turkish Legal Özelge Corpus
|
| 9 |
+
size_categories:
|
| 10 |
+
- 10K<n<100K
|
| 11 |
+
tags:
|
| 12 |
+
- legal
|
| 13 |
+
- turkish
|
| 14 |
+
- özelge
|
| 15 |
+
- tax-law
|
| 16 |
+
- corpus
|
| 17 |
+
- retrieval
|
| 18 |
+
- IR
|
| 19 |
+
- information-retrieval
|
| 20 |
+
- beir
|
| 21 |
+
dataset_info:
|
| 22 |
+
- config_name: corpus
|
| 23 |
+
features:
|
| 24 |
+
- name: _id
|
| 25 |
+
dtype: string
|
| 26 |
+
- name: text
|
| 27 |
+
dtype: string
|
| 28 |
+
splits:
|
| 29 |
+
- name: train
|
| 30 |
+
num_bytes: 120864700
|
| 31 |
+
num_examples: 23587
|
| 32 |
+
download_size: 49244406
|
| 33 |
+
dataset_size: 120864700
|
| 34 |
+
- config_name: default
|
| 35 |
+
features:
|
| 36 |
+
- name: query-id
|
| 37 |
+
dtype: string
|
| 38 |
+
- name: corpus-id
|
| 39 |
+
dtype: string
|
| 40 |
+
- name: score
|
| 41 |
+
dtype: int64
|
| 42 |
+
splits:
|
| 43 |
+
- name: train
|
| 44 |
+
num_bytes: 9147664
|
| 45 |
+
num_examples: 120364
|
| 46 |
+
download_size: 4844361
|
| 47 |
+
dataset_size: 9147664
|
| 48 |
+
- config_name: queries
|
| 49 |
+
features:
|
| 50 |
+
- name: _id
|
| 51 |
+
dtype: string
|
| 52 |
+
- name: text
|
| 53 |
+
dtype: string
|
| 54 |
+
splits:
|
| 55 |
+
- name: train
|
| 56 |
+
num_bytes: 47933248
|
| 57 |
+
num_examples: 120364
|
| 58 |
+
download_size: 21179422
|
| 59 |
+
dataset_size: 47933248
|
| 60 |
+
configs:
|
| 61 |
+
- config_name: corpus
|
| 62 |
+
data_files:
|
| 63 |
+
- split: train
|
| 64 |
+
path: corpus/train-*
|
| 65 |
+
- config_name: default
|
| 66 |
+
data_files:
|
| 67 |
+
- split: train
|
| 68 |
+
path: data/train-*
|
| 69 |
+
- config_name: queries
|
| 70 |
+
data_files:
|
| 71 |
+
- split: train
|
| 72 |
+
path: queries/train-*
|
| 73 |
+
---
|
| 74 |
+
|
| 75 |
+
# Turkish Legal Özelge Corpus Dataset
|
| 76 |
+
|
| 77 |
+
## 📊 Dataset Summary
|
| 78 |
+
|
| 79 |
+
**Turkish Legal Özelge Corpus** is a comprehensive **Information Retrieval** dataset consisting of özelge (tax ruling) decisions published by the Turkish Revenue Administration (Gelir İdaresi Başkanlığı - GİB).
|
| 80 |
+
|
| 81 |
+
### Key Features
|
| 82 |
+
|
| 83 |
+
- **Format**: BEIR (Benchmarking IR) format with corpus-queries-qrels structure
|
| 84 |
+
- **Language**: Turkish 🇹🇷
|
| 85 |
+
- **Domain**: Tax Law, Administrative Law, Turkish Law
|
| 86 |
+
- **Source**: GİB Özelge Decisions
|
| 87 |
+
- **Use Cases**: Information retrieval, question-answering systems, RAG applications
|
| 88 |
+
|
| 89 |
+
---
|
| 90 |
+
|
| 91 |
+
## Dataset Structure
|
| 92 |
+
|
| 93 |
+
The dataset follows the **BEIR format** and consists of three main components:
|
| 94 |
+
|
| 95 |
+
|
| 96 |
+
|
| 97 |
+
### 2. **Queries** (Query Collection)
|
| 98 |
+
Legal information pieces extracted from 7 different perspectives for each document.
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
**7 Query Types:**
|
| 102 |
+
1. **Subject**: Main topic of the özelge
|
| 103 |
+
2. **Article Text**: Text of relevant law articles
|
| 104 |
+
3. **Communique Text**: Content of relevant communiques and circulars
|
| 105 |
+
4. **Regulation Text**: Regulation and legislation texts
|
| 106 |
+
5. **Justification Text**: Legal justifications
|
| 107 |
+
6. **Decision Text**: Administrative opinions and final decisions
|
| 108 |
+
7. **Condition Text**: Application conditions and requirements
|
| 109 |
+
|
| 110 |
+
## Tokenizer Benchmark & Data Filtering Summary
|
| 111 |
+
|
| 112 |
+
This process is not a training error and does not involve any training failure.
|
| 113 |
+
It is a data analysis and preprocessing step performed before model training.
|
| 114 |
+
|
| 115 |
+
We benchmarked seven tokenizers (MPNet, Qwen2, Gemma, XLM-R, BERT, Pretrained, T5) on all datasets to measure token lengths and identify extreme long-sequence outliers.
|
| 116 |
+
Among these, MPNetTokenizerFast generated the highest total token count, making it the most sensitive tokenizer for detecting unusually long samples.
|
| 117 |
+
|
| 118 |
+
Using MPNet as the reference tokenizer, we removed samples that exceeded the dataset-specific average by ~7000 tokens.
|
| 119 |
+
This filtering was applied independently to each dataset to ensure balanced sequence distributions and cleaner input data.
|
| 120 |
+
|
| 121 |
+
The number of removed and remaining samples is summarized in the table below.
|
| 122 |
+
|
| 123 |
+
| Tokenizer | vocab_size | total_tokens | avg_tokens | min_tokens | max_tokens | median_tokens |
|
| 124 |
+
|-------------------------|-----------:|----------------:|-----------:|-----------:|-----------:|---------------:|
|
| 125 |
+
| MPNetTokenizerFast | 30,527 | 276,476,811 | 2,281 | 263 | 12,383 | 1,998 |
|
| 126 |
+
| Qwen2TokenizerFast | 151,669 | 219,326,828 | 1,810 | 190 | 9,201 | 1,594 |
|
| 127 |
+
| GemmaTokenizerFast | 262,144 | 183,710,411 | 1,516 | 158 | 7,578 | 1,341 |
|
| 128 |
+
| XLMRobertaTokenizerFast | 250,002 | 151,008,441 | 1,246 | 132 | 6,397 | 1,099 |
|
| 129 |
+
| BertTokenizerFast | 32,000 | 127,503,718 | 1,052 | 103 | 5,386 | 931 |
|
| 130 |
+
| PretrainedTokenizerFast | 32,000 | 122,387,578 | 1,010 | 102 | 5,227 | 893 |
|
| 131 |
+
| T5TokenizerFast | 32,128 | 121,315,289 | 1,001 | 100 | 5,238 | 885 |
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
<table width="100%">
|
| 135 |
+
<tr>
|
| 136 |
+
<td align="center" width="50%">
|
| 137 |
+
<img
|
| 138 |
+
src="https://huggingface.co/datasets/newmindai/regulation-retrieval/resolve/main/2025-11-25-15.12.27.png"
|
| 139 |
+
width="100%">
|
| 140 |
+
<br>
|
| 141 |
+
<em>Tokenizer / Total Token</em>
|
| 142 |
+
</td>
|
| 143 |
+
<td align="center" width="50%">
|
| 144 |
+
<img
|
| 145 |
+
src="https://huggingface.co/datasets/newmindai/regulation-retrieval/resolve/main/2025-11-25-15.14.32.png"
|
| 146 |
+
width="100%">
|
| 147 |
+
<br>
|
| 148 |
+
<em>Corr of Vocab Size – Total Token</em>
|
| 149 |
+
</td>
|
| 150 |
+
</tr>
|
| 151 |
+
</table>
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
| Dataset | max_tokens | avg_tokens | deleted_samples | total_samples |
|
| 157 |
+
|----------------------------------------|------------:|-------------:|----------------:|--------------:|
|
| 158 |
+
| `newmindai/regulation-retrieval` | 276,476,811 | 2281.19945 | 1,300 | 121,300 |
|
| 159 |
+
| `newmindai/caselaw-retrieval` | 1,386 | 2,281 | 0 | 1,386 |
|
| 160 |
+
| `newmindai/court-of-cassation-caselaw` | 30,527 | 186.4827586 | 11 | 272 |
|
| 161 |
+
|
| 162 |
+
|
| 163 |
+
|
| 164 |
+
### 3. **Default** (Relevance Matrix)
|
| 165 |
+
Relationship table showing which query belongs to which document.
|
| 166 |
+
|
| 167 |
+
| Field | Description |
|
| 168 |
+
|------|----------|
|
| 169 |
+
| `query-id` | Query identifier |
|
| 170 |
+
| `corpus-id` | Related document identifier |
|
| 171 |
+
| `score` | Relevance score (all 1) |
|
| 172 |
+
|
| 173 |
+
|
| 174 |
+
|
| 175 |
+
## Dataset Statistics
|
| 176 |
+
|
| 177 |
+
```
|
| 178 |
+
Total Statistics:
|
| 179 |
+
├─ Corpus Records: 23,701 documents
|
| 180 |
+
├─ Query Records: 121,198 queries
|
| 181 |
+
└─ Relevance Records: 121,198 relations
|
| 182 |
+
|
| 183 |
+
Per Document:
|
| 184 |
+
├─ 1 corpus entry (full ruling text)
|
| 185 |
+
├─ 2–7 queries (legal perspectives)
|
| 186 |
+
└─ Average ~5.1 queries per document
|
| 187 |
+
```
|
| 188 |
+
|
| 189 |
+
### Field Coverage (Queries per Document)
|
| 190 |
+
|
| 191 |
+
On average, each özelge is represented by around **5.1 distinct queries**, corresponding to different legal fields. The distribution of populated query types per document is as follows:
|
| 192 |
+
|
| 193 |
+
- **2 query types**: ~0.1% of documents (e.g., Subject + Article Text)
|
| 194 |
+
- **3 query types**: ~12.3% of documents (e.g., Subject + Article Text + Decision Text)
|
| 195 |
+
- **4 query types**: ~26.2% of documents (e.g., Subject + Article Text + Communique Text + Decision Text)
|
| 196 |
+
- **5 query types**: ~23.9% of documents (e.g., Subject + Article Text + Communique Text + Regulation Text + Decision Text)
|
| 197 |
+
- **6 query types**: ~12.6% of documents (e.g., Subject + Article Text + Communique Text + Regulation Text + Justification Text + Decision Text)
|
| 198 |
+
- **7 query types**: ~24.9% of documents (All fields: Subject + Article Text + Communique Text + Regulation Text + Justification Text + Decision Text + Condition Text)
|
| 199 |
+
|
| 200 |
+
**Query Types Available:**
|
| 201 |
+
1. **Subject**: Main topic/issue of the ruling
|
| 202 |
+
2. **Article Text**: Relevant law article content
|
| 203 |
+
3. **Communique Text**: Official communique/circular content
|
| 204 |
+
4. **Regulation Text**: Regulation and legislation texts
|
| 205 |
+
5. **Justification Text**: Legal reasoning and justifications
|
| 206 |
+
6. **Decision Text**: Administrative opinion and final decision
|
| 207 |
+
7. **Condition Text**: Application conditions and requirements
|
| 208 |
+
|
| 209 |
+
In other words, roughly **61% of the corpus has 5 or more query types populated**, making them rich multi-perspective legal cases rather than shallow single-label examples.
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
|
| 213 |
+
### Text Length Distribution
|
| 214 |
+
|
| 215 |
+
For **corpus texts** (original full özelge rulings with non-empty `ozelge_content`, currently 100 documents):
|
| 216 |
+
|
| 217 |
+
- **Mean length**: ~1,736 words
|
| 218 |
+
- **Median (p50)**: ~1,658 words
|
| 219 |
+
- **90th percentile (p90)**: ~2,393 words
|
| 220 |
+
|
| 221 |
+
These are long, dense legal rulings, comparable to typical tax/administrative decisions with full reasoning and references.
|
| 222 |
+
|
| 223 |
+
For **query texts** (legal snippets extracted from seven perspectives across all 23k+ records):
|
| 224 |
+
|
| 225 |
+
- **Mean length**: ~41.6 words
|
| 226 |
+
- **Median (p50)**: ~24 words
|
| 227 |
+
- **90th percentile (p90)**: ~97 words
|
| 228 |
+
|
| 229 |
+
This makes queries similar to short legal questions, issue statements, justifications or excerpts from statutes/communiques, while the associated corpus entries provide the full ruling context for the subset of records where the full original özelge text is available.
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
|
| 233 |
+
## Use Cases
|
| 234 |
+
|
| 235 |
+
### 1. **Information Retrieval Systems**
|
| 236 |
+
- Training for semantic search models
|
| 237 |
+
- Dense retrieval systems (DPR, ANCE, ColBERT)
|
| 238 |
+
- Sparse retrieval systems (BM25, TF-IDF) benchmark
|
| 239 |
+
|
| 240 |
+
### 2. **RAG (Retrieval-Augmented Generation) Applications**
|
| 241 |
+
- Legal chatbots
|
| 242 |
+
- Tax consultation assistants
|
| 243 |
+
- Automatic özelge analysis systems
|
| 244 |
+
|
| 245 |
+
### 3. **Question-Answering Systems**
|
| 246 |
+
- Legal QA models
|
| 247 |
+
- Extractive and abstractive QA
|
| 248 |
+
- Multi-hop reasoning
|
| 249 |
+
|
| 250 |
+
### 4. 📊 **Model Evaluation**
|
| 251 |
+
- Benchmarking Turkish IR models
|
| 252 |
+
- Retrieval performance analysis
|
| 253 |
+
- Domain adaptation studies
|
| 254 |
+
|
| 255 |
+
---
|
| 256 |
+
|
| 257 |
+
## Data Collection and Processing
|
| 258 |
+
|
| 259 |
+
### Data Source
|
| 260 |
+
The data is sourced from **official özelge decisions of the Turkish Revenue Administration**. Each özelge:
|
| 261 |
+
- Responds to specific questions asked by taxpayers
|
| 262 |
+
- References relevant legislation, communiques, and regulations
|
| 263 |
+
- Contains the Administration's opinion for concrete applications
|
| 264 |
+
|
| 265 |
+
|
| 266 |
+
## Ethics and Legal Notices
|
| 267 |
+
|
| 268 |
+
### License
|
| 269 |
+
This dataset is published under **CC-BY 4.0** license. Please cite the source when using.
|
| 270 |
+
|
| 271 |
+
---
|
| 272 |
+
|
| 273 |
+
## Contribution and Contact
|
| 274 |
+
- **Organization**: NewMind AI
|
| 275 |
+
|
| 276 |
+
|
| 277 |
+
```bibtex
|
| 278 |
+
@dataset{turkish_legal_ozelge_corpus_2025,
|
| 279 |
+
title={Turkish Legal Özelge Corpus: A BEIR-Format Information Retrieval Dataset for Turkish Tax Law},
|
| 280 |
+
author={NewMind AI},
|
| 281 |
+
year={2025},
|
| 282 |
+
publisher={Hugging Face},
|
| 283 |
+
howpublished={\url{https://huggingface.co/datasets/newmindai/tr-tax-rulings-regulations}},
|
| 284 |
+
note={A comprehensive corpus of Turkish tax administration rulings (özelge) for information retrieval and RAG systems}
|
| 285 |
+
}
|
| 286 |
+
```
|
corpus/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b53e55af4b2dc76c950d64294012c0deccc15737feab6d08890899cd76e07e41
|
| 3 |
+
size 49244406
|
data/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:ec9c74b602d43c334552f7c68ad34b74d393030262ab6a85a74e28b95f63fbab
|
| 3 |
+
size 4844361
|
ozelge_queries_per_doc.png
ADDED
|
Git LFS Details
|
ozelge_text_length_hist.png
ADDED
|
Git LFS Details
|
queries/train-00000-of-00001.parquet
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:89c301733d3efd5b20166287549d8ad135b37cc80a1fa3fe99b557d0617d97a2
|
| 3 |
+
size 21179422
|