--- license: cc-by-4.0 size_categories: - 1K RAGDOLL Collection Pipeline

This collection pipeline of the ***RAGDOLL*** dataset consists of the following two main steps: - Gather an initial list of products with GPT-4-Turbo or 4o. - LLMs are good at coming up with a list of products, but are not good at providing functional links. Hence, we use a combination of the Google Search API and GPT-3.5-Turbo to clean the data and verify/update the product URLs. As of the completion of our data collection, Google Cloud offers a $300 search API credit for each new user. When downloading webpages, it is highly recommended to download *dynamic* pages (i.e., after JavaScript execution), as the static raw HTML often misses lots of crucial information, such as price and availability. To download dynamic pages, use one of the following two methods: - Use the `selenium` package to invoke web browsers (faster, more up-to-date). - Download from CommonCraw (slower, more reproducible). The downloading method is controlled with [`cc_fetch`](https://huggingface.co/datasets/Bai-YT/RAGDOLL/blob/a19ce2a29f7317aefdbfae4e469f28d4cfa25d21/collection_pipeline/utils/query_utils.py#L39). ### Collecting Your Own Dataset You can use this data collection pipeline to collect additional websites or additional product categories. To do so, modify [`categories.md`](https://huggingface.co/datasets/Bai-YT/RAGDOLL/blob/main/README.md) accordingly and run the code with the following these instructions. Required packages: ``` click pandas torch requests bs4 lxml unidecode selenium openai cdx_toolkit ``` To query GPT-4-Turbo to collect a set of brands and products, run ``` python find_sites.py --model "gpt-4-turbo" # feel free to replace with gpt-4o or other OpenAI models without code modification ``` To clean the dataset (with Google Search API and GPT-3.5-Turbo), run ``` python clean_sites.py --max_workers ``` Website HTMLs, Google CSE search responses, and OpenAI LLM responses will be cached. ### Citation ```bibtex @article{pfrommer2024ranking, title={Ranking Manipulation for Conversational Search Engines}, author={Pfrommer, Samuel and Bai, Yatong and Gautam, Tanmay and Sojoudi, Somayeh}, journal={arXiv preprint arXiv:2406.03589}, year={2024} } ```