Use dataset variable for embedding loading example
Browse files
README.md
CHANGED
|
@@ -62,13 +62,19 @@ import json
|
|
| 62 |
import numpy as np
|
| 63 |
|
| 64 |
repo_id = "junchenfu/diger-processed-data"
|
| 65 |
-
dataset = "beauty"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
|
| 67 |
train_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.train.jsonl")
|
| 68 |
valid_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.valid.jsonl")
|
| 69 |
test_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.test.jsonl")
|
| 70 |
map_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.emb_map.json")
|
| 71 |
-
emb_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename="
|
| 72 |
|
| 73 |
with open(train_path, encoding="utf-8") as f:
|
| 74 |
first_train = json.loads(next(f))
|
|
|
|
| 62 |
import numpy as np
|
| 63 |
|
| 64 |
repo_id = "junchenfu/diger-processed-data"
|
| 65 |
+
dataset = "beauty" # choose from: "beauty", "instruments", "yelp"
|
| 66 |
+
|
| 67 |
+
embedding_files = {
|
| 68 |
+
"beauty": "Beauty.emb-llama.npy",
|
| 69 |
+
"instruments": "Instruments.emb-llama.npy",
|
| 70 |
+
"yelp": "Yelp.emb-llama.npy",
|
| 71 |
+
}
|
| 72 |
|
| 73 |
train_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.train.jsonl")
|
| 74 |
valid_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.valid.jsonl")
|
| 75 |
test_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.test.jsonl")
|
| 76 |
map_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{dataset}.emb_map.json")
|
| 77 |
+
emb_path = hf_hub_download(repo_id=repo_id, repo_type="dataset", filename=f"{dataset}/{embedding_files[dataset]}")
|
| 78 |
|
| 79 |
with open(train_path, encoding="utf-8") as f:
|
| 80 |
first_train = json.loads(next(f))
|