Paper
This paper is still a working draft and is not yet peer-reviewed. You can view the original PDF here.
summary
Lextract is a Python pipeline that automatically extracts relevant market definitions from the European Commission's merger and antitrust decision PDFs. Relevant market definitions establish the scope of competition legislation and identify the specific set of products in an area, which make them indispensable for economists, lawyers, and regulators when determining the effects of mergers and evaluating anticompetitive behavior. This pipeline has been designed for researchers and competition law experts who require a quick and accurate way to extract relevant market definitions from many cases at once. This level of accuracy is accomplished by using strict natural language processing and rule-based pattern recognition to identify market definitions while excluding all irrelevant information. By automating this process, Lextract enables merger and antitrust research at scale and contributes to more efficient competition policy analysis.
statement of need
Competition authorities routinely delineate relevant markets as a first step in merger and antitrust assessments. The definition of the relevant market establishes the market position of firms operating within it, making its establishment necessary for regulators and courts to control mergers and evaluate potential abuses of dominant positions. For instance, in the 2025 case United States v. Google LLC, the outcome of the decision was impacted by how the relevant market was defined and whether Google and its services were found to hold a dominant position within that market.
Furthermore, the Commission has published over 6,000 merger and antitrust decisions and continues to add 280 more annually, each structured and formatted idiosyncratically, with inconsistent placement of definitions and headings that vary in language. As a result, deterministic approaches such as regex are brittle and ineffective for extracting market definitions, while manual extraction is slow and irreproducible at scale.
state of the field
Despite its significance, only one commercial product addressing the need to quickly access relevant market definitions exists: LexisNexis's Caselex Market Definitions Module. Caselex differs fundamentally from Lextract across many aspects pertinent to academic research. While Caselex offers broad multilingual coverage and human editorial review, it is proprietary, immutable, and inaccessible to many academics. Lextract addresses these limitations directly: it is open source, outputs structured JSON, is fully reproducible, and can be adapted to process new decisions or retargeted to different LLM backends.
| Feature | Lextract | Caselex |
|---|---|---|
| Cost | Free | Paid subscription |
| Access | Open source | Proprietary |
| Updateable by user | Yes | No |
| Output format | Structured JSON | Web interface only |
| Programmatic access | Yes | No |
| Reproducible | Yes | No |
| Human editorial review | Yes, done by user | Yes |
Table I: Comparison of Lextract and the Caselex Market Definitions Module.
software design
The general workflow for extracting market definitions is split into three sections and five steps. First, a script processes an Excel file downloaded from the Commission's case search portal and extracts decision document links with corresponding metadata. Another script then scrapes the decision text, converts it into a text corpus, sorts it by length, and excludes decisions without market definitions.
The second section handles semantic extraction. Google Gemini identifies the section of each corpus containing market definitions, then isolates each individual market definition. Each definition is tagged with a topic and saved in structured JSON with the relevant metadata.
The final section cleans each JSON file to remove extraneous characters and aggregates the results into a single file for research and analysis. This structure improves consistency, reduces variability, and supports the project's tested extraction workflow.

evaluation
To assess the quality of Lextract's output, a pattern-based validity evaluation was conducted via a companion script included in the repository. Fifty market definitions were manually verified from source PDFs and compiled into a reference set, against whose structural and linguistic patterns every definition in the full output is scored.
The JurisMercatus database, containing 4,105 definitions extracted from over 600 EC decisions, was used to test the pipeline's efficacy. The pipeline achieved a validity rate of 76.6%, with the primary failure mode being the absence of a structural marker. Validity is broadly consistent across years, ranging from 68% to 86%, with a modest decline in 2024 that likely reflects a higher proportion of simplified procedure decisions.

research impact statement
Lextract powers the database of JurisMercatus, an open source search interface that allows users to semantically search for market definitions. JurisMercatus has been used by members of the antitrust community, including researchers, practitioners, and students, to locate and compare market definitions more efficiently than would be possible through manual review.
limitations
This system is not perfect and contains inaccuracies. Because headings used to identify market definition sections vary across decisions, what constitutes a market definition is heuristically defined, which can lead to inaccuracies when source texts deviate from expected patterns. The quality of extraction is also limited by the quality of the input. Missing pages or unconventional language may lead to partial, hallucinated, or inaccurate results.
Although decisions are adjudicated in many languages, the pipeline excludes decisions not provided in English in order to maintain accuracy. Lextract currently uses Google Gemini, but it is model-agnostic and could be refactored to use other hosted or local LLMs.
| Model Type | Accuracy | Context Length | Speed | Cost |
|---|---|---|---|---|
| Hosted L, eg. GPT-4o | High | Very High | Moderate | High |
| Hosted S, eg. Gemini Flash | Moderate | High | Fast | Moderate |
| Local L, eg. DeepSeek 67B | Moderate | Medium | Slow | Low |
| Local S, eg. LLaMA 3-8B | Low | Low | Moderate | Low |
Table II: Comparison of relative capabilities when extracting relevant market definitions.
AI usage disclosure
Lextract uses Google Gemini 2.0 Flash at runtime to identify market-definition sections and extract individual definitions from decision text. Generative AI tools were used to assist with development to the extent of code refactoring and manuscript proofreading. The author reviewed, edited, and validated all AI-assisted outputs.
acknowledgements
I am grateful to Professor Thibault Schrepel of Stanford Law School for his invaluable advisement and guidance throughout the course of this project. This research received no funding from any government agency, university, company, or non-profit organization.
conflict of interest
The author declares no conflict of interest.