Code Monkey home page Code Monkey logo

hgraph-cl's Introduction

Introduction

Code for COLING 2022 paper: Modeling Intra- and Inter-Modal Relations: Hierarchical Graph Contrastive Learning for Multimodal Sentiment Analysis

model

Dependencies

  • PyTorch
  • transformers

Getting Start

First, clone this repo via:

git clone https://github.com/lzjjeff/HGraph-CL.git
cd TCSP

Next, creating some necessary folds via:

mkdir data save
cd save && mkdir mosi mosei 
cd ..

Data

We evaluate our model on two benchmarks MOSI and MOSEI.

The data for experiment are placed in ./data/, you can download the processed MOSI and MOSEI datasets from:

Dataset Link
MOSI GoogleDrive
MOSEI GoogleDrive

and place them to ./data/.

For more specific introduction about the two datasets, please refer to CMU-MultimodalSDK.

Train & Test

Take MOSEI as an example, you can train and test the two model at once via:

export DATASET=mosei

python run.py \
    --dataset ${DATASET} \
    --batch_size 24 \
    --max_len 128 \
    --embed_type bert_word \
    --seeds 42 \
    --do_train \
    --do_predict \
    --save_path ./save/${DATASET}/ \
    --device_ids 0 \
    --epoch 6 \
    --lr_bert 1e-5 \
    --lr_other 1e-3 \
    --weight_decay_bert 1e-5 \
    --weight_decay_other 1e-3 \
    --hidden_size 128 \
    --num_lstm_layers 1 \
    --num_gnn_layers 1 \
    --num_gnn_heads 1 \
    --dropout 0.1 \
    --dropout_gnn 0.1 \
    --aug_ratio 0.2 \
    --used_mode lva \
    --sup_cl_weight 0.1 \
    --self_cl_weight 0.1

Citation

@inproceedings{lin-etal-2022-modeling,
    title = "Modeling Intra- and Inter-Modal Relations: Hierarchical Graph Contrastive Learning for Multimodal Sentiment Analysis",
    author = "Lin, Zijie  and
      Liang, Bin  and
      Long, Yunfei  and
      Dang, Yixue  and
      Yang, Min  and
      Zhang, Min  and
      Xu, Ruifeng",
    booktitle = "Proceedings of the 29th International Conference on Computational Linguistics",
    month = oct,
    year = "2022",
    address = "Gyeongju, Republic of Korea",
    publisher = "International Committee on Computational Linguistics",
    url = "https://aclanthology.org/2022.coling-1.622",
    pages = "7124--7135",
}

hgraph-cl's People

Contributors

lzjjeff avatar

Stargazers

Chengyao Xie 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.