Introduction
Data scientists frequently report that data wrangling—the process of cleaning and transforming raw data—consumes up to 80% of their workflow. While Programming-by-Example (PBE) systems like Microsoft Excel’s Flash Fill have mitigated some of this burden, they still necessitate "explicit intent" through manual input-output examples. This paper introduces Predictive Program Synthesis, a novel approach that automates data extraction by identifying inherent structural patterns within raw data, thereby eliminating the need for user-provided examples.
Methodology
The proposed system utilizes a domain-agnostic synthesis algorithm that operates across three primary phases:
- Domain-Specific Languages (DSLs): The researchers developed two specialized DSLs: one for text based on delimiters and regular expressions, and another for web data utilizing CSS selectors and DOM hierarchy.
- Bottom-Up Synthesis: The engine performs a systematic search for "field-level" programs capable of extracting individual columns, constrained by a complexity bound to ensure efficiency.
- Ranking via Correspondence: This is the system's primary innovation. Rather than validating against user examples, the system ranks programs based on their global alignment. In the web domain, it seeks "interleaving" patterns (e.g., titles consistently followed by prices). In the text domain, it looks for "disjoint alignment," where delimiters partition strings into a clean tabular structure.
To maintain computational feasibility on large datasets, the authors implemented Lifting Functions. These functions use optimized indexing to find valid program parameters in linear time, preventing the exponential growth typical of combinatorial searches.
Results and Discussion
Text Extraction Performance
The system, implemented as ColumnSplit in Excel, was tested on 20 real-world benchmarks including log files and forum data. On average, the tool correctly identified 10.3 fields on the first click, with performance improving to 13.75 fields after minor user adjustments. The average execution time was a mere 4.2 seconds.
Web Extraction Performance
For web data, the WebExtract tool was evaluated on 20 complex pages where data was not formatted in standard HTML tables (e.g., Amazon search results). The system successfully identified an average of 5.85 fields per page. The "interleaving" logic allowed the system to group disparate DOM elements into coherent records automatically.
Efficiency Gains
The use of lifting functions proved critical for real-time application, providing a 50x speedup in the text domain. Most tasks were completed in under 2 seconds, whereas a naive synthesis approach took over 200 seconds for the same tasks, demonstrating that predictive synthesis can be both accurate and performant.
Conclusion
Predictive Program Synthesis represents a significant shift from "input-output" learning to "input-only" structural analysis. By leveraging global alignment as a signal for user intent, the system enables high-throughput, automated data schema discovery. Future work will focus on handling highly irregular data and generalizing record boundary discovery in flat text files.
Summary updated