CoolFace
Apppublic

Prbhvv/mllm-recommender-api

sourceHugging Facemitupdated 10mo agoView on Hugging Face
0likes
setup_data.sh44 linesDownload Raw Back to root
1#!/bin/bash2 3# Create necessary directories4mkdir -p data/amazon/raw5mkdir -p data/amazon/processed6mkdir -p data/amazon/processed/images7mkdir -p datasets/Video_Games8 9# Download the Amazon Video Games dataset (5-core)10echo "Downloading Amazon Video Games dataset..."11wget -c http://snap.stanford.edu/data/amazon/productGraph/categoryFiles/reviews_Video_Games_5.json.gz -P data/amazon/raw/12wget -c http://snap.stanford.edu/data/amazon/productGraph/categoryFiles/meta_Video_Games.json.gz -P data/amazon/raw/13 14# Extract the metadata15echo "Extracting metadata..."16gunzip -c data/amazon/raw/meta_Video_Games.json.gz > data/amazon/raw/meta_Video_Games.json17 18# Create a simple item map (ASIN to index mapping)19echo "Creating item map..."20python3 -c "21import json22import gzip23 24# Create ASIN to index mapping25asin_to_idx = {}26with gzip.open('data/amazon/raw/meta_Video_Games.json.gz', 'rb') as f:27    for i, line in enumerate(f):28        data = json.loads(line)29        asin = data.get('asin')30        if asin:31            asin_to_idx[asin] = i32 33# Save the mapping34with open('data/amazon/processed/Video_Games_i_map.tsv', 'w') as f:35    for asin, idx in asin_to_idx.items():36        f.write(f'{asin}\t{idx}\n')37"38 39echo "Setup complete!"40echo "Next steps:"41echo "1. Run 'python prepare_metadata.py' to process the metadata"42echo "2. Download product images and save them to 'data/amazon/processed/images/ASIN.jpg'"43echo "3. Run 'python generate_embeddings.py' to generate the embeddings"44