Coder Social home page Coder Social logo

ii-research-yu / efficient-fedrec Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yjw1029/efficient-fedrec

0.0 0.0 0.0 1.37 MB

Efficient-FedRec: Efficient Federated Learning Framework for Privacy-Preserving News Recommendation

License: MIT License

Shell 2.36% Python 97.64%

efficient-fedrec's Introduction

Efficient-FedRec

Python implementation for our paper "Efficient-FedRec: Efficient Federated Learning Frameworkfor Privacy-Preserving News Recommendation" in EMNLP 2021.

Introduction

Directly applying federated learning on news recommendation models will lead to high computation and communication cost on user side. In this work, we propose Efficient-FedRec, in which we dicompose the news recommendation model into a large news model maintained on server and a light-weight user model computed on the user side. Experiments on two public dataset show the effectiveness of our method.

Environment

Requirments

numpy
torch==1.9.1
transformers==4.12.5
tqdm
sklearn
wandb

Getting Started

  • Download datasets
cd raw
chmod +x download.sh
./download.sh mind .
./download.sh adressa .
  • Preprocess datasets
cd preprocess
# modify adressa to mind format
python adressa_raw.py

# preprocess mind dataset
python news_process.py --data mind
python user_process.py --data mind

# preprocess adressa dataset
python news_process.py --data adressa
python user_process.py --data adressa
  • Run experiments
# You may need to configure your wandb account first
cd src
python main.py --data mind
# get prediction result of the best checkpoint and submit on condalab
python main.py --data mind --mode predict

# train on adressa
python main.py --data adressa --max_train_steps 500 --validation_step 10 --bert_type NbAiLab/nb-bert-base
# test on adressa
python main.py --data adressa --mode test --bert_type NbAiLab/nb-bert-base

Results

MIND

Wandb result on MIND dataset Zip the prediction.txt file and upload to MIND competition. Test result is

Adressa

Wandb result on Adressa dataset. Test result is

test auc: 0.7980, mrr: 0.4637, ndcg5: 0.4852, ndcg10: 0.5497

Citing

If you want to cite Efficient-Fedrec in your papers (much appreciated!), you can cite it as follows:

@inproceedings{yi-etal-2021-efficient,
    title = "Efficient-{F}ed{R}ec: Efficient Federated Learning Framework for Privacy-Preserving News Recommendation",
    author = "Yi, Jingwei  and
      Wu, Fangzhao  and
      Wu, Chuhan  and
      Liu, Ruixuan  and
      Sun, Guangzhong  and
      Xie, Xing",
    booktitle = "EMNLP",
    year = "2021",
    pages = "2814--2824"
}

efficient-fedrec's People

Contributors

yjw1029 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.