|
Download README.md from Tonic/legml_code_repo_data: direct link, hf CLI and curl.
- Browser
- Download file 5.26 kB
-
https://huggingface.co/Tonic/legml_code_repo_data/resolve/main/README.md
- Command line
-
hf download hf://Tonic/legml_code_repo_data/README.md
-
curl -L -o README.md https://huggingface.co/Tonic/legml_code_repo_data/resolve/main/README.md
5.26 kB
Legal ML Audit Affaire Enhanced Dataset
This project enhances the les-audits-affaires dataset by adding reference citations and web search results to create a comprehensive legal dataset for French law analysis.
Overview
The project processes the base dataset from huggingface.co/datasets/legmlai/les-audits-affaires and enriches it with:
- Reference Citations: Parsed from legal framework datasets based on the
legal_frameworkfield - Web Search Results: Generated by querying each question through the websearch API
Dataset Schema
The enhanced dataset contains the following columns:
| Column | Type | Description |
|---|---|---|
id |
string | Unique identifier for each entry |
question |
string | Legal question or query |
legal_framework |
string | French legal framework reference |
reference_article_content |
string | Content of the referenced legal article |
reference_article_title |
string | Title of the referenced legal article |
reference_citations |
dict | Dictionary of unique legal references parsed from the content |
websearch_result |
string | Web search results for the question |
Legal Framework Mapping
The project maps legal frameworks to specific datasets for citation parsing:
| Legal Framework | Dataset |
|---|---|
| Cadre légal: Code de commerce français | louisbrulenaudet/code-commerce |
| Cadre légal: Code du travail français | louisbrulenaudet/code-travail |
| Cadre légal: Code monétaire et financier | louisbrulenaudet/code-monetaire-financier |
| Cadre légal: Droit fiscal français | python `None` |
| Cadre légal: Code général des impôts | louisbrulenaudet/cgi |
| Cadre légal: Code de la propriété intellectuelle | louisbrulenaudet/code-propriete-intellectuelle |
| Cadre légal: Code des assurances | louisbrulenaudet/code-assurances |
| Cadre légal: Code de la consommation | louisbrulenaudet/code-consommation |
| Cadre légal: Code de la commande publique | louisbrulenaudet/code-commande-publique |
Project Structure
legml_audit_affaire_enhanced_dataset/
├── datasets/ # Downloaded datasets storage
├── docs/ # Documentation
├── results/ # Output results
├── scripts/ # Utility scripts
├── templates/ # README templates for final dataset
├── tests/ # Test files
├── utils/ # Core processing modules
│ ├── dataops/ # Dataset operations
│ ├── web/ # Web search functionality
│ │ └── websearch.py # Web search implementation
│ └── {dataset_name}/ # Parser modules for each legal framework
│ └── parser.py # Content parsing logic
├── main.py # Main execution script
├── requirements.txt # Python dependencies
└── README.md # This file
Dependencies
huggingface_datasets- Dataset loading and manipulationgradio_client- Web search API integrationhuggingface_hub- Hugging Face Hub operations
Installation
- Clone the repository:
git clone <repository-url>
cd legml_audit_affaire_enhanced_dataset
- Install dependencies:
pip install -r requirements.txt
Usage
Running the Main Script
python main.py
This will:
- Download the base dataset from
legmlai/les-audits-affaires - Download legal framework datasets based on the mapping (None for Legal Framework "Droit Fiscal Francais")
- Parse reference citations from legal content
- Generate web search results for each question
- Create the enhanced dataset with all additional columns
Processing Pipeline
- Dataset Loading: Downloads the base dataset and legal framework datasets
- Citation Parsing: For each entry, parses the
reference_article_contentto extract citations based on thelegal_framework - Web Search: Queries the websearch API for each question using the Gradio client
- Dataset Enhancement: Combines all data into the final enhanced dataset
Output
The enhanced dataset will be saved in the results/ directory with the final dataset :
- Enhanced dataset with all original columns plus
reference_citationsandwebsearch_result
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
[Add your license information here]
Citation
If you use this dataset in your research, please cite:
@dataset{legml_audit_affaire_enhanced,
title={Legal ML Audit Affaire Enhanced Dataset},
author={[Your Name/Organization]},
year={2024},
url={[Dataset URL]}
}
Acknowledgments
- Original dataset: les-audits-affaires
- Legal framework datasets: louisbrulenaudet
- Web search API: victor/websearch