Convert born-digital Indonesian regulatory PDFs (OJK POJK/SEOJK) to clean corpus text
Project description
regulasi-id-corpus-prep
Alat CLI untuk mengonversi PDF regulasi Indonesia yang born-digital (POJK, SEOJK dari JDIH OJK) menjadi file .txt bersih yang siap digunakan sebagai input corpus untuk aplikasi NLP hukum, termasuk LexHarmoni.
Syarat: PDF Born-Digital, Bukan Hasil Scan
Alat ini hanya bekerja pada PDF yang memiliki text layer (born-digital). PDF hasil scan (foto/gambar) tidak didukung dan akan ditolak dengan pesan jelas.
Tidak yakin PDF Anda termasuk jenis mana? Lihat docs/DECISION_TREE.md.
Quickstart
Instalasi
Install dari GitHub (saat ini belum tersedia di PyPI):
pip install git+https://github.com/ziffan/regulasi-id-corpus-prep.git
Atau clone dan install dalam mode editable untuk development:
git clone https://github.com/ziffan/regulasi-id-corpus-prep.git
cd regulasi-id-corpus-prep
pip install -e .
PyPI publish direncanakan setelah v0.1.0 mendapat review pengguna non-teknis.
Jalankan Pipeline Penuh (untuk pengguna non-teknis)
regulasi-id-corpus-prep run dokumen-saya.pdf --profile ojk-pojk
Atau untuk seluruh folder:
regulasi-id-corpus-prep run ./folder-pdf/ --profile ojk-pojk --output-dir ./output/
Untuk dokumen SEOJK:
regulasi-id-corpus-prep run ./folder-pdf/ --profile ojk-seojk --output-dir ./output/
Perintah Individual
# Langkah 1: Ekstrak teks dari PDF
regulasi-id-corpus-prep extract dokumen.pdf
# Langkah 2: Normalisasi teks
regulasi-id-corpus-prep normalize dokumen.raw.txt --profile ojk-pojk
# Langkah 3: Validasi otomatis
regulasi-id-corpus-prep validate dokumen.txt --profile ojk-pojk
# Lihat profile yang tersedia
regulasi-id-corpus-prep list-profiles
Output yang Dihasilkan
Untuk setiap <nama>.pdf, alat ini menghasilkan:
| File | Isi |
|---|---|
<nama>.raw.txt |
Teks mentah hasil ekstraksi PDF |
<nama>.raw.meta.json |
Metadata ekstraksi (jumlah halaman, timestamp, dll.) |
<nama>.txt |
Teks bersih siap corpus |
<nama>.meta.json |
Audit trail transformasi (rule apa yang diterapkan, berapa match) |
Profile
Profile adalah file YAML yang mendefinisikan aturan pembersihan untuk jenis dokumen tertentu. Dua profile bawaan tersedia:
| Profile | Dokumen |
|---|---|
ojk-pojk |
POJK (Peraturan OJK) dari JDIH OJK |
ojk-seojk |
SEOJK (Surat Edaran OJK) dari JDIH OJK |
Untuk membuat profile baru (PBI, Permenkeu, dll.), lihat docs/PROFILE_GUIDE.md dan gunakan regulasi_id_corpus_prep/profiles/_template.yaml sebagai titik awal.
Validasi Manual
Validasi otomatis (validate subcommand) mengecek hal-hal teknis. Untuk memastikan substansi dokumen benar, ikuti checklist di docs/VALIDATION_GUIDE.md — tidak memerlukan kemampuan pemrograman.
Keterbatasan (v0.1.0)
- PDF born-digital saja. PDF scan (foto regulasi) tidak dapat diproses.
- Bahasa Indonesia. Dokumen berbahasa lain tidak diuji.
- Profile OJK saja. Arsitektur mendukung PBI, Permenkeu, dll., tapi belum ada profile-nya.
- Tidak mengunduh PDF. Pengguna perlu mengunduh PDF secara manual dari JDIH OJK.
- Tidak ada pemahaman semantik. Output adalah teks biasa; hierarki Pasal tidak diurai.
Lisensi
Apache 2.0. Lihat LICENSE.
Alat ini menggunakan PyMuPDF (AGPL-3.0) sebagai dependensi ekstraksi PDF. Lihat NOTICE untuk detail.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file regulasi_id_corpus_prep-0.1.0.tar.gz.
File metadata
- Download URL: regulasi_id_corpus_prep-0.1.0.tar.gz
- Upload date:
- Size: 20.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b27690bff366d5ba542728bfff75c90fc161b0b053b009f4ab363a50d4d6444d
|
|
| MD5 |
6db36a954e23d0dc81a45a5071ee977d
|
|
| BLAKE2b-256 |
d7fcb034b91154a34d0baf062b57a8ae1aec4c9c445e1466d19aeb1f146131b4
|
File details
Details for the file regulasi_id_corpus_prep-0.1.0-py3-none-any.whl.
File metadata
- Download URL: regulasi_id_corpus_prep-0.1.0-py3-none-any.whl
- Upload date:
- Size: 20.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21b788f4eec1d5b5df76e725d3a1945f77b22cdd132cebb7dcf77a71532583c0
|
|
| MD5 |
acc6ddda216822c63544fa2594faff31
|
|
| BLAKE2b-256 |
21edf724333af03147f0508c86c6b390c5b9cc194765862c9b6ef9b8c110d3ff
|