Azzindani commited on
Commit
ba099d6
Β·
verified Β·
1 Parent(s): 6b7b0fd

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +39 -50
README.md CHANGED
@@ -1,73 +1,62 @@
1
  ---
2
- license: apache-2.0
 
 
 
3
  language:
4
  - id
5
  tags:
6
  - legal
7
  - indonesia
8
- - regulations
9
- - knowledge-graph
10
  - rag
11
- task_categories:
12
- - text-retrieval
13
- - question-answering
14
- size_categories:
15
- - 100K<n<1M
16
  ---
17
 
18
- # Indonesian Legal RAG Processed Database
19
 
20
- This repository contains a fully preprocessed Indonesian legal regulation database ready for RAG (Retrieval Augmented Generation) systems.
21
 
22
- ## Dataset Information
23
- - **Total Records**: 199,994
24
- - **Processing Date**: 2025-08-23
25
- - **Embedding Model**: Qwen/Qwen3-Embedding-0.6B
26
- - **Embedding Dimension**: 1024
27
 
28
- ## Files Description
29
 
30
- ### Main Database
31
- - `processed_legal_database.parquet` - Complete preprocessed database with all features
32
- - `embeddings.npy` - Pre-computed embeddings array for fast loading
 
33
 
34
- ### Supporting Components
35
- - `tfidf_components.pkl` - TF-IDF vectorizer and matrix for keyword matching
36
- - `knowledge_graph.json` - Legal concept relationships and hierarchy
37
- - `config.json` - Processing configuration and parameters
38
- - `processing_summary.json` - Processing statistics and metadata
39
 
40
- ### Utilities
41
- - `database_loader.py` - Helper class for easy database loading
 
 
42
 
43
- ## Features Included
44
 
45
- Each record contains:
46
- - **Basic Information**: Regulation type, number, year, enacting body, content
47
- - **Authority Score**: Hierarchical legal authority level (0-1)
48
- - **Temporal Score**: Regulation currency/relevance (0-1)
49
- - **Legal Richness**: Legal term density and complexity (0-1)
50
- - **Cross-Reference Strength**: Inter-regulation connectivity (0-1)
51
- - **Completeness Score**: Information completeness (0-1)
52
- - **Knowledge Graph Features**: Entity extraction and concept relationships
53
- - **Pre-computed Embeddings**: Ready-to-use vector representations
54
 
55
- ## Usage
56
 
57
- ```python
58
- from database_loader import ProcessedLegalDatabaseLoader
 
 
59
 
60
- # Load complete database
61
- loader = ProcessedLegalDatabaseLoader(".", local_mode=True)
62
- df, embeddings, tfidf, kg, config = loader.load_all()
63
 
64
- # Ready for RAG system - no preprocessing needed!
65
- ```
66
 
67
- ## Memory Requirements
68
- - **Database**: ~1260MB
69
- - **Embeddings**: ~781MB
70
- - **Total**: ~2747MB
71
 
72
- ## License
73
- Please ensure compliance with Indonesian legal data usage regulations.
 
 
 
1
  ---
2
+ license: cc-by-4.0
3
+ task_categories:
4
+ - text-generation
5
+ - question-answering
6
  language:
7
  - id
8
  tags:
9
  - legal
10
  - indonesia
 
 
11
  - rag
12
+ - markdown
13
+ - regulation
14
+ - structural-parsing
 
 
15
  ---
16
 
17
+ # πŸ“‘ Indonesian Regulation Markdown RAG Dataset (ID_REG_MD_RAG)
18
 
19
+ This repository contains a highly structured, **Markdown-optimized** collection of Indonesian Regulations (Peraturan Perundang-undangan). This dataset is specifically engineered to solve the "structure loss" problem often encountered when building Retrieval-Augmented Generation (RAG) systems for complex legal documents. πŸ›οΈ
20
 
21
+ ## πŸ’‘ The Concept: Structural Integrity for RAG
 
 
 
 
22
 
23
+ Legal documents in Indonesia follow a strict hierarchy: **Undang-Undang β†’ Peraturan Pemerintah β†’ Peraturan Menteri**, subdivided into **Bab (Chapters), Bagian (Parts), Paragraf (Paragraphs), and Pasal (Articles)**.
24
 
25
+ Standard text-stripping methods lose this hierarchy, causing RAG systems to retrieve "Pasal 1" without knowing which Chapter or Regulation it belongs to. This dataset solves that by:
26
+ * πŸ—οΈ **Markdown Conversion:** All regulations are converted into clean Markdown, using headers (`#`, `##`, `###`) to preserve the legal hierarchy.
27
+ * πŸ”— **Contextual Anchoring:** Each chunk maintains its structural relationship to the parent heading, allowing LLMs to "see" the full path of a regulation.
28
+ * βœ‚οΈ **RAG-Ready Chunking:** Optimized for semantic splitters that respect Markdown boundaries, ensuring that an Article is never cut in half during retrieval.
29
 
30
+ ## πŸ› οΈ Data Acquisition & Pipeline
 
 
 
 
31
 
32
+ This dataset was compiled using a systematic developer workflow:
33
+ * **Source:** Official Indonesian regulatory repositories and government gazettes. 🌐
34
+ * **Transformation:** Raw documents (PDF) were processed through a custom pipeline to extract structural elements and reformat them into consistent Markdown syntax. πŸ”„
35
+ * **Methodology:** Built using legitimate developer-sanctioned methods, ensuring clean data lineage and high-fidelity text extraction without the noise of typical web scraping. βœ…
36
 
37
+ ## πŸ§ͺ Use Cases
38
 
39
+ * **Advanced RAG Pipelines:** Powering legal assistants that can accurately identify the specific Bab or Bagian a statute belongs to. πŸ”
40
+ * **Semantic Search:** Building search engines that understand the hierarchical importance of legal headers. πŸš€
41
+ * **Legal Knowledge Graphs:** Using the Markdown structure to map relationships between different regulatory tiers. 🧠
42
+ * **LLM Fine-Tuning:** Training models to generate legal documents that follow the official Indonesian legislative format. πŸŽ“
 
 
 
 
 
43
 
44
+ ## πŸ“‚ Dataset Structure
45
 
46
+ Each entry is optimized for ingestion:
47
+ * **filename:** The official name of the regulation (e.g., UU Nomor 1 Tahun 2024).
48
+ * **content_md:** The full text of the regulation in structured Markdown format. πŸ“‘
49
+ * **metadata:** Includes the type of regulation, year of issuance, and original source references.
50
 
51
+ ## πŸ“œ License & Attribution
 
 
52
 
53
+ This dataset is licensed under the **Creative Commons Attribution 4.0 International (CC BY 4.0)**. πŸ“
 
54
 
55
+ ### Attribution
56
+ 1. **Dataset Curator:** Azzindani (via Hugging Face Datasets).
57
+ 2. **Original Source:** Government of the Republic of Indonesia (Public Domain).
 
58
 
59
+ ---
60
+ **Disclaimer:** *This dataset is provided for research and development purposes. While formatted for high accuracy in AI applications, users should always verify the text against official government gazettes (Lembaran Negara) for formal legal activities.* ⚠️
61
+
62
+ ---