Update README.md
Browse files
README.md
CHANGED
|
@@ -94,4 +94,70 @@ size_categories:
|
|
| 94 |
* query_class - category to which the query falls under
|
| 95 |
* Annotated (product,relevance judgement) pairs, columns:
|
| 96 |
* id - Unique ID for each annotation
|
| 97 |
-
* label - Relevance label, one of 'Exact', 'Partial', or 'Irrelevant'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 94 |
* query_class - category to which the query falls under
|
| 95 |
* Annotated (product,relevance judgement) pairs, columns:
|
| 96 |
* id - Unique ID for each annotation
|
| 97 |
+
* label - Relevance label, one of 'Exact', 'Partial', or 'Irrelevant'
|
| 98 |
+
|
| 99 |
+
# Citation
|
| 100 |
+
|
| 101 |
+
Please cite this paper if you are building on top of or using this dataset:
|
| 102 |
+
|
| 103 |
+
```text
|
| 104 |
+
@InProceedings{wands,
|
| 105 |
+
title = {WANDS: Dataset for Product Search Relevance Assessment},
|
| 106 |
+
author = {Chen, Yan and Liu, Shujian and Liu, Zheng and Sun, Weiyi and Baltrunas, Linas and Schroeder, Benjamin},
|
| 107 |
+
booktitle = {Proceedings of the 44th European Conference on Information Retrieval},
|
| 108 |
+
year = {2022},
|
| 109 |
+
numpages = {12}
|
| 110 |
+
}
|
| 111 |
+
```
|
| 112 |
+
|
| 113 |
+
|
| 114 |
+
# Code for generating dataset
|
| 115 |
+
|
| 116 |
+
|
| 117 |
+
```python
|
| 118 |
+
import pandas as pd
|
| 119 |
+
from datasets import Dataset
|
| 120 |
+
from datasets import DatasetDict, Dataset
|
| 121 |
+
from datasets import ClassLabel, load_from_disk, load_dataset, concatenate_datasets
|
| 122 |
+
from pathlib import Path
|
| 123 |
+
|
| 124 |
+
base_path = "https://github.com/wayfair/WANDS/raw/main/dataset/"
|
| 125 |
+
|
| 126 |
+
query_df = pd.read_csv(f"{base_path}/query.csv", sep='\t')
|
| 127 |
+
product_df = pd.read_csv(f"{base_path}/product.csv", sep='\t')
|
| 128 |
+
label_df = pd.read_csv(f"{base_path}/label.csv", sep='\t')
|
| 129 |
+
|
| 130 |
+
df_dataset = label_df.merge(
|
| 131 |
+
query_df, on="query_id"
|
| 132 |
+
).merge(
|
| 133 |
+
product_df, on="product_id"
|
| 134 |
+
)
|
| 135 |
+
|
| 136 |
+
wands_class_label_feature = ClassLabel(num_classes=3, names=["Irrelevant", "Partial", "Exact"])
|
| 137 |
+
dataset = dataset.train_test_split(test_size=2/5, seed=1337)
|
| 138 |
+
dev_test_dataset = dataset["test"].train_test_split(test_size=1/2, seed=1337)
|
| 139 |
+
dataset = DatasetDict(
|
| 140 |
+
train=dataset["train"],
|
| 141 |
+
dev=dev_test_dataset["train"],
|
| 142 |
+
test=dev_test_dataset["test"],
|
| 143 |
+
)
|
| 144 |
+
"""
|
| 145 |
+
DatasetDict({
|
| 146 |
+
train: Dataset({
|
| 147 |
+
features: ['id', 'query_id', 'product_id', 'label', 'query', 'query_class', 'product_name', 'product_class', 'category hierarchy', 'product_description', 'product_features', 'rating_count', 'average_rating', 'review_count'],
|
| 148 |
+
num_rows: 140068
|
| 149 |
+
})
|
| 150 |
+
dev: Dataset({
|
| 151 |
+
features: ['id', 'query_id', 'product_id', 'label', 'query', 'query_class', 'product_name', 'product_class', 'category hierarchy', 'product_description', 'product_features', 'rating_count', 'average_rating', 'review_count'],
|
| 152 |
+
num_rows: 46690
|
| 153 |
+
})
|
| 154 |
+
test: Dataset({
|
| 155 |
+
features: ['id', 'query_id', 'product_id', 'label', 'query', 'query_class', 'product_name', 'product_class', 'category hierarchy', 'product_description', 'product_features', 'rating_count', 'average_rating', 'review_count'],
|
| 156 |
+
num_rows: 46690
|
| 157 |
+
})
|
| 158 |
+
})
|
| 159 |
+
"""
|
| 160 |
+
|
| 161 |
+
dataset.push_to_hub("napsternxg/wands")
|
| 162 |
+
|
| 163 |
+
```
|