dean22029 commited on
Commit
869b355
·
verified ·
1 Parent(s): 3ef6a3a

Update Readme

Browse files
Files changed (1) hide show
  1. README.md +171 -3
README.md CHANGED
@@ -1,3 +1,171 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: other
3
+ language:
4
+ - en
5
+ - fr
6
+ - es
7
+ tags:
8
+ - wto
9
+ - trade
10
+ - legal
11
+ - dispute-settlement
12
+ - international-law
13
+ - rag
14
+ pretty_name: WTO Dispute Settlement Body Documents
15
+ size_categories:
16
+ - 10K<n<100K
17
+ ---
18
+
19
+ # WTO Dispute Settlement Body Documents
20
+
21
+ Full-text corpus of official WTO Dispute Settlement Body (DSB) documents spanning DS1–DS626, covering January 1995 through early 2026. Sourced from the WTO's public case repository and processed into structured records for retrieval-augmented generation (RAG) and NLP research.
22
+
23
+ ## Coverage
24
+
25
+ | Stat | Value |
26
+ |---|---|
27
+ | Total records | 9,414 |
28
+ | Unique cases | 626 (DS1–DS626) |
29
+ | Date coverage | ~95.5% of records |
30
+ | Document types | 42 distinct types |
31
+ | Languages processed | English (primary); French and Spanish (minority) |
32
+ | Source | WTO Dispute Settlement Gateway |
33
+
34
+ ## Data Structure
35
+
36
+ Each line in `wto_documents_full.jsonl` is a JSON object with the following fields:
37
+
38
+ ### Case-level fields (repeated per document within a case)
39
+
40
+ | Field | Type | Description |
41
+ |---|---|---|
42
+ | `folder_number` | string | Source folder number (matches case number in most cases) |
43
+ | `case_number` | string | WTO DS case number (e.g. `"267"` for DS267) |
44
+ | `case_title` | string | Official WTO case title in uppercase (e.g. `"EC - MEASURES CONCERNING MEAT AND MEAT PRODUCTS"`) |
45
+ | `complainant` | string | JSON-encoded list of complainant country names |
46
+ | `respondent` | string | JSON-encoded list of respondent country names |
47
+ | `third_parties` | string | JSON-encoded list of third-party country names |
48
+ | `dispute_stage` | string | Furthest procedural stage reached (see [Dispute Stages](#dispute-stages)) |
49
+ | `agreements_cited` | string | WTO agreement articles at issue (raw text from case page) |
50
+ | `case_summary` | string | Official WTO case summary (scraped from the WTO website) |
51
+
52
+ ### Document-level fields
53
+
54
+ | Field | Type | Description |
55
+ |---|---|---|
56
+ | `original_filename` | string | Filename of the source PDF |
57
+ | `new_filename` | string | Standardized filename: `DS{case}_SEQ{nn}_{DocType}[_Variant][_Part].pdf` |
58
+ | `doc_sequence` | integer | Sequential document number within the case |
59
+ | `doc_type` | string | Consolidated document type (42 categories; see [Document Types](#document-types)) |
60
+ | `doc_type_raw` | string | Raw document type string extracted from the PDF heading |
61
+ | `doc_class` | string | Filename class: `NUMBERED`, `R_FILE`, `D_FILE`, `W_FILE`, or `CROSS_REF` |
62
+ | `variant` | string or null | Document variant: `Add`, `Corr`, `Rev`, `Sup`, or `null` |
63
+ | `part_number` | integer or null | Part index for multi-part documents (zero-based), or `null` |
64
+ | `date` | string or null | Document date extracted from PDF heading (e.g. `"14 July 2004"`); `null` if not found |
65
+ | `header_codes` | string | Official WTO document codes from the heading (e.g. `"WT/DS267/1"`) |
66
+ | `agreement_indicators` | string | Agreement/article references found in the heading area |
67
+ | `page_count` | integer | Number of pages in the source PDF |
68
+ | `clean_text` | string | Full document text cleaned for embedding (headers, boilerplate, and footnotes removed) |
69
+ | `processing_date` | string | ISO 8601 timestamp of when this record was processed |
70
+
71
+ ## Document Types
72
+
73
+ The 42 consolidated document types, with record counts:
74
+
75
+ | Document Type | Count | Description |
76
+ |---|---|---|
77
+ | `Communication` | 1,831 | Official communications between parties or from the Secretariat |
78
+ | `Request_To_Join_Consultations` | 1,036 | Third-party requests to join ongoing consultations |
79
+ | `Status_Report` | 991 | Implementation status reports submitted by respondents |
80
+ | `Addendum` | 958 | Addenda to previously circulated documents |
81
+ | `Report_Of_Panel` | 816 | Panel reports (full text or interim) |
82
+ | `Request_For_Consultations` | 699 | Initial consultation requests filed by complainants |
83
+ | `Request_For_Establishment_Of_Panel` | 541 | Formal panel establishment requests |
84
+ | `Note_By_Secretariat` | 538 | Informational notes issued by the WTO Secretariat |
85
+ | `Report_Of_Appellate_Body` | 327 | Appellate Body reports |
86
+ | `Agreement_Art_21_3` | 158 | Article 21.3 DSU reasonable period of time determinations |
87
+ | `Notification_Of_Appeal` | 158 | Formal notifications of appeal to the Appellate Body |
88
+ | `Working_Procedures` | 152 | Panel or Appellate Body working procedures |
89
+ | `Appellate_Body_Report_And_Panel_Report` | 146 | Combined circulation of AB + Panel reports |
90
+ | `Recourse` | 141 | Recourse proceedings (Arts. 21.5, 22.2, 22.6, 22.7) |
91
+ | `Understanding` | 133 | Bilateral understandings and agreed solutions |
92
+ | `Notification_Of_Mutually_Agreed_Solution` | 122 | Formal notifications of mutually agreed solutions |
93
+ | `Executive_Summary` | 101 | Executive summaries of panel or AB reports |
94
+ | `Submission` | 88 | Party submissions (oral statements, first/second written submissions) |
95
+ | `Request_For_Arbitration` | 87 | Arbitration requests under DSU Articles 21.3, 22.6, or 25 |
96
+ | `Arbitration_Award` | 65 | Awards or decisions by arbitrators |
97
+ | *(22 additional types)* | ~528 | Panel compositions, procedural rulings, cross-references, etc. |
98
+
99
+ ## Dispute Stages
100
+
101
+ The `dispute_stage` field reflects the furthest procedural stage reached by each case:
102
+
103
+ | Stage | Records | Description |
104
+ |---|---|---|
105
+ | `Appellate Body` | 3,211 | Case reached the Appellate Body |
106
+ | `Panel` | 2,449 | Panel established and reported; no appeal |
107
+ | `Mutually Agreed Solution` | 1,597 | Parties settled before or during panel proceedings |
108
+ | `Implementation & Compliance` | 1,121 | Post-ruling compliance proceedings (Art. 21.5) |
109
+ | `Consultation` | 862 | Consultations requested; case did not proceed to panel |
110
+ | `Retaliation & Arbitration` | 163 | Authorization to suspend concessions (Art. 22) |
111
+
112
+ ## Text Cleaning
113
+
114
+ The `clean_text` field has been processed through a 10-step pipeline optimized for embedding quality:
115
+
116
+ 1. Header-area boilerplate removal (WTO cover page patterns)
117
+ 2. Document codes stripped (`WT/DS...`, `G/...`)
118
+ 3. Language markers removed (`anglais/English/français`)
119
+ 4. Page numbers removed
120
+ 5. Footnotes removed (underscore separators + numbered continuations)
121
+ 6. Non-English lines removed (French/Spanish detected via function-word threshold)
122
+ 7. Repeated case titles deduplicated
123
+ 8. Punctuation noise cleaned
124
+ 9. Whitespace normalized
125
+
126
+ OCR (Tesseract) was applied as a fallback for 78 scanned PDFs where PyPDF extraction yielded fewer than 50 characters.
127
+
128
+ ## Usage Example
129
+
130
+ ```python
131
+ import json
132
+
133
+ with open("wto_documents_full.jsonl") as f:
134
+ for line in f:
135
+ doc = json.loads(line)
136
+ print(doc["case_number"], doc["doc_type"], doc["date"])
137
+ print(doc["clean_text"][:300])
138
+ break
139
+ ```
140
+
141
+ **Load all consultation requests for a specific case:**
142
+
143
+ ```python
144
+ import json
145
+
146
+ def get_case_docs(jsonl_path, case_number, doc_type=None):
147
+ docs = []
148
+ with open(jsonl_path) as f:
149
+ for line in f:
150
+ doc = json.loads(line)
151
+ if doc["case_number"] == str(case_number):
152
+ if doc_type is None or doc["doc_type"] == doc_type:
153
+ docs.append(doc)
154
+ return docs
155
+
156
+ consultations = get_case_docs("wto_documents_full.jsonl", 267, "Request_For_Consultations")
157
+ ```
158
+
159
+ ## Data Source and Processing
160
+
161
+ 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.
162
+
163
+ **Case metadata** (complainant, respondent, third parties, dispute stage, agreements cited, case summary) was scraped separately from WTO case pages and joined by case number.
164
+
165
+ ## Known Limitations
166
+
167
+ - `third_parties` field stores Python list repr strings (e.g. `"['USA', 'EU']"`); parse with `ast.literal_eval()`.
168
+ - `date` is `null` for ~4.5% of records (mostly untitled addenda and cross-reference files).
169
+ - Non-English documents (primarily French/Spanish originals) have reduced `clean_text` quality after line-level language filtering.
170
+ - Taiwan (`Chinese Taipei`) has no UN ideal point data in linked panel datasets — expected, as it is not a UN member.
171
+ - DS627+ cases exist in case metadata but have no associated PDFs in this corpus (collection cutoff: DS626).