Giter VIP home page Giter VIP logo

nhp_oam's Introduction

NHP_OAM

The implementation of the paper: "To Search or to Recommend: Predicting Open-App Motivation with the Deep Hawkes Process"

Incorporating Search and Recommendation (S&R) services within a singular application is prevalent in online platforms, leading to a new task termed open-app motivation prediction, which aims to predict whether users initiate the application with the specific intent of information searching, or to explore recommended content for entertainment. Studies have shown that predicting users' motivation to open an app can help to improve user engagement and enhance performance in various downstream tasks. However, accurately predicting open-app motivation is not trivial, as it is influenced by user-specific factors, search queries, clicked items, as well as their temporal occurrences. Furthermore, these activities occur sequentially and exhibit intricate temporal dependencies. Inspired by the success of the Neural Hawkes Process (NHP) in modeling temporal dependencies in sequences, this paper proposes a novel neural Hawkes process model to capture the temporal dependencies between historical user browsing and querying actions. The model, referred to as Neural Hawkes Process-based Open-App Motivation prediction model (NHP-OAM), employs a hierarchical transformer and a novel intensity function to encode multiple factors, and open-app motivation prediction layer to integrate time and user-specific information for predicting users' open-app motivations. To demonstrate the superiority of our NHP-OAM model and construct a benchmark for the Open-App Motivation Prediction task, we not only extend the public S&R dataset ZhihuRec but also construct a new real-world Open-App Motivation Dataset (OAMD). Experiments on these two datasets validate NHP-OAM's superiority over baseline models. Further downstream application experiments demonstrate NHP-OAM's effectiveness in predicting users' Open-App Motivation, highlighting the immense application value of NHP-OAM.

Examples of Open-App Motivation.

The overall architecture of the proposed model NHP-OAM.

Dataset

Unzip the below datasets and put them in the corresponding folder.

The OAMD can be downloaded from OAMD.

The extended ZhihuRec can be downloaded from ZhihuRec.

Trainining and Evaluation

python ./NHP_OAM_OAMD/main_NHP_OAM.py
python ./NHP_OAM_ZhihuRec/main_NHP_OAM.py

The parameters used in the above code are shown in their own files as default parameters.

Impact of 𝛼

Performance Analysis by 𝛼 Values on OAMD.

Since the loss function is composed of two parts with different magnitudes of loss, we use 𝛼 to control the impact of the two parts of loss on parameter learning. To investigate the impacts of the hyper-parameter, we conducted experiments with varying 𝛼. From the results in the above figure, we found that the performance peaks when 𝛼 is 1×10^{-3}. With a further increase in hyperparameters, the performances become worse. We attribute this to the fact that the log-likelihood loss has larger values compared to the cross-entropy loss. Using 𝛼 of 1×10^{-3} allows us to control the optimization ratio of both. However, it also can't be too small, otherwise, it will result in a decline in optimization effectiveness.

Check training and evaluation process

Requirements

torch>=1.9.1+cu111
transformers>=4.18.0
numpy>=1.20.1
jieba>=0.42.1
six>=1.15.0
rouge>=1.0.1
tqdm>=4.59.0
scikit-learn>=0.24.1
pandas>=1.2.4
matplotlib>=3.3.4
termcolor>=1.1.0
networkx>=2.5
requests>=2.25.1
filelock>=3.0.12
gensim>=3.8.3
scipy>=1.6.2
seaborn>=0.11.1
boto3>=1.26.18
botocore>=1.29.18
pip>=22.0.3
packaging>=20.9
Pillow>=8.2.0
ipython>=7.22.0
regex>=2021.4.4
tokenizers>=0.12.1
PyYAML>=5.4.1
sacremoses>=0.0.53
psutil>=5.8.0
h5py>=2.10.0
msgpack>=1.0.2
setproctitle==1.3.2

nhp_oam's People

Contributors

jeryi-sun avatar

Stargazers

 avatar zhao avatar  avatar Zihua Si avatar  avatar

Watchers

 avatar

nhp_oam's Issues

内存占用问题!

hello!

恭喜你有意义的工作受到sigir24的认可!

我也拜读过您的文章之后动手复现了一下您所提供的代码。代码非常简洁规范,数据集整理的也非常棒你的优秀工作使得我学习非常顺畅。

但是在我复现的过程中发现以下小问题:运行内存占用特别大。当我在本地32G运行内存运行时内存会爆掉。看代码发现好像是您直接把一个数据集的数据全部读出。最后我在服务器运行发现模型占用内存高达80G但是其他资源占用并不高。

因为我能力有限,不能对代码改进,还请作者能否对模型占用内存优化,或者是能否更改参数减少内存占用。

感谢!

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.