Giter VIP home page Giter VIP logo

botmoe's Introduction

BotMoE Reposiotry

This is the official repo for BotMoE: Twitter Bot Detection with Community-Aware Mixtures of Modal-Specific Experts @ SIGIR 2023.

Step 0 Create Environment

    pip install -r requirements.txt

Step 1 Train

Remember to change the parameters in main.py

    #the name of your experiment
    exp_name="load&fix"

    #the idx of the model in the list
    idx=0

    #models
    model=[AllInOne1_rgcn_rgt_gcn]

    #your log file to record your training
    file =['AllInOne1_rgcn_rgt_gcn.log']

    #set logger
    logger=set_logger(file[idx],exp_name)

    #path to save your model
    save_root='/data3/whr/lyh/MoE/mixture-of-experts/twibot-20/model/'
    save_pth=save_root+file[idx].rstrip('.log')+'/'
    if(not os.path.exists(save_pth)):
        os.mkdir(save_pth)

    logger.info(exp_name)
    
    #the path of preprocessed features
    root='MoE/mixture-of-experts/BotRGCN/twibot_20/processed_data/'

    #hyper parameters of the model
    align_size_set=[128]
    hidden_size_set=[4]
    hidden_size=4
    device="cuda:2"
    dataset=Twibot22(root=root,device=device)
    test_run=range(20)
    num_text=2
    gnn_k=1
    num_gnn=3

Then you can start training!

    python main.py

Step 2 Test your model

Change the path to your trained model

    trainer.model = torch.load([path/to/your/model])

Then run

    python test.py

botmoe's People

Contributors

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