File size: 5,879 Bytes
c9d319f
9f799f3
 
 
c9d319f
 
 
 
 
9f799f3
 
 
 
 
 
c9d319f
 
 
 
 
 
 
 
9f799f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c9d319f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c4da079
 
 
 
 
 
 
 
 
 
 
 
 
 
c9d319f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
db002d9
c9d319f
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
---
language:
- fr
- en
license: cc-by-4.0
task_categories:
- question-answering
- text-generation
- table-question-answering
pretty_name: The case-law, centralizing legal decisions for better use
configs:
- config_name: default
  data_files:
  - split: us
    path: data/us-*
tags:
- legal
- droit
- fiscalité
- taxation
- δεξιά
- recht
- derecho
dataset_info:
  features:
  - name: id
    dtype: string
  - name: title
    dtype: string
  - name: citation
    dtype: string
  - name: docket_number
    dtype: string
  - name: state
    dtype: string
  - name: issuer
    dtype: string
  - name: document
    dtype: string
  - name: hash
    dtype: string
  - name: timestamp
    dtype: string
  splits:
  - name: us
    num_bytes: 9138869838
    num_examples: 541371
  download_size: 4597435136
  dataset_size: 9138869838
---
## Dataset Description
- **Repository:** https://huggingface.co/datasets/HFforLegal/case-law
- **Leaderboard:** N/A
- **Point of Contact:** [Louis Brulé Naudet](mailto:[email protected])
  
# The Case-law, centralizing legal decisions for better use, a community Dataset.

The Case-law Dataset is a comprehensive collection of legal decisons from various countries, centralized in a common format. This dataset aims to improve the development of legal AI models by providing a standardized, easily accessible corpus of global legal documents.

<div class="not-prose bg-gradient-to-r from-gray-50-to-white text-gray-900 border" style="border-radius: 8px; padding: 0.5rem 1rem;">
    <p>Join us in our mission to make AI more accessible and understandable for the legal world, ensuring that the power of language models can be harnessed effectively and ethically in the pursuit of justice.</p>
</div>

## Objective

The primary objective of this dataset is to centralize laws from around the world in a common format, thereby facilitating:

1. Comparative legal studies
2. Development of multilingual legal AI models
3. Cross-jurisdictional legal research
4. Improvement of legal technology tools

By providing a standardized dataset of global legal texts, we aim to accelerate the development of AI models in the legal domain, enabling more accurate and comprehensive legal analysis across different jurisdictions.

## Dataset Structure

The dataset is organized with the following columns:

- `id`: A unique identifier for each document
- `title`: The title of the legal document
- `citation`: The citation information for the document, referencing legal precedents or sources
- `docket_number`: The docket number associated with the legal case or document
- `state`: The state or jurisdiction related to the document (e.g., "Maine"...)
- `issuer`: The entity or authority that issued the document
- `document`: The full text content of the legal document
- `hash`: A SHA-256 hash of the document for verification purposes, ensuring data integrity
- `timestamp`: The timestamp indicating when the document was created, enacted, or last updated

Easy-to-use script for hashing the `document`:

```python
import hashlib
import datasets

def hash(
  text: str
) -> str:
    """
    Create or update the hash of the document content.

    This function takes a text input, converts it to a string, encodes it in UTF-8, 
    and then generates a SHA-256 hash of the encoded text.

    Parameters
    ----------
    text : str
        The text content to be hashed.

    Returns
    -------
    str
        The SHA-256 hash of the input text, represented as a hexadecimal string.
    """
    return hashlib.sha256(str(text).encode()).hexdigest()

dataset = dataset.map(lambda x: {"hash": hash(x["document"])})
```

## Country-based Splits

The dataset uses country-based splits to organize legal documents from different jurisdictions. Each split is identified by the ISO 3166-1 alpha-2 code of the corresponding country.

### ISO 3166-1 alpha-2 Codes

ISO 3166-1 alpha-2 codes are two-letter country codes defined in ISO 3166-1, part of the ISO 3166 standard published by the International Organization for Standardization (ISO).

Some examples of ISO 3166-1 alpha-2 codes:
- France: fr
- United States: us
- United Kingdom: gb
- Germany: de
- Japan: jp
- Brazil: br
- Australia: au

Before submitting a new split, please make sure the proposed split fits within the ISO code for the related country. 

### Accessing Country-specific Data

To access legal documents for a specific country, you can use the country's ISO 3166-1 alpha-2 code as the split name when loading the dataset. Here's an example:

```python
from datasets import load_dataset

# Load the entire dataset
dataset = load_dataset("HFforLegal/case-law")

# Access the French legal decisions
fr_dataset = dataset['fr']
```

## Ethical Considerations

While this dataset provides a valuable resource for legal AI development, users should be aware of the following ethical considerations:

- Privacy: Ensure that all personal information has been properly anonymized.
- Bias: Be aware of potential biases in the source material and in the selection of included laws.
- Currency: Laws change over time. Always verify that you're working with the most up-to-date version of a law for any real-world application.
- Jurisdiction: Legal interpretations can vary by jurisdiction. AI models trained on this data should not be used as a substitute for professional legal advice.

## Citing & Authors

If you use this dataset in your research, please use the following BibTeX entry.

```BibTeX
@misc{HFforLegal2024,
  author =       {Louis Brulé Naudet, Timothy Dolan},
  title =        {The case-law, centralizing legal decisions for better use},
  year =         {2024}
  howpublished = {\url{https://huggingface.co/datasets/HFforLegal/case-law}},
}
```

## Feedback

If you have any feedback, please reach out at [[email protected]](mailto:[email protected]).