The dataset viewer is not available for this split.
Error code: FeaturesError Exception: ArrowInvalid Message: JSON parse error: Column() changed from object to string in row 0 Traceback: Traceback (most recent call last): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 174, in _generate_tables df = pandas_read_json(f) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 38, in pandas_read_json return pd.read_json(path_or_buf, **kwargs) File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 815, in read_json return json_reader.read() File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1025, in read obj = self._get_object_parser(self.data) File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1051, in _get_object_parser obj = FrameParser(json, **kwargs).parse() File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1187, in parse self._parse() File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/io/json/_json.py", line 1402, in _parse self.obj = DataFrame( File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/core/frame.py", line 778, in __init__ mgr = dict_to_mgr(data, index, columns, dtype=dtype, copy=copy, typ=manager) File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/core/internals/construction.py", line 503, in dict_to_mgr return arrays_to_mgr(arrays, columns, index, dtype=dtype, typ=typ, consolidate=copy) File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/core/internals/construction.py", line 114, in arrays_to_mgr index = _extract_index(arrays) File "/src/services/worker/.venv/lib/python3.9/site-packages/pandas/core/internals/construction.py", line 680, in _extract_index raise ValueError( ValueError: Mixing dicts with non-Series may lead to ambiguous ordering. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 228, in compute_first_rows_from_streaming_response iterable_dataset = iterable_dataset._resolve_features() File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 3422, in _resolve_features features = _infer_features_from_batch(self.with_format(None)._head()) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2187, in _head return next(iter(self.iter(batch_size=n))) File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 2391, in iter for key, example in iterator: File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1882, in __iter__ for key, pa_table in self._iter_arrow(): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 1904, in _iter_arrow yield from self.ex_iterable._iter_arrow() File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 499, in _iter_arrow for key, pa_table in iterator: File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 346, in _iter_arrow for key, pa_table in self.generate_tables_fn(**gen_kwags): File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 177, in _generate_tables raise e File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 151, in _generate_tables pa_table = paj.read_json( File "pyarrow/_json.pyx", line 308, in pyarrow._json.read_json File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: JSON parse error: Column() changed from object to string in row 0
Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
Bangladesh Legal Acts Dataset
A comprehensive database of Bangladesh's legal framework, containing 1484+ acts scraped and processed from the official Bangladesh Laws portal, enhanced with historical government context, legal system context, and comprehensive metadata.
Dataset Overview
- Total Acts: 1,484
- Total Sections: 35,633
- Total Footnotes: 14,523
- Languages: English, Bengali, Mixed
- Format: JSON with structured metadata
- Historical Context: Government periods from 1799-2025
- Legal System Context: Comprehensive legal framework information
- Enhanced Features: Token counts, year standardization, processing metadata
- License: CC-BY 4.0
Citation
If you use this dataset in your research or project, please cite it as:
@misc{adib_sakhawat_2025,
title = {Bangladesh Legal Acts Dataset},
url = {https://www.kaggle.com/dsv/12511542},
DOI = {10.34740/KAGGLE/DSV/12511542},
publisher = {Kaggle},
author = {Adib Sakhawat},
year = {2025}
}
Data Processing Pipeline
The dataset has been enhanced through multiple processing stages:
- Initial Scraping: Raw legal acts data collection
- Content Cleaning: Text processing and structuring
- Detailed Fetching: Section-by-section content extraction
- Data Combination: Merging structured data
- Enhancement: Token counting and language detection
- Government Context Integration: Historical government information
- Legal System Context Addition: Legal framework contextualization
- Year Translation: Bengali to English numeral conversion
- Error Recovery: Missing context restoration
- Token Count Correction: Accurate tokenization across all fields
- Final Compilation: Comprehensive dataset creation
Individual Act Structure (Enhanced)
{
"act_title": "The Penal Code, 1860",
"act_no": "XLV",
"act_year": "1860",
"publication_date": "6th October, 1860",
"language": "english",
"token_count": 15420,
"is_repealed": false,
"sections": [
{
"section_title": "Chapter I - Introduction",
"section_content": "This Act may be called the Penal Code..."
}
],
"footnotes": [
{
"footnote_text": "Extended to Bangladesh by..."
}
],
"csv_metadata": {
"act_title_from_csv": "The Penal Code, 1860",
"is_repealed": false
},
"government_context": {
"government_name": "British Colonial Government",
"govt_system": "Company Rule",
"position_head_govt": "Governor-General of India",
"head_govt_name": "Lord Canning (Charles Canning)",
"head_govt_designation": "Governor-General of India",
"how_got_power": "Company appointment",
"period_years": "1856-1862",
"years_in_power": 6,
"context_added_at": "2025-07-19T..."
},
"legal_system_context": {
"legal_framework": "British Colonial Legal System",
"government_system": "Colonial Administration",
"policing_system": "Imperial Police System",
"land_relations": "Colonial Land Revenue System",
"period": "1858-1947",
"description": "British Crown rule with colonial administrative framework",
"context_added_at": "2025-07-19T..."
},
"processing_info": {
"government_context_source": "govt.json lookup",
"legal_context_source": "bangladesh_legal_systems.json",
"year_translation": "Original year retained",
"token_count_method": "Comprehensive field tokenization",
"last_updated": "2025-07-19T..."
},
"source_file": "act-print-11.json",
"source_url": "http://bdlaws.minlaw.gov.bd/act-print-11.html",
"fetch_timestamp": "2025-07-19 02:45:32"
}
π Data Features
Enhanced Processing
- Missing Data Recovery: Automatically fills gaps using CSV metadata
- Token Counting: Word-level tokenization for all text content including context fields
- Language Detection: Automatic detection of English/Bengali/Mixed content
- Historical Government Context: Matches each act with the government system and leadership at the time of enactment
- Legal System Context: Comprehensive legal framework information for each historical period
- Year Standardization: Bengali to English numeral translation
- Error Recovery: Automated recovery for files with missing contexts
- Metadata Preservation: Maintains source URLs and timestamps
Quality Assurance
- Error Handling: Robust error logging and recovery mechanisms
- Data Validation: Automatic validation of combined datasets
- Progress Tracking: Real-time processing progress with tqdm
- Statistics: Comprehensive processing statistics and distribution analysis
- Batch Processing: Memory-efficient chunked processing
- Comprehensive Logging: Detailed logs for all processing stages
Government Context Features
- Historical Periods: Covers government systems from 1799-2025
- Leadership Information: Includes head of government names and designations
- Power Transitions: Documents how each government came to power
- System Classification: Categorizes different government types (Company Rule, Colonial, Democratic, Military, etc.)
- Temporal Mapping: Precise year-based matching of acts to government periods
Legal System Context Features
- Legal Framework Classification: Comprehensive categorization of legal systems
- Government System Integration: Links legal framework to government structure
- Policing System Context: Historical policing and law enforcement information
- Land Relations Framework: Land ownership and revenue system context
- Temporal Coverage: Complete coverage across all historical periods
- Contextual Descriptions: Detailed explanations of each legal system period
π Dataset Statistics
Metric | Value |
---|---|
Total Legal Documents | 1,484 |
Date Range | 1799 - 2025 |
Languages | English, Bengali, Mixed |
Total Sections | 35,633 |
Total Footnotes | 14,523 |
Government Periods Covered | 50+ historical periods |
Legal System Periods | 12+ distinct legal frameworks |
Government Systems | Company Rule, Colonial, Military, Democratic, etc. |
Average Tokens per Act | ~2,884 |
Total Dataset Tokens | 2,500,000+ |
Processing Scripts | 10+ specialized processing tools |
Processing Time | ~30 minutes (complete pipeline) |
π οΈ Technical Details
Scraping Process
- Respectful scraping: 300ms delays between requests
- Error resilience: Continues processing despite individual failures
- Memory optimization: Batch processing for large datasets
- Rate limiting: Prevents server overload
Data Processing
- Batch optimization: Processes 50-100 items per batch
- Memory efficiency: Streaming JSON writing for large files
- Unicode support: Full Bengali/English text support
- Incremental processing: Skip already processed files
- Chunked processing: Optimized memory usage for large datasets
- Government context fusion: Efficient lookup-based government matching
- Legal context integration: Temporal period matching algorithms
- Token counting: Regex-based comprehensive tokenization
- Error recovery: Automated detection and correction of processing errors
Processing Pipeline Features
- Modular Design: Each processing stage is independent and reusable
- Progress Tracking: Real-time progress bars and statistics
- Comprehensive Logging: File and console logging for all operations
- Memory Management: Garbage collection and chunked processing
- Error Resilience: Continues processing despite individual file failures
- Statistics Generation: Detailed processing and content statistics
Historical Government Context
The dataset includes comprehensive historical government context for each legal act, covering:
Government Systems Covered
- Company Rule (1799-1858): East India Company administration
- British Colonial Rule (1858-1947): Direct British Crown rule
- Pakistan Period (1947-1971): Dominion and Republic of Pakistan
- Bangladesh Independence (1971-present): Various democratic and military governments
Context Information
- Government system type and duration
- Head of government name and official designation
- Method of acquiring power (election, appointment, coup, etc.)
- Exact period years for historical accuracy
This historical context enables researchers to:
- Analyze legal evolution across different political systems
- Study the impact of government changes on legislation
- Understand the political circumstances surrounding specific laws
- Conduct temporal analysis of legal frameworks
Contributing
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
Legal Notice
This dataset contains legal documents from the Bangladesh government. While the data is publicly available, please:
- Verify accuracy for legal purposes
- Check for updates on the official portal
- Respect the original source attribution
License
This work is licensed under CC-BY 4.0.
You are free to:
- Share and redistribute
- Adapt and transform
- Use commercially
With attribution to this repository.
Related Links
- Bangladesh Laws Portal
- Ministry of Law, Justice and Parliamentary Affairs
- Creative Commons CC-BY 4.0
Contact
For questions about this dataset, please open an issue in this repository.
Disclaimer: This is an unofficial compilation. For legal purposes, always refer to the official Bangladesh Laws portal.
license: cc-by-4.0
- Downloads last month
- 14