Abstract
Price Per Unit (PPU) is a critical metric for e-commerce, allowing customers to compare value across different product sizes. However, calculating PPU requires the "total quantity" of a product, a data point often buried in unstructured text. This paper presents a novel deep-learning framework that reframes quantity extraction as a two-stage Question Answering (QA) task. By utilizing a character-level CNN with a unique "span-image" architecture, the authors achieve significant precision gains (up to 34% over rule-based systems) while maintaining the low latency required for real-time global e-commerce applications.
Introduction
In the world of e-commerce, PPU is the great equalizer. It helps a customer realize that a 24-ounce jar of peanut butter at $5.00 is a better deal than a 16-ounce jar at $4.00. The core challenge is the "Total Quantity" problem: sellers often provide quantity information in free-text fields like product titles and descriptions, making it difficult to extract programmatically.
The Challenge of Total Quantity Extraction
Traditional methods like Regular Expressions (regex) often fail because they lack semantic context; they cannot easily distinguish which number is the "total" and which is a sub-component. Standard Named Entity Recognition (NER) also struggles as it treats words as independent tags and fails to handle multiple related spans that must be multiplied or summed (e.g., "2 packs" of "100 ml").
Furthermore, e-commerce data is global, requiring models to handle different languages, units, and abbreviations without excessive complexity.
Methodology: Fact Extraction as Question Answering
The authors propose a two-stage architecture that treats the Unit of Measure (UoM) as a "question" and the quantity as the "answer."
1. UoM Classifier (The Question)
A character-level CNN first predicts the UoM type (Weight, Volume, or Count). This acts as the "question"—for example, "What is the total volume?"—which helps the model disambiguate numbers in the subsequent stage.
2. Quantity Extractor (The Answer)
This sub-network extracts the relevant spans from the text using two key innovations:
- Character-level Embeddings: By looking at characters instead of words, the model is robust to typos and abbreviations ("oz" vs "ounce") and works across different languages using a small, shared vocabulary.
- Span-Image Architecture: Instead of predicting start and end tags for each word, the model creates a 2D "span-image" grid where each point represents a potential text span. This allows the model to identify multiple non-overlapping spans simultaneously.
3. Post-Processing
Once spans (like "2" and "100ml") are extracted, simple deterministic rules multiply or sum them to reach the final total quantity.
Experimental Results
The study utilized Amazon’s internal catalog data across three major regions: the US, India (IN), and EU-5.
- Superior Precision: In the US store, the model outperformed rule-based systems by 34.4% in precision. Compared to a BERT-based fact extraction baseline, it showed a 10.6% precision lift.
- Efficiency: The model is significantly faster than BERT-based alternatives. On a 2-core CPU, it achieved 17% better latency. When processing short-text attributes, latency dropped to under 12ms, making it viable for real-time validation during product registration.
- Transfer Learning: Fine-tuning a model trained on US data for the Indian market provided a substantial boost compared to training from scratch, suggesting that the "language" of product quantities is largely universal.
Conclusion
By reframing fact extraction as a Question Answering task, the authors developed a system that is both highly precise and computationally efficient. The use of character-level CNNs and span-image grids allows for a robust, cross-lingual solution to the PPU puzzle. Future work will focus on improving OCR integration to extract quantities from product images and refining the handling of ambiguous "Count" attributes.
Reference: Arici, T., et al. (2022). Solving Price Per Unit Problem Around the World: Formulating Fact Extraction as Question Answering. Proceedings of ACM SIGKDD '21.
Summary updated