File size: 4,121 Bytes
ceb5489 42f26ba ceb5489 7bef321 ceb5489 7bef321 ceb5489 7bef321 ceb5489 959ec83 ceb5489 959ec83 ceb5489 959ec83 ceb5489 959ec83 afd7fe5 ceb5489 959ec83 afd7fe5 ceb5489 959ec83 ceb5489 959ec83 ceb5489 959ec83 ceb5489 959ec83 ceb5489 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | ---
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.
|