Skip to content

declare-lab/SANCL

Repository files navigation

Review Helpfulness Prediction

Our code is developed based on the open-source project MatchZoo.

Requirements

We use python version 3.7 and the main dependent libs are listed in requirements.txt

conda create -f environment.yml

while some other requirements need to be installed handly

ICU Tokenizer

# conda install icu libarary
conda install icu pkg-config

# Or if you wish to use the latest version of the ICU library,
# the conda-forge channel typically contains a more up to date version.
conda install -c conda-forge icu

# mac os
CFLAGS="-std=c++11" PATH="/usr/local/opt/icu4c/bin:$PATH" \
    pip install ICU-Tokenizer

# ubuntu
CFLAGS="-std=c++11" pip install ICU-Tokenizer

Emoji Translation

git clone [email protected]:jhliu17/emoji.git
cd emoji
python setup.py install

Data Processing

You can download the data from this Google Drive storage. To process text and image data, please read the details here.

Run Code

Training, the experiment config settings are listed in config folder.

# Single gpu or dataparallel 
# [ckpt] is optional for continual training
sh scripts/train.sh device_ids config_file [ckpt]

# Or distributed training
sh scripts/train_dist.sh device_ids n_procs config_file [ckpt]

Evaluation

sh scripts/eval.sh device_ids config_file ckpt

Ref Code

About

[COLING 2022] This repository contains the code of the paper SANCL: Multimodal Review Helpfulness Prediction with Selective Attention and Natural Contrastive Learning.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors