# deepblueai/sigir_ecom_2021_data_challenge_1st_place architecture

> Architecture diagram of the GitHub repository deepblueai/sigir_ecom_2021_data_challenge_1st_place, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place
- Repository: https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place

## Overview

This repository contains two SIGIR e-commerce challenge solutions: in-session product recommendation and cart-purchase intent prediction. Their shared workflow is to prepare session data, generate task-specific predictions, and produce challenge submissions; recommendation additionally includes candidate recall and submission formatting that filters seen products. Cart prediction builds event-derived features and uses a LightGBM binary model. Evaluation provides challenge metrics for both tasks. The excerpts show data preparation and some prediction components, but not the full orchestration or all calls between them, so uncertain links are omitted.

Main entry points: [`code_rec/utils.py`](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/utils.py) (Submission formatting), [`code_cart/gen_data.py`](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/gen_data.py) (Cart data preparation), [`code_cart/cart_task.py`](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/cart_task.py) (Event features), [`code_cart/model.py`](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/model.py) (Intent classifier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_rec["Recommendation"]
  node_rec_data["Session preparation<br/>[gen_data.py]"]
  node_rec_recall["Candidate recall<br/>[multi_recall.py]"]
  node_rec_format["Submission formatting<br/>[utils.py]"]
end

subgraph group_cart["Cart intent"]
  node_cart_data["Cart data preparation<br/>[gen_data.py]"]
  node_cart_features["Event features<br/>[cart_task.py]"]
  node_cart_model["Intent classifier<br/>[model.py]"]
  node_cart_format["Submission formatting<br/>[utils.py]"]
end

subgraph group_shared["Submission and evaluation"]
  node_evaluation["Challenge metrics<br/>[evaluation.py]"]
  node_rec_upload["Recommendation uploader<br/>[uploader.py]"]
  node_cart_upload["Cart uploader<br/>[uploader.py]"]
end

node_challenger(("Challenge user"))
node_challenge_data["Challenge data"]
node_prediction_files["Prediction files"]
node_aws_bucket[("AWS submission bucket")]

node_challenge_data -->|"reads sessions"| node_rec_data
node_challenge_data -->|"reads sessions"| node_cart_data
node_rec_recall -->|"formats results"| node_rec_format
node_rec_format -->|"writes JSON"| node_prediction_files
node_cart_data -->|"prepares events"| node_cart_features
node_cart_features -->|"provides features"| node_cart_model
node_cart_model -->|"predicts intent"| node_cart_format
node_cart_format -->|"writes JSON"| node_prediction_files
node_challenger -->|"supplies predictions"| node_evaluation
node_prediction_files -->|"evaluates against labels"| node_evaluation
node_challenger -->|"submits recommendation"| node_rec_upload
node_challenger -->|"submits intent result"| node_cart_upload
node_rec_upload -->|"uploads file"| node_aws_bucket
node_cart_upload -->|"uploads file"| node_aws_bucket

click node_rec_data "https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/gen_data.py"
click node_rec_recall "https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/multi_recall.py"
click node_rec_format "https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/utils.py"
click node_cart_data "https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/gen_data.py"
click node_cart_features "https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/cart_task.py"
click node_cart_model "https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/model.py"
click node_cart_format "https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/utils.py"
click node_evaluation "https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/evaluation.py"
click node_rec_upload "https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/uploader.py"
click node_cart_upload "https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/uploader.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_rec_data,node_rec_recall,node_rec_format,node_challenger toneBlue
class node_cart_data,node_cart_features,node_cart_model,node_cart_format,node_aws_bucket toneAmber
class node_evaluation,node_rec_upload,node_cart_upload toneMint
class node_challenge_data,node_prediction_files toneIndigo
```

## Components

### Recommendation

- [Session preparation](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/gen_data.py): `code_rec/gen_data.py`
- [Candidate recall](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/multi_recall.py): `code_rec/multi_recall.py`
- [Submission formatting](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/utils.py): `code_rec/utils.py`

### Cart intent

- [Cart data preparation](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/gen_data.py): `code_cart/gen_data.py`
- [Event features](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/cart_task.py): `code_cart/cart_task.py`
- [Intent classifier](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/model.py): `code_cart/model.py`
- [Submission formatting](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/utils.py): `code_cart/utils.py`

### Submission and evaluation

- [Challenge metrics](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/evaluation.py): `code_rec/evaluation.py`
- [Recommendation uploader](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_rec/uploader.py): `code_rec/uploader.py`
- [Cart uploader](https://github.com/deepblueai/sigir_ecom_2021_data_challenge_1st_place/blob/master/code_cart/uploader.py): `code_cart/uploader.py`

### Other components

- **Challenge user**
- **Challenge data**
- **Prediction files**
- **AWS submission bucket**

## Connections

- Challenge data → Session preparation: reads sessions
- Challenge data → Cart data preparation: reads sessions
- Candidate recall → Submission formatting: formats results
- Submission formatting → Prediction files: writes JSON
- Cart data preparation → Event features: prepares events
- Event features → Intent classifier: provides features
- Intent classifier → Submission formatting: predicts intent
- Submission formatting → Prediction files: writes JSON
- Challenge user → Challenge metrics: supplies predictions
- Prediction files → Challenge metrics: evaluates against labels
- Challenge user → Recommendation uploader: submits recommendation
- Challenge user → Cart uploader: submits intent result
- Recommendation uploader → AWS submission bucket: uploads file
- Cart uploader → AWS submission bucket: uploads file
