How sarandharshansp/amazon-ml-challenge-2024 works
This repository implements an image-based product-attribute extraction workflow for the Amazon ML Challenge. A test record’s image link and entity name guide image preparation, prompting, Qwen-VL inference, and post-processing into a prediction CSV. The README documents those stages, but the relevant notebooks were not sampled, so their internal wiring is shown only where documented. The graph also includes image-download and output-format validation utilities; it does not infer how the saved output chunks are merged.
Main entry points: code.ipynb Prepare image and prompt · utils.py Image downloader · test.csv Test records · constants.py Entity units
Components 14
Extraction workflow
- Image downloader
src/utils.py - Prepare image and prompt
src/code.ipynb - Batch inference
src/code.ipynb - Generated text
src/code.ipynb - Extract and normalize values
src/post_processing.ipynb - Prediction CSV
outputs
Inputs and model
- Test records
dataset/test.csv - Product images
- Image URL host
- Qwen2-VL-2B
Output formatting
- Entity units
src/constants.py - Format checker
src/sanity.py - Prediction parser
src/utils.py
Other components
- Challenge user
Connections 16
- Challenge user → Test records: provides records
- Test records → Prepare image and prompt: supplies test data
- Test records → Image downloader: provides image links
- Image downloader → Image URL host: fetches images
- Image downloader → Prepare image and prompt: provides downloaded images
- Entity units → Prepare image and prompt: defines entity units
- Prepare image and prompt → Batch inference: prepares inputs
- Batch inference → Qwen2-VL-2B: requests generation
- Qwen2-VL-2B → Generated text: generates text
- Generated text → Extract and normalize values: provides text
- Entity units → Extract and normalize values: guides unit normalization
- Extract and normalize values → Prediction CSV: writes predictions
- Challenge user → Format checker: requests validation
- Prediction CSV → Format checker: checks output
- Format checker → Prediction parser: parses predictions
- Prediction parser → Entity units: checks allowed units