Spaces:
Sleeping
Sleeping
File size: 417 Bytes
549c270 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
# src/data/loader.py
import json
from pathlib import Path
def load_dataset(dataset: str):
base_path = Path("data/processed") / dataset
with open(base_path / "seq.json", "r") as f:
user_seqs = json.load(f) # this keeps the full {user_id: [item_id, ...]} dict
with open(base_path / "candidate_items.json", "r") as f:
candidate_items = json.load(f)
return user_seqs, candidate_items |