Upload README.md
Browse files
README.md
CHANGED
|
@@ -1,17 +1,73 @@
|
|
| 1 |
---
|
| 2 |
license: other
|
| 3 |
language:
|
| 4 |
-
- en
|
| 5 |
tags:
|
| 6 |
-
- wto
|
| 7 |
-
- trade
|
| 8 |
-
- legal
|
| 9 |
-
- dispute-settlement
|
| 10 |
-
- international-law
|
| 11 |
-
- rag
|
| 12 |
pretty_name: WTO Dispute Settlement Body Documents
|
| 13 |
size_categories:
|
| 14 |
-
- 10K<n<100K
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
---
|
| 16 |
|
| 17 |
# WTO Dispute Settlement Body Documents
|
|
@@ -125,6 +181,36 @@ OCR (Tesseract) was applied as a fallback for 78 scanned PDFs where PyPDF extrac
|
|
| 125 |
|
| 126 |
## Usage Example
|
| 127 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
```python
|
| 129 |
import json
|
| 130 |
|
|
@@ -136,7 +222,7 @@ with open("wto_documents_full.jsonl") as f:
|
|
| 136 |
break
|
| 137 |
```
|
| 138 |
|
| 139 |
-
**Load all
|
| 140 |
|
| 141 |
```python
|
| 142 |
import json
|
|
@@ -151,9 +237,22 @@ def get_case_docs(jsonl_path, case_number, doc_type=None):
|
|
| 151 |
docs.append(doc)
|
| 152 |
return docs
|
| 153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
consultations = get_case_docs("wto_documents_full.jsonl", 267, "Request_For_Consultations")
|
| 155 |
```
|
| 156 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 157 |
## Data Source and Processing
|
| 158 |
|
| 159 |
Documents were scraped from the [WTO Dispute Settlement Gateway](https://www.wto.org/english/tratop_e/dispu_e/dispu_e.htm) using Selenium. PDFs were parsed with PyPDFLoader (text-based) and Tesseract OCR (scanned). Dates were extracted multilingually (English, French, Spanish) from PDF headings.
|
|
@@ -166,4 +265,4 @@ Documents were scraped from the [WTO Dispute Settlement Gateway](https://www.wto
|
|
| 166 |
- `date` is `null` for ~4.5% of records (mostly untitled addenda and cross-reference files).
|
| 167 |
- Non-English documents (primarily French/Spanish originals) have reduced `clean_text` quality after line-level language filtering.
|
| 168 |
- Taiwan (`Chinese Taipei`) has no UN ideal point data in linked panel datasets — expected, as it is not a UN member.
|
| 169 |
-
- DS627+ cases exist in case metadata but have no associated PDFs in this corpus (collection cutoff: DS626).
|
|
|
|
| 1 |
---
|
| 2 |
license: other
|
| 3 |
language:
|
| 4 |
+
- en
|
| 5 |
tags:
|
| 6 |
+
- wto
|
| 7 |
+
- trade
|
| 8 |
+
- legal
|
| 9 |
+
- dispute-settlement
|
| 10 |
+
- international-law
|
| 11 |
+
- rag
|
| 12 |
pretty_name: WTO Dispute Settlement Body Documents
|
| 13 |
size_categories:
|
| 14 |
+
- 10K<n<100K
|
| 15 |
+
configs:
|
| 16 |
+
- config_name: default
|
| 17 |
+
data_files:
|
| 18 |
+
- split: train
|
| 19 |
+
path: wto_documents_full.jsonl
|
| 20 |
+
dataset_info:
|
| 21 |
+
features:
|
| 22 |
+
- name: folder_number
|
| 23 |
+
dtype: string
|
| 24 |
+
- name: case_number
|
| 25 |
+
dtype: string
|
| 26 |
+
- name: original_filename
|
| 27 |
+
dtype: string
|
| 28 |
+
- name: new_filename
|
| 29 |
+
dtype: string
|
| 30 |
+
- name: doc_sequence
|
| 31 |
+
dtype: int32
|
| 32 |
+
- name: doc_type
|
| 33 |
+
dtype: string
|
| 34 |
+
- name: doc_type_raw
|
| 35 |
+
dtype: string
|
| 36 |
+
- name: doc_class
|
| 37 |
+
dtype: string
|
| 38 |
+
- name: variant
|
| 39 |
+
dtype: string
|
| 40 |
+
- name: part_number
|
| 41 |
+
dtype: int32
|
| 42 |
+
- name: case_title
|
| 43 |
+
dtype: string
|
| 44 |
+
- name: date
|
| 45 |
+
dtype: string
|
| 46 |
+
- name: header_codes
|
| 47 |
+
dtype: string
|
| 48 |
+
- name: agreement_indicators
|
| 49 |
+
dtype: string
|
| 50 |
+
- name: complainant
|
| 51 |
+
dtype: string
|
| 52 |
+
- name: respondent
|
| 53 |
+
dtype: string
|
| 54 |
+
- name: third_parties
|
| 55 |
+
dtype: string
|
| 56 |
+
- name: dispute_stage
|
| 57 |
+
dtype: string
|
| 58 |
+
- name: agreements_cited
|
| 59 |
+
dtype: string
|
| 60 |
+
- name: case_summary
|
| 61 |
+
dtype: string
|
| 62 |
+
- name: page_count
|
| 63 |
+
dtype: int32
|
| 64 |
+
- name: clean_text
|
| 65 |
+
dtype: string
|
| 66 |
+
- name: processing_date
|
| 67 |
+
dtype: string
|
| 68 |
+
splits:
|
| 69 |
+
- name: train
|
| 70 |
+
num_examples: 9414
|
| 71 |
---
|
| 72 |
|
| 73 |
# WTO Dispute Settlement Body Documents
|
|
|
|
| 181 |
|
| 182 |
## Usage Example
|
| 183 |
|
| 184 |
+
### With the HuggingFace `datasets` library (recommended)
|
| 185 |
+
|
| 186 |
+
```python
|
| 187 |
+
from datasets import load_dataset
|
| 188 |
+
|
| 189 |
+
# Load full dataset
|
| 190 |
+
ds = load_dataset("dean22029/WTO_Docs")
|
| 191 |
+
df = ds["train"].to_pandas()
|
| 192 |
+
|
| 193 |
+
# Filter to a single case
|
| 194 |
+
ds267 = ds["train"].filter(lambda x: x["case_number"] == "267")
|
| 195 |
+
|
| 196 |
+
# Filter by document type
|
| 197 |
+
consultations = ds["train"].filter(
|
| 198 |
+
lambda x: x["doc_type"] == "Request_For_Consultations"
|
| 199 |
+
)
|
| 200 |
+
|
| 201 |
+
# Filter by dispute stage
|
| 202 |
+
appellate = ds["train"].filter(
|
| 203 |
+
lambda x: x["dispute_stage"] == "Appellate Body"
|
| 204 |
+
)
|
| 205 |
+
|
| 206 |
+
# Access a record
|
| 207 |
+
print(ds["train"][0]["case_number"]) # "1"
|
| 208 |
+
print(ds["train"][0]["doc_type"]) # "Request_For_Consultations"
|
| 209 |
+
print(ds["train"][0]["clean_text"][:300])
|
| 210 |
+
```
|
| 211 |
+
|
| 212 |
+
### With plain Python (no dependencies)
|
| 213 |
+
|
| 214 |
```python
|
| 215 |
import json
|
| 216 |
|
|
|
|
| 222 |
break
|
| 223 |
```
|
| 224 |
|
| 225 |
+
**Load all documents for a specific case:**
|
| 226 |
|
| 227 |
```python
|
| 228 |
import json
|
|
|
|
| 237 |
docs.append(doc)
|
| 238 |
return docs
|
| 239 |
|
| 240 |
+
# All documents for DS267 (EC - Beef Hormones)
|
| 241 |
+
all_docs = get_case_docs("wto_documents_full.jsonl", 267)
|
| 242 |
+
|
| 243 |
+
# Consultation requests only
|
| 244 |
consultations = get_case_docs("wto_documents_full.jsonl", 267, "Request_For_Consultations")
|
| 245 |
```
|
| 246 |
|
| 247 |
+
**Parse the `third_parties` field:**
|
| 248 |
+
|
| 249 |
+
```python
|
| 250 |
+
import ast
|
| 251 |
+
|
| 252 |
+
doc = json.loads(line)
|
| 253 |
+
third_parties = ast.literal_eval(doc["third_parties"]) # e.g. ["USA", "Canada"]
|
| 254 |
+
```
|
| 255 |
+
|
| 256 |
## Data Source and Processing
|
| 257 |
|
| 258 |
Documents were scraped from the [WTO Dispute Settlement Gateway](https://www.wto.org/english/tratop_e/dispu_e/dispu_e.htm) using Selenium. PDFs were parsed with PyPDFLoader (text-based) and Tesseract OCR (scanned). Dates were extracted multilingually (English, French, Spanish) from PDF headings.
|
|
|
|
| 265 |
- `date` is `null` for ~4.5% of records (mostly untitled addenda and cross-reference files).
|
| 266 |
- Non-English documents (primarily French/Spanish originals) have reduced `clean_text` quality after line-level language filtering.
|
| 267 |
- Taiwan (`Chinese Taipei`) has no UN ideal point data in linked panel datasets — expected, as it is not a UN member.
|
| 268 |
+
- DS627+ cases exist in case metadata but have no associated PDFs in this corpus (collection cutoff: DS626).
|