junchenfu's picture
Link artifact to DIGER paper page
42f26ba verified
|
raw
history blame contribute delete
4.12 kB
---
tags:
- recommendation
- generative-recommendation
- semantic-id
- diger
- rq-vae
- llama-embeddings
pretty_name: DIGER Processed Data and Embeddings
---
# DIGER Processed Data and Embeddings
This dataset repository contains the processed artifacts used by **DIGER: Differentiable Semantic IDs for Generative Recommendation**.
The files are provided to make reproduction easier, since small differences in preprocessing or embedding generation may lead to different semantic IDs and recommendation results.
## Paper
This artifact is associated with the DIGER paper page:
https://huggingface.co/papers/2601.19711
## Contents
The repository contains processed files for three separate datasets. These datasets are not mixed together; DIGER trains and evaluates them independently.
- `beauty/`
- `instruments/`
- `yelp/`
Each dataset directory contains:
- `*.train.jsonl`, `*.valid.jsonl`, `*.test.jsonl`: processed interaction splits used by DIGER.
- `*.emb_map.json`: mapping between processed item ids and embedding rows.
- `*.emb-llama.npy`: LLaMA-based item embeddings used for RQ-VAE checkpoint training and DIGER experiments.
- `*_stats.json` when available: summary statistics for the processed split.
## LLaMA Embeddings
The LLaMA embeddings follow the generation procedure described in:
https://github.com/honghuibao2000/letter
We include the processed embeddings here so that downstream users can reproduce the released DIGER artifacts without depending on small preprocessing or embedding-generation differences. Each dataset uses its own embedding matrix and is trained independently.
## Models
The corresponding released RQ-VAE checkpoints are trained separately for each dataset and are available at:
- Beauty: https://huggingface.co/junchenfu/diger-rqvae-beauty
- Instruments: https://huggingface.co/junchenfu/diger-rqvae-instruments
- Yelp: https://huggingface.co/junchenfu/diger-rqvae-yelp
## Source Dataset Note
The underlying recommendation datasets are public datasets from their original sources. This repository hosts the processed DIGER artifacts and embeddings for reproducibility; it is not intended to replace or relicense the original datasets.
Please consult the original dataset sources and their terms before using these files.
## Loading One Dataset
The three datasets are stored in separate directories. To use only one dataset, download only files from that directory. For example, this loads **Beauty** only and does not download Instruments or Yelp:
```python
from huggingface_hub import hf_hub_download
import json
import numpy as np
repo_id = "junchenfu/diger-processed-data"
dataset = "beauty" # choose from: "beauty", "instruments", "yelp"
embedding_files = {
"beauty": "Beauty.emb-llama.npy",
"instruments": "Instruments.emb-llama.npy",
"yelp": "Yelp.emb-llama.npy",
}
train_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.train.jsonl")
valid_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.valid.jsonl")
test_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.test.jsonl")
map_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.emb_map.json")
emb_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{embedding_files[dataset]}")
with open(train_path, encoding="utf-8") as f:
first_train = json.loads(next(f))
with open(map_path, encoding="utf-8") as f:
emb_map = json.load(f)
emb = np.load(emb_path, mmap_mode="r")
print(first_train)
print(len(emb_map))
print(emb.shape, emb.dtype)
```
For the other datasets, use the corresponding directory and embedding filename:
- Instruments: `instruments/Instruments.emb-llama.npy`
- Yelp: `yelp/Yelp.emb-llama.npy`
Use `hf_hub_download(filename="...")` for single-dataset loading. Avoid `snapshot_download` unless you intentionally want to download the full repository.
## Citation
If you use these processed artifacts, please cite the DIGER paper and the original dataset sources.