| | --- |
| | license: apache-2.0 |
| | language: |
| | - id |
| | tags: |
| | - legal |
| | - indonesia |
| | - regulations |
| | - knowledge-graph |
| | - rag |
| | task_categories: |
| | - text-retrieval |
| | - question-answering |
| | size_categories: |
| | - 100K<n<1M |
| | --- |
| | |
| | π§ [Github](https://github.com/azzindani) |
| | π [LinkedIn](https://www.linkedin.com/in/azzindan1/) |
| |
|
| | # ποΈ Indonesian Legal RAG Dataset with Embeddings & TF-IDF Vectors |
| |
|
| | ## π What is this dataset? |
| |
|
| | This dataset contains **Indonesian legal documents** with **pre-computed embeddings** and **TF-IDF vectors** for building RAG (Retrieval-Augmented Generation) systems. It includes regulations, laws, and legal documents from Indonesia with ready-to-use vector representations. |
| |
|
| | π― **Perfect for**: Legal AI, Indonesian NLP, RAG systems, semantic search, and legal chatbots |
| |
|
| | ## β¨ Key Features |
| |
|
| | - π **~10,000 Indonesian regulations** |
| | - π― **Dense embeddings** (1024-dimensional vectors) |
| | - π **TF-IDF vectors** (5000-dimensional sparse vectors) |
| | - βοΈ **Complete legal metadata** (regulation type, year, authority, etc.) |
| | - π **Ready for semantic search** - no preprocessing needed! |
| | - π **Optimized for RAG** retrieval systems |
| | - π **Full document text** included |
| | - ποΈ **Indonesian legal hierarchy** preserved |
| |
|
| | ## π What's Inside? |
| |
|
| | ### π Document Fields |
| | - **Document content**: Full text of legal documents |
| | - **Metadata**: Regulation type, number, year, issuing body |
| | - **Structure**: Chapters, articles, and sections |
| | - **Embeddings**: 1024-dim dense vectors for semantic similarity |
| | - **TF-IDF**: 5000-dim sparse vectors for keyword matching |
| |
|
| | ### ποΈ Legal Document Types |
| | - π **UUD** - Constitution (Undang-Undang Dasar) |
| | - π **UU** - Laws (Undang-Undang) |
| | - ποΈ **PP** - Government Regulations (Peraturan Pemerintah) |
| | - π― **PERPRES** - Presidential Regulations (Peraturan Presiden) |
| | - π **PERMEN** - Ministerial Regulations (Peraturan Menteri) |
| | - ποΈ **PERDA** - Regional Regulations (Peraturan Daerah) |
| |
|
| | ## π Complete Data Schema |
| |
|
| | | Field | Type | Dimension | Description | Example | |
| | |-------|------|-----------|-------------|---------| |
| | | π `global_id` | string | - | Unique document identifier | "legal_doc_001" | |
| | | π·οΈ `local_id` | string | - | Source-specific ID | "local_001" | |
| | | π `regulation_type` | string | - | Type of regulation | "UU", "PP", "PERPRES" | |
| | | ποΈ `enacting_body` | string | - | Government entity | "Kementerian Hukum" | |
| | | π’ `regulation_number` | string | - | Official number | "No. 8 Tahun 1999" | |
| | | π
`year` | string | - | Year enacted | "1999" | |
| | | π `about` | string | - | Document topic | "Perlindungan Konsumen" | |
| | | π
`effective_date` | string | - | When it takes effect | "1999-04-20" | |
| | | π `chapter` | string | - | Document chapter | "BAB I" | |
| | | π `article` | string | - | Specific article | "Pasal 1" | |
| | | π `content` | string | - | Full document text | "Pasal 1. Dalam Undang-undang..." | |
| | | π― `embedding` | list[float] | **1024** | Dense semantic vectors | [0.1, 0.2, -0.3, ...] | |
| | | π `tfidf_vector` | list[float] | **5000** | Sparse keyword vectors | [0.0, 0.15, 0.0, 0.8, ...] | |
| | | π’ `chunk_id` | int | - | Document chunk number | 1 | |
| |
|
| | ## β οΈ Important Notes |
| |
|
| | ### β
What This Dataset Is Good For: |
| | - π€ Building Indonesian legal RAG systems |
| | - π Semantic search in legal documents |
| | - π Legal document clustering and analysis |
| | - π― Training legal AI models |
| | - π Legal research and information retrieval |
| |
|
| | ### β What This Dataset Is NOT: |
| | - βοΈ **Not legal advice** - for research/education only! |
| | - π― **Not 100% accurate** - always verify with official sources |
| | - π **Not for other legal systems** - specific to Indonesia |
| | - β° **Not always current** - laws change over time |
| | - π **Not query-ready** - you need to encode your queries |
| |
|
| | ### π¨ Limitations: |
| | - π **Fixed dimensions** - embeddings are 1024-dim, TF-IDF is 5000-dim |
| | - π― **Model dependency** - embeddings quality depends on the model used |
| | - π **TF-IDF vocabulary** - limited to 5000 most common terms |
| | - β° **Point-in-time** - vectors represent documents at creation time |
| | - π **No query encoder included** - you need your own query encoding |
| |
|
| | ## π Preprocessing Pipeline |
| |
|
| | The dataset was created using this pipeline: |
| |
|
| | 1. π₯ **Data Collection** - Indonesian legal documents gathered |
| | 2. π§Ή **Text Cleaning** - Remove noise, normalize formatting |
| | 3. π **TF-IDF Vectorization** - Create 5000-dim sparse vectors |
| | 4. π― **Embedding Generation** - Create 1024-dim dense vectors |
| | 5. β
**Quality Control** - Validate dimensions and formats |
| | 6. πΎ **Dataset Creation** - Package into HuggingFace format |
| |
|
| | --- |
| |
|
| | **π Happy Legal AI Building!** ποΈβ¨ |
| |
|
| | *Ready-to-use vectors for Indonesian legal RAG systems* π―π |
| |
|
| |
|