license:apache-2.0 arxiv:2410.20643 arxiv:2404.17591 region:us
---
license: apache-2.0
---

# LLM4POI

## Dataset Summary

A preprocessed version of [LLM4POI](https://github.com/neolifer/LLM4POI), including the FourSquare-NYC, Gowalla-CA, and FourSquare-TKY datasets. Please refer to their repository for more details.

LLM4POI frames next POI prediction task into a question-answering problem that is fed as prompt into a large language model (LLM). The model is trained to generate the next POI given the current trajectory and the historical trajectory. This repository hosts both the Q&A version and the raw txt and csv versions of the datasets.

This dataset is used to train GenUP models as described in our paper [GenUP: Generative User Profilers as In-Context Learners for Next POI Recommender Systems](https://arxiv.org/abs/2410.20643).

### Dataset Sources

Repository: [neolifer/LLM4POI](https://github.com/neolifer/LLM4POI)

Paper: [Large Language Models for Next Point-of-Interest Recommendation](https://arxiv.org/abs/2404.17591)


Repository: [w11wo/GenUP](https://github.com/w11wo/GenUP)

Paper: [GenUP: Generative User Profilers as In-Context Learners for Next POI Recommender Systems](https://arxiv.org/abs/2410.20643)

## Dataset Structure

```shell
.
├── README.md
├── ca
│   └── preprocessed
│       ├── test_qa_pairs_kqt.txt
│       ├── train_qa_pairs_kqt.json
│       └── train_sample.csv
├── nyc
│   └── preprocessed
│       ├── test_qa_pairs_kqt.txt
│       ├── train_qa_pairs_kqt.json
│       └── train_sample.csv
└── tky
    └── preprocessed
        ├── test_qa_pairs_kqt.txt
        ├── train_qa_pairs_kqt.json
        └── train_sample.csv
```

### Data Instances

An example of a line in `test_qa_pairs_kqt.txt`:

```plaintext
<question>: The following data is a trajectory of user 2: At 2010-09-25 01:38:14, user 2 visited POI id 247 which is a Stadium and has Category id 261. At 2010-09-25 02:11:34, ... Given the data, At 2010-09-25 20:34:27, Which POI id will user 2 visit? Note that POI id is an integer in the range from 0 to 9690.<answer>: At 2010-09-25 20:34:27, user 2 will visit POI id 6350.
```

An example of a JSON object in `train_qa_pairs_kqt.json`:

```json
{
  "question": "The following data is a trajectory of user 2: At 2010-09-25 01:38:14, user 2 visited POI id 247 which is a Stadium and has Category id 261. At 2010-09-25 02:11:34, ... Given the data, At 2010-09-25 20:34:27, Which POI id will user 2 visit? Note that POI id is an integer in the range from 0 to 9690.",
  "answer": "At 2010-09-25 20:34:27, user 2 will visit POI id 6350."
}
```

An example of entries in `train_sample.csv`:

```csv
check_ins_id,UTCTimeOffset,UTCTimeOffsetEpoch,pseudo_session_trajectory_id,UserId,Latitude,Longitude,PoiId,PoiCategoryId,PoiCategoryName
126094.0,2010-06-06 18:48:32,1275814112,0,1,37.6163560649,-122.3861503601,445,207,Airport
126278.0,2010-06-06 22:11:04,1275826264,0,1,37.7826046833,-122.4076080167,244,1,Coffee Shop
126314.0,2010-06-06 22:40:29,1275828029,0,1,37.7831295924,-122.4038743973,9346,121,Conference
126622.0,2010-06-07 06:01:04,1275854464,0,1,37.7815086,-122.4050282333,3253,128,Pub
```

### Data Splits

|     | train | test |
| --- | ----: | ---: |
| NYC | 11022 | 1447 |
| CA  | 36374 | 2864 |
| TKY | 51661 | 7079 |

## Additional Information

### Citation

If you find this repository useful for your research, please consider citing our paper:

```bibtex
@misc{wongso2024genupgenerativeuserprofilers,
  title={GenUP: Generative User Profilers as In-Context Learners for Next POI Recommender Systems}, 
  author={Wilson Wongso and Hao Xue and Flora D. Salim},
  year={2024},
  eprint={2410.20643},
  archivePrefix={arXiv},
  primaryClass={cs.IR},
  url={https://arxiv.org/abs/2410.20643}, 
}
```

```bibtex
@inproceedings{Li_2024, series={SIGIR 2024},
  title={Large Language Models for Next Point-of-Interest Recommendation},
  url={http://dx.doi.org/10.1145/3626772.3657840},
  DOI={10.1145/3626772.3657840},
  booktitle={Proceedings of the 47th International ACM SIGIR Conference on Research and Development in Information Retrieval},
  publisher={ACM},
  author={Li, Peibo and de Rijke, Maarten and Xue, Hao and Ao, Shuang and Song, Yang and Salim, Flora D.},
  year={2024},
  month=jul, pages={1463–1472},
  collection={SIGIR 2024}
}
```

### Contact

If you have any questions or suggestions, feel free to contact Wilson at `w.wongso(at)unsw(dot)edu(dot)au`.