CoolFace
Datasetpublic

dean22029/WTO_Docs

WTO Dispute Settlement Body Documents 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. Coverage Stat Value Total records 9,414 Unique cases 626 (DS1–DS626) Date coverage ~95.5% of records Document types 42 distinct types… See the full description on the dataset page: https://huggingface.co/datasets/dean22029/WTO_Docs.

sourceHugging Facemitupdated 6mo agoView on Hugging Face
1likes21downloads
Dataset Card

WTO Dispute Settlement Body Documents

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.

Coverage

StatValue
Total records9,414
Unique cases626 (DS1–DS626)
Date coverage~95.5% of records
Document types42 distinct types
Languages processedEnglish
SourceWTO Dispute Settlement Gateway

Data Structure

Each line in wto_documents_full.jsonl is a JSON object with the following fields:

Case-level fields (repeated per document within a case)

FieldTypeDescription
folder_numberstringSource folder number (matches case number in most cases)
case_numberstringWTO DS case number (e.g. "267" for DS267)
case_titlestringOfficial WTO case title in uppercase (e.g. "EC - MEASURES CONCERNING MEAT AND MEAT PRODUCTS")
complainantstringJSON-encoded list of complainant country names
respondentstringJSON-encoded list of respondent country names
third_partiesstringJSON-encoded list of third-party country names
dispute_stagestringFurthest procedural stage reached (see Dispute Stages)
agreements_citedstringWTO agreement articles at issue (raw text from case page)
case_summarystringOfficial WTO case summary (scraped from the WTO website)

Document-level fields

FieldTypeDescription
original_filenamestringFilename of the source PDF
new_filenamestringStandardized filename: DS{case}_SEQ{nn}_{DocType}[_Variant][_Part].pdf
doc_sequenceintegerSequential document number within the case
doc_typestringConsolidated document type (42 categories; see Document Types)
doc_type_rawstringRaw document type string extracted from the PDF heading
doc_classstringFilename class: NUMBERED, R_FILE, D_FILE, W_FILE, or CROSS_REF
variantstring or nullDocument variant: Add, Corr, Rev, Sup, or null
part_numberinteger or nullPart index for multi-part documents (zero-based), or null
datestring or nullDocument date extracted from PDF heading (e.g. "14 July 2004"); null if not found
header_codesstringOfficial WTO document codes from the heading (e.g. "WT/DS267/1")
agreement_indicatorsstringAgreement/article references found in the heading area
page_countintegerNumber of pages in the source PDF
clean_textstringFull document text cleaned for embedding (headers, boilerplate, and footnotes removed)
processing_datestringISO 8601 timestamp of when this record was processed

Document Types

The 42 consolidated document types, with record counts:

Document TypeCountDescription
Communication1,831Official communications between parties or from the Secretariat
Request_To_Join_Consultations1,036Third-party requests to join ongoing consultations
Status_Report991Implementation status reports submitted by respondents
Addendum958Addenda to previously circulated documents
Report_Of_Panel816Panel reports (full text or interim)
Request_For_Consultations699Initial consultation requests filed by complainants
Request_For_Establishment_Of_Panel541Formal panel establishment requests
Note_By_Secretariat538Informational notes issued by the WTO Secretariat
Report_Of_Appellate_Body327Appellate Body reports
Agreement_Art_21_3158Article 21.3 DSU reasonable period of time determinations
Notification_Of_Appeal158Formal notifications of appeal to the Appellate Body
Working_Procedures152Panel or Appellate Body working procedures
Appellate_Body_Report_And_Panel_Report146Combined circulation of AB + Panel reports
Recourse141Recourse proceedings (Arts. 21.5, 22.2, 22.6, 22.7)
Understanding133Bilateral understandings and agreed solutions
Notification_Of_Mutually_Agreed_Solution122Formal notifications of mutually agreed solutions
Executive_Summary101Executive summaries of panel or AB reports
Submission88Party submissions (oral statements, first/second written submissions)
Request_For_Arbitration87Arbitration requests under DSU Articles 21.3, 22.6, or 25
Arbitration_Award65Awards or decisions by arbitrators
(22 additional types)~528Panel compositions, procedural rulings, cross-references, etc.

Dispute Stages

The dispute_stage field reflects the furthest procedural stage reached by each case:

StageRecordsDescription
Appellate Body3,211Case reached the Appellate Body
Panel2,449Panel established and reported; no appeal
Mutually Agreed Solution1,597Parties settled before or during panel proceedings
Implementation & Compliance1,121Post-ruling compliance proceedings (Art. 21.5)
Consultation862Consultations requested; case did not proceed to panel
Retaliation & Arbitration163Authorization to suspend concessions (Art. 22)

Text Cleaning

The clean_text field has been processed through a 10-step pipeline optimized for embedding quality:

  1. 1.Header-area boilerplate removal (WTO cover page patterns)
  2. 2.Document codes stripped (WT/DS..., G/...)
  3. 3.Language markers removed (anglais/English/français)
  4. 4.Page numbers removed
  5. 5.Footnotes removed (underscore separators + numbered continuations)
  6. 6.Non-English lines removed (French/Spanish detected via function-word threshold)
  7. 7.Repeated case titles deduplicated
  8. 8.Punctuation noise cleaned
  9. 9.Whitespace normalized

OCR (Tesseract) was applied as a fallback for 78 scanned PDFs where PyPDF extraction yielded fewer than 50 characters.

Usage Example

With the HuggingFace datasets library (recommended)

python
from datasets import load_dataset

# Load full dataset
ds = load_dataset("dean22029/WTO_Docs")
df = ds["train"].to_pandas()

# Filter to a single case
ds267 = ds["train"].filter(lambda x: x["case_number"] == "267")

# Filter by document type
consultations = ds["train"].filter(
    lambda x: x["doc_type"] == "Request_For_Consultations"
)

# Filter by dispute stage
appellate = ds["train"].filter(
    lambda x: x["dispute_stage"] == "Appellate Body"
)

# Access a record
print(ds["train"][0]["case_number"])   # "1"
print(ds["train"][0]["doc_type"])      # "Request_For_Consultations"
print(ds["train"][0]["clean_text"][:300])

With plain Python (no dependencies)

python
import json

with open("wto_documents_full.jsonl") as f:
    for line in f:
        doc = json.loads(line)
        print(doc["case_number"], doc["doc_type"], doc["date"])
        print(doc["clean_text"][:300])
        break

Load all documents for a specific case:

python
import json

def get_case_docs(jsonl_path, case_number, doc_type=None):
    docs = []
    with open(jsonl_path) as f:
        for line in f:
            doc = json.loads(line)
            if doc["case_number"] == str(case_number):
                if doc_type is None or doc["doc_type"] == doc_type:
                    docs.append(doc)
    return docs

# All documents for DS267 (EC - Beef Hormones)
all_docs = get_case_docs("wto_documents_full.jsonl", 267)

# Consultation requests only
consultations = get_case_docs("wto_documents_full.jsonl", 267, "Request_For_Consultations")

Parse the `third_parties` field:

python
import ast

doc = json.loads(line)
third_parties = ast.literal_eval(doc["third_parties"])  # e.g. ["USA", "Canada"]

Data Source and Processing

Documents were scraped from the WTO Dispute Settlement Gateway using Selenium. PDFs were parsed with PyPDFLoader (text-based) and Tesseract OCR (scanned). Dates were extracted multilingually (English, French, Spanish) from PDF headings.

Case metadata (complainant, respondent, third parties, dispute stage, agreements cited, case summary) was scraped separately from WTO case pages and joined by case number.

Known Limitations

  • third_parties field stores Python list repr strings (e.g. "['USA', 'EU']"); parse with ast.literal_eval().
  • date is null for ~4.5% of records (mostly untitled addenda and cross-reference files).
  • Non-English documents (primarily French/Spanish originals) have reduced clean_text quality after line-level language filtering.
  • Taiwan (Chinese Taipei) has no UN ideal point data in linked panel datasets — expected, as it is not a UN member.
  • DS627+ cases exist in case metadata but have no associated PDFs in this corpus (collection cutoff: DS626).