Datasets:

Modalities:
Text
Formats:
parquet
ArXiv:
License:
File size: 4,914 Bytes
dbef536
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
af10c85
dbef536
af10c85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
069e774
af10c85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
069e774
af10c85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
---
dataset_info:
  features:
  - name: law_code
    dtype: string
  - name: law_name
    dtype: string
  - name: section_num
    dtype: string
  - name: section_content
    dtype: string
  - name: reference
    list:
    - name: include
      dtype: bool
    - name: law_name
      dtype: string
    - name: section_num
      dtype: string
  splits:
  - name: ccl
    num_bytes: 8145015
    num_examples: 5127
  download_size: 1777237
  dataset_size: 8145015
configs:
- config_name: default
  data_files:
  - split: ccl
    path: data/ccl-*
license: mit
---

# 📜 NitiBench-Statute: Thai Legal Corpus for RAG

**Part of the [NitiBench Project](https://github.com/vistec-AI/nitibench/)**

This dataset contains the complete corpus of legal sections used in the **NitiBench** benchmark (CCL and Tax subset). It comprises **5,127 legal sections** extracted from **35 Thai legislations** (primarily focusing on Corporate and Commercial Law).

It is designed to be used as a **Context Pool (Knowledge Base)** for Retrieval-Augmented Generation (RAG) pipelines. Researchers and developers can load this dataset to populate vector databases or search indices to reproduce NitiBench baselines or evaluate new retrieval strategies.

## 🚀 Quick Start

### Loading the Dataset
You can easily load this dataset using the Hugging Face `datasets` library:

```python
from datasets import load_dataset

# Load the statute corpus
dataset = load_dataset("vistec-AI/nitibench-statute", split="ccl")

# Example: Print the first section
print(dataset[0])
```

### Usage for RAG (Context Pool)
To use this as a retrieval source, you typically iterate through the `section_content` to create embeddings:

```python
documents = []
ids = []

for row in dataset:
    # Use 'section_content' as the text chunk to be indexed
    documents.append(row['section_content'])
    # Use 'law_code' or a combination of name+section as ID
    ids.append(f"row['law_code']-row['section_num']")

# ... Proceed to pass `documents` to your VectorDB or Retriever (e.g., FAISS, ChromaDB, BM25)
```

## 📊 Dataset Statistics

*   **Total Documents:** 5,127 sections
*   **Total Legislations:** 35 Legislation (Corporate and Commercial Law)
*   **Language:** Thai

## 📂 Data Structure

Each row represents a specific section of a law.

| Column Name | Type | Description |
|:--- |:--- |:--- |
| `law_code` | `str` | Unique identifier for the specific law section (e.g., `ก0123-1B-0001`). |
| `law_name` | `str` | The official full name of the legislation (e.g., `พระราชบัญญัติการประกอบกิจการพลังงาน พ.ศ. 2550`). |
| `section_num` | `str` | The specific section number within the Act (e.g., `26`). |
| `section_content` | `str` | The full text content to be used for retrieval. This includes the law name, section number, and the provision text combined. |
| `reference` | `list` | A list of cross-references to other laws (if applicable). |

### Example Data Point
```json
{
 "law_code": "ก0123-1B-0001",
 "law_name": "พระราชบัญญัติการประกอบกิจการพลังงาน พ.ศ. 2550",
 "section_num": "26",
 "section_content": "พระราชบัญญัติการประกอบกิจการพลังงาน พ.ศ. 2550 มาตรา 26 ก่อนการออกระเบียบ ข้อบังคับ ประกาศ หรือข้อกำหนดใดของคณะกรรมการซึ่งจะมีผลกระทบต่อบุคคล...",
 "reference": []
}
```

## 📝 Citation

If you use this dataset in your research, please cite the NitiBench paper:

```bibtex
@inproceedings{akarajaradwong-etal-2025-nitibench,
    title = "{N}iti{B}ench: Benchmarking {LLM} Frameworks on {T}hai Legal Question Answering Capabilities",
    author = "Akarajaradwong, Pawitsapak  and
      Pothavorn, Pirat  and
      Chaksangchaichot, Chompakorn  and
      Tasawong, Panuthep  and
      Nopparatbundit, Thitiwat  and
      Pratai, Keerakiat  and
      Nutanong, Sarana",
    booktitle = "Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing",
    month = nov,
    year = "2025",
    publisher = "Association for Computational Linguistics",
}

@misc{akarajaradwong2025nitibenchcomprehensivestudiesllm,
      title={NitiBench: A Comprehensive Studies of LLM Frameworks Capabilities for Thai Legal Question Answering}, 
      author={Pawitsapak Akarajaradwong and Pirat Pothavorn and Chompakorn Chaksangchaichot and Panuthep Tasawong and Thitiwat Nopparatbundit and Sarana Nutanong},
      year={2025},
      eprint={2502.10868},
      archivePrefix={arXiv},
      primaryClass={cs.CL},
      url={https://arxiv.org/abs/2502.10868}, 
}
```

## ⚖️ License
This dataset is provided under the **MIT License**.