Git Product home page Git Product logo

llm-mob's Introduction

Large Language Models for Human Mobility Prediction (LLM-Mob)

Code for the paper Where Would I Go Next? Large Language Models as Human Mobility Predictors.

The code is provided for reproducing the main results presented in the paper. However, the results may not be 100 per cent same as presented in the paper, due to the randomness of LLMs and the frequent update of OpenAI's GPT models. That being said, we anticipate that the difference is minimal.

Data

The data is hosted in /data. As mentioned in our paper, we strictly follow the same data preprocessing steps in Context-aware multi-head self-attentional neural network model for next location prediction. All the data files are generated from the data preprocessing scripts available here.

Reproducing results on Geolife

1. Get an OpenAI account

If you already have an account and have set up API keys, skip this step. Otherwise, go to OpenAI API website and sign up. Once you have an account, create an API key here. You may also need to set up your payment here in order to use the API.

2. Run the scripts to start the prediction process.

Specify your OpenAI API Key in the beginning of the script llm-mob.py, change the parameters in the main function if necessary and start the prediction process by simply running the sripts

python llm-mob.py

The log file will be stored in /logs and prediction results will be stored in /output.

Results and evaluation

We provide the actual prediction results obtained in our experiments in /results. To calculate the evaluation metrics, check the IPython notebook metrics.ipynb and run the scripts therein.

Update on OpenAI API

OpenAI has recently released a new major version of their API, therefore the code in this repo has been updated accordingly. For more information regarding how the update affect the old code and how we should proceed, check out their v1.0.0 Migration Guide.

Citation

@misc{wang2023i,
      title={Where Would I Go Next? Large Language Models as Human Mobility Predictors}, 
      author={Xinglei Wang and Meng Fang and Zichao Zeng and Tao Cheng},
      year={2023},
      eprint={2308.15197},
      archivePrefix={arXiv},
      primaryClass={cs.AI}
}

llm-mob's People

Contributors

xlwang233 avatar mengf1 avatar

Stargazers

 avatar LongZhenren avatar Qingya avatar Yijie Gao avatar Senias avatar GR Yan avatar Kr li avatar Zipeng Dai avatar 郭玉洁(Yujie Guo) avatar  avatar  avatar  avatar  avatar Han avatar Zichao Zeng avatar zhangzijing avatar  avatar Ye Zhuohan avatar Zhaonan Wang avatar Zinat Tasnim avatar isaac avatar Hao Xue avatar Ao Wang avatar Sumin Han avatar Xcd avatar Max Ilyin avatar  avatar AmandaHe1998 avatar

Watchers

 avatar Kostas Georgiou avatar  avatar

llm-mob's Issues

语法错误 grammar bug

llm-mob.py
line337 "about where and when this user have been to recently."
should be has 像其他方法那样,这里忘了改

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.