hwaaaaanii commited on
Commit
45d0ca5
·
verified ·
1 Parent(s): 800076a

Add one-call download to usage

Browse files
Files changed (1) hide show
  1. README.md +23 -11
README.md CHANGED
@@ -80,26 +80,38 @@ A system has to
80
  |---|---|---|
81
  | `queries` (default) | 1,680 | Benchmark questions with gold answers and evaluation labels |
82
  | `product`, `order`, `inquiry`, `review`, `script` | 200 / 6,378 / 18,749 / 24,104 / 287 | SQL tables of the retail database |
83
- | `reviews_text`, `inquiries_text`, `sales_scripts` | 24,104 / 18,749 / 287 | Free-text stores: review text, buyer–seller inquiry dialogues, live-commerce sales scripts, each with metadata |
84
 
85
- The `database/raw/` folder holds the same database as the files the RetailRAG framework
86
- reads directly (`*.sqlite` and `*.jsonl`).
 
 
 
 
 
87
 
88
  ```python
89
- from datasets import load_dataset
90
 
91
- queries = load_dataset("DISLab/RetailBridge", "queries", split="test")
92
- orders = load_dataset("DISLab/RetailBridge", "order", split="train")
93
- reviews = load_dataset("DISLab/RetailBridge", "reviews_text", split="train")
 
94
  ```
95
 
96
- To run RetailRAG or another agent against the database, download the raw files:
 
 
 
97
 
98
  ```python
99
- from huggingface_hub import snapshot_download
100
 
101
- path = snapshot_download("DISLab/RetailBridge", repo_type="dataset",
102
- allow_patterns=["database/raw/*", "queries/*"])
 
 
 
103
  ```
104
 
105
  ## Benchmark questions
 
80
  |---|---|---|
81
  | `queries` (default) | 1,680 | Benchmark questions with gold answers and evaluation labels |
82
  | `product`, `order`, `inquiry`, `review`, `script` | 200 / 6,378 / 18,749 / 24,104 / 287 | SQL tables of the retail database |
83
+ | `reviews_text`, `inquiries_text`, `sales_scripts` | 24,104 / 18,749 / 287 | Free-text stores (review text, buyer–seller inquiry dialogues, live-commerce sales scripts), each with metadata |
84
 
85
+ ## Usage
86
+
87
+ ### Download the whole benchmark
88
+
89
+ One call downloads the questions and the full heterogeneous database. The `database/raw/`
90
+ folder holds the five SQL tables as `*.sqlite` files and the three text stores as
91
+ `*.jsonl` files, which is the form the RetailRAG framework reads directly.
92
 
93
  ```python
94
+ from huggingface_hub import snapshot_download
95
 
96
+ path = snapshot_download("DISLab/RetailBridge", repo_type="dataset")
97
+ # path/queries/test.jsonl 1,680 questions
98
+ # path/database/raw/*.sqlite 5 SQL tables
99
+ # path/database/raw/*.jsonl 3 text stores
100
  ```
101
 
102
+ ### Load with `datasets`
103
+
104
+ Each source is a separate config because the tables have different columns.
105
+ The loop below loads the questions and every source at once.
106
 
107
  ```python
108
+ from datasets import load_dataset
109
 
110
+ REPO = "DISLab/RetailBridge"
111
+ queries = load_dataset(REPO, "queries", split="test")
112
+ db = {name: load_dataset(REPO, name, split="train")
113
+ for name in ["product", "order", "inquiry", "review", "script",
114
+ "reviews_text", "inquiries_text", "sales_scripts"]}
115
  ```
116
 
117
  ## Benchmark questions