Giter VIP home page Giter VIP logo

grafrank's Introduction

Graph Neural Networks for Friend Ranking in Large-scale Social Platforms

Aravind Sankar, Yozen Liu, Jun Yu, and Neil Shah, "Graph Neural Networks for Friend Ranking in Large-scale Social Platforms", The Web Conference 2021, WWW 2021, April 19โ€“23, 2021, Ljubljana, Slovenia.

This repository contains a PyTorch implementation of GraFrank - a graph neural network architecture for multi-faceted friend ranking with multi-modal node features and pairwise link features in social networks. GraFrank uses two modules: modality-specific neighbor aggregation and cross-modality attention to inductively compute user representations in a dynamic friendship graph.

Since we are unable to publicly share the Snapchat datasets and industry-scale implementation of GraFrank (privacy reasons), we implement the core modules of GraFank using a popular geometric deep learning libray PyTorch Geometric.

GraFrank

Requirements

The code has been tested running under Python 3.6 using PyTorch 1.8.1 and PyTorch Geometric 1.7.0 (along with their dependencies).

To guarantee that you have the right package versions, you can use Anaconda to set up a virtual environment and following the instructions here.

Input Format

This repository uses a sample dataset based on the Cora citation network. To ensure compatibility with link features, we use dummy features in the code. Note that Cora is not meant to reproduce our experimental results.

In order to use your own data, you should use the data format of PyTorch Geometric and may need to update the data loader if the graph is dynamic. The code assumes that the node features are first partitioned and then concatenated across the K modalities. The relevant feature dimensions for the modality partitions are provided during model initialization.

Repository Organization

  • models/ contains:

    • GraFRank model (GraFRank.py);
    • GraphSAGE model (SAGE.py);
    • modality-specific aggregators and cross-modality attention modules in GraFrank (layers.py)
  • utils/ contains:

    • mini-batch loader for sampling positive and negative examples for model training (sampler.py);

Running the Model

To train and evaluate the model, please run

python train.py

Reference

If you make use of this code or the GraFrank algorithm in your work, please cite the following paper:

@inproceedings{sankar2021graph,
  title     = {Graph Neural Networks for Friend Ranking in Large-scale Social Platforms},
  author={Sankar, Aravind and Liu, Yozen and Yu, Jun and Shah, Neil},
  doi       = {10.1145/3442381.3450120},
  booktitle = {Proceedings of The Web Conference 2021},
  year = {2021}
}

grafrank's People

Contributors

aravindsankar28 avatar

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.