Code for SentiBERT: A Transferable Transformer-Based Architecture for Compositional Sentiment Semantics (ACL'2020).

Overview

SentiBERT

Code for SentiBERT: A Transferable Transformer-Based Architecture for Compositional Sentiment Semantics (ACL'2020). https://arxiv.org/abs/2005.04114

Model Architecture

Requirements

Environment

* Python == 3.6.10
* Pytorch == 1.1.0
* CUDA == 9.0.176
* NVIDIA GeForce GTX 1080 Ti
* HuggingFaces Pytorch (also known as pytorch-pretrained-bert & transformers)
* Stanford CoreNLP (stanford-corenlp-full-2018-10-05)
* Numpy, Pickle, Tqdm, Scipy, etc. (See requirements.txt)

Datasets

Datasets include:

* SST-phrase
* SST-5 (almost the same with SST-phrase)
* SST-3 (almost the same with SST-phrase)
* SST-2
* Twitter Sentiment Analysis (SemEval 2017 Task 4)
* EmoContext (SemEval 2019 Task 3)
* EmoInt (Joy, Fear, Sad, Anger) (SemEval 2018 Task 1c)

Note that there are no individual datasets for SST-5. When evaluating SST-phrase, the results for SST-5 should also appear.

File Architecture (Selected important files)

-- /examples/run_classifier_new.py                                  ---> start to train
-- /examples/run_classifier_dataset_utils_new.py                    ---> input preprocessed files to SentiBERT
-- /pytorch-pretrained-bert/modeling_new.py                         ---> detailed model architecture
-- /examples/lm_finetuning/pregenerate_training_data_sstphrase.py   ---> generate pretrained epochs
-- /examples/lm_finetuning/finetune_on_pregenerated_sstphrase.py    ---> pretrain on generated epochs
-- /preprocessing/xxx_st.py                                         ---> preprocess raw text and constituency tree
-- /datasets                                                        ---> datasets
-- /transformers (under construction)                               ---> RoBERTa part

Get Started

Preparing Environment

conda create -n sentibert python=3.6.10
conda activate sentibert

conda install pytorch==1.1.0 torchvision==0.3.0 cudatoolkit=9.0 -c pytorch

cd SentiBERT/

wget http://nlp.stanford.edu/software/stanford-corenlp-full-2018-10-05.zip
unzip stanford-corenlp-full-2018-10-05.zip

export PYTHONPATH=$PYTHONPATH:XX/SentiBERT/pytorch_pretrained_bert
export PYTHONPATH=$PYTHONPATH:XX/SentiBERT/
export PYTHONPATH=$PYTHONPATH:XX/

Preprocessing

  1. Split the raw text and golden labels of sentiment/emotion datasets into xxx_train\dev\test.txt and xxx_train\dev\test_label.npy, assuming that xxx represents task name.
  2. Obtain tree information. There are totally three situtations.
  • For tasks except SST-phrase, SST-2,3,5, put the files into xxx_train\test.txt files into /stanford-corenlp-full-2018-10-05/. To get binary sentiment constituency trees, please run
cd /stanford-corenlp-full-2018-10-05
java -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,parse,sentiment -file xxx_train\test.txt -outputFormat json -ssplit.eolonly true -tokenize.whitespace true

The tree information will be stored in /stanford-corenlp-full-2018-10-05/xxx_train\test.txt.json.

  • For SST-2, please use
cd /stanford-corenlp-full-2018-10-05
java -cp "*" edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,parse,sentiment -file sst2_train\dev_text.txt -outputFormat json -ssplit.eolonly true

The tree information will be stored in /stanford-corenlp-full-2018-10-05/sst2_train\dev_text.txt.json.

  • For SST-phrase and SST-3,5, the tree information was already stored in sstphrase_train\test.txt.
  1. Run /datasets/xxx/xxx_st.py to clean, and store the text and label information in xxx_train\dev\test_text_new.txt and xxx_label_train\dev\test.npy. It also transforms the tree structure into matrices /datasets/xxx/xxx_train\dev\test_span.npy and /datasets/xxx/xxx_train\dev\test_span_3.npy. The first matrix is used as the range of constituencies in the first layer of our attention mechanism. The second matrix is used as the indices of each constituency's children nodes or subwords and itself in the second layer. Specifically, for tasks other than EmoInt, SST-phrase, SST-5 and SST-3, the command is like below:
cd /preprocessing

python xxx_st.py \
        --data_dir /datasets/xxx/ \                         ---> the location where you want to store preprocessed text, label and tree information 
        --tree_dir /stanford-corenlp-full-2018-10-05/ \     ---> the location of unpreprocessed tree information (usually in Stanford CoreNLP repo)
        --stage train \                                     ---> "train", "test" or "dev"

For EmoInt, the command is shown below:

cd /preprocessing

python xxx_st.py \
        --data_dir /datasets/xxx/ \                         ---> the location where you want to store preprocessed text, label and tree information 
        --tree_dir /stanford-corenlp-full-2018-10-05/ \     ---> the location of unpreprocessed tree information (usually in Stanford CoreNLP repo)
        --stage train \                                     ---> "train" or "test"
        --domain joy                                        ---> "joy", "sad", "fear" or "anger". Used in EmoInt task

For SST-phrase, SST-5 and SST-3, since they already have tree information in sstphrase_train\test.txt. In this case, tree_dir should be /datasets/sstphrase/ or /datasets/sst-3/. The command is shown below:

cd /preprocessing

python xxx_st.py \
        --data_dir /datasets/xxx/ \                         ---> the location where you want to store preprocessed text, label and tree information 
        --tree_dir /datasets/xxx/ \                         ---> the location of unpreprocessed tree information    
        --stage train \                                     ---> "train" or "test"

Pretraining

  1. Generate epochs for preparation
cd /examples/lm_finetuning

python3 pregenerate_training_data_sstphrase.py \
        --train_corpus /datasets/sstphrase/sstphrase_train_text_new.txt \
        --data_dir /datasets/sstphrase/ \
        --bert_model bert-base-uncased \
        --do_lower_case \
        --output_dir /training_sstphrase \
        --epochs_to_generate 3 \
        --max_seq_len 128 \
  1. Pretrain the generated epochs
CUDA_VISIBLE_DEVICES=7 python3 finetune_on_pregenerated_sstphrase.py \
        --pregenerated_data /training_sstphrase \
        --bert_model bert-base-uncased \
        --do_lower_case \
        --output_dir /results/sstphrase_pretrain \
        --epochs 3

The pre-trained parameters were released here. [Google Drive]

Fine-tuning

Run run_classifier_new.py directly as follows:

cd /examples

CUDA_VISIBLE_DEVICES=7 python run_classifier_new.py \
  --task_name xxx \                              ---> task name
  --do_train \
  --do_eval \
  --do_lower_case \
  --data_dir /datasets/xxx \                     ---> the same name as task_name
  --pretrain_dir /results/sstphrase_pretrain \   ---> the location of pre-trained parameters
  --bert_model bert-base-uncased \
  --max_seq_length 128 \
  --train_batch_size xxx \
  --learning_rate xxx \
  --num_train_epochs xxx \                                                          
  --domain xxx \                                 ---> "joy", "sad", "fear" or "anger". Used in EmoInt task
  --output_dir /results/xxx \                    ---> the same name as task_name
  --seed xxx \
  --para xxx                                     ---> "sentibert" or "bert": pretrained SentiBERT or BERT

Checkpoints

For reproducity and usability, we provide checkpoints and the original training settings to help you reproduce: Link of overall result folder: [Google Drive]

The implementation details and results are shown below:

Note: 1) BERT denotes BERT w/ Mean pooling. 2) The results of subtasks in EmoInt is (Joy: 68.90, 65.18, 4 epochs), (Anger: 68.17, 66.73, 4 epochs), (Sad: 66.25, 63.08, 5 epochs), (Fear: 65.49, 64.79, 5 epochs), respectively.

Models Batch Size Learning Rate Epochs Seed Results
SST-phrase
SentiBERT 32 2e-5 5 30 **68.98**
BERT* 32 2e-5 5 30 65.22
SST-5
SentiBERT 32 2e-5 5 30 **56.04**
BERT* 32 2e-5 5 30 50.23
SST-2
SentiBERT 32 2e-5 1 30 **93.25**
BERT 32 2e-5 1 30 92.08
SST-3
SentiBERT 32 2e-5 5 77 **77.34**
BERT* 32 2e-5 5 77 73.35
EmoContext
SentiBERT 32 2e-5 1 0 **74.47**
BERT 32 2e-5 1 0 73.64
EmoInt
SentiBERT 16 2e-5 4 or 5 77 **67.20**
BERT 16 2e-5 4 or 5 77 64.95
Twitter
SentiBERT 32 6e-5 1 45 **70.2**
BERT 32 6e-5 1 45 69.7

Analysis

Here we provide analysis implementation in our paper. We will focus on the evaluation of

  • local difficulty
  • global difficulty
  • negation
  • contrastive relation

In preprocessing part, we provide implementation to extract related information in the test set of SST-phrase and store them in

-- /datasets/sstphrase/swap_test_new.npy                   ---> global difficulty
-- /datasets/sstphrase/edge_swap_test_new.npy              ---> local difficulty
-- /datasets/sstphrase/neg_new.npy                         ---> negation
-- /datasets/sstphrase/but_new.npy                         ---> contrastive relation

In simple_accuracy_phrase(), we will provide statistical details and evaluate for each metric.

Some of the analysis results based on our provided checkpoints are selected and shown below:

Models Results
Local Difficulty
SentiBERT **[85.39, 60.80, 49.40]**
BERT* [83.00, 55.54, 31.97]
Negation
SentiBERT **[78.45, 76.25, 70.56]**
BERT* [75.04, 71.40, 68.77]
Contrastive Relation
SentiBERT **39.87**
BERT* 28.48

Acknowledgement

Here we would like to thank for BERT/RoBERTa implementation of HuggingFace and sentiment tree parser of Stanford CoreNLP. Also, thanks for the dataset release of SemEval. To confirm the privacy rule of SemEval task organizer, we only choose the publicable datasets of each task.

Citation

Please cite our ACL paper if this repository inspired your work.

@inproceedings{yin2020sentibert,
  author    = {Yin, Da and Meng, Tao and Chang, Kai-Wei},
  title     = {{SentiBERT}: A Transferable Transformer-Based Architecture for Compositional Sentiment Semantics},
  booktitle = {Proceedings of the 58th Conference of the Association for Computational Linguistics, {ACL} 2020, Seattle, USA},
  year      = {2020},
}

Contact

  • Due to the difference of environment, the results will be a bit different. If you have any questions regarding the code, please create an issue or contact the owner of this repository.
Comments
  • TypeError: forward() got an unexpected keyword argument 'phrase_mask'

    TypeError: forward() got an unexpected keyword argument 'phrase_mask'

    Hey WadeYin9712, absolutely love the work. During fine-tuning sstphrase, I can across the above error. I was looking for the error when I found you had used it in the Input features. While working with BERT, I haven't come across this masking. Does this have to do with the new module pytorch_pretrained_bert.modeling_new? Because that was also an error that I had to change to pytorch_pretrained_bert.modeling to import BertforPretraining. Could you help me out with this? Thanks in advance!

    opened by nutsformers 6
  • The pretraining for generated epoch is taking a LONG time!

    The pretraining for generated epoch is taking a LONG time!

    During pretraining, the epoch was killed. I assumed it was the RAM consumption, so i tried to increase swap memory. I tried it again but it seems like it is taking a really long time, even after connecting to the GPU. The result shown:

    CUDA_VISIBLE_DEVICES=0 python3 finetune_on_pregenerated_sstphrase.py \

    --pregenerated_data /home/oem/Documents/SentiBERT/training_sstphrase
    --bert_model bert-base-uncased
    --do_lower_case
    --output_dir /home/oem/Documents/SentiBERT/results/sstphrase_pretrain
    --epochs 3 2020-09-11 21:05:33,356: device: cpu n_gpu: 0, distributed training: False, 16-bits training: False 2020-09-11 21:05:34,533: loading vocabulary file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-vocab.txt from cache at /home/oem/.cache/torch/pytorch_pretrained_bert/26bc1ad6c0ac742e9b52263248f6d0f00068293b33709fae12320c0e35ccfbbb.542ce4285a40d23a559526243235df47c5f75c197f04f37d1a0c124c32c9a084 2020-09-11 21:05:37,707: loading weights file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-pytorch_model.bin from cache at /home/oem/.cache/torch/pytorch_pretrained_bert/aa1ef1aede4482d0dbcd4d52baad8ae300e60902e88fcb0bebdec09afd232066.36ca03ab34a1a5d5fa7bc3d03d55c4fa650fed07220e2eeebc06ce58d0e9a157 2020-09-11 21:05:37,707: loading configuration file https://s3.amazonaws.com/models.huggingface.co/bert/bert-base-uncased-config.json from cache at /home/oem/.cache/torch/pytorch_pretrained_bert/4dad0251492946e18ac39290fcfe91b89d370fee250efe9521476438fe8ca185.7156163d5fdc189c3016baca0775ffce230789d7fa2a42ef516483e4ca884517 2020-09-11 21:05:37,708: Model config { "architectures": [ "BertForMaskedLM" ], "attention_probs_dropout_prob": 0.1, "hidden_act": "gelu", "hidden_dropout_prob": 0.1, "hidden_size": 768, "initializer_range": 0.02, "intermediate_size": 3072, "layer_norm_eps": 1e-12, "max_position_embeddings": 512, "model_type": "bert", "num_attention_heads": 12, "num_hidden_layers": 12, "pad_token_id": 0, "type_vocab_size": 2, "vocab_size": 30522 }

    2020-09-11 21:05:47,259: Weights of BertForPreTraining not initialized from pretrained model: ['bert.pooler_phrase.dense.weight', 'bert.pooler_phrase.dense.bias', 'bert.trans.weight', 'bert.trans.bias', 'bert.trans_2.weight', 'bert.trans_2.bias', 'bert.trans_3.weight', 'bert.trans_3.bias', 'bert.bahdanau_attention.linear_encoder.weight', 'bert.bahdanau_attention.linear_encoder.bias', 'bert.bahdanau_attention.linear_decoder.weight', 'bert.bahdanau_attention.linear_decoder.bias', 'bert.bahdanau_attention.linear_in.0.weight', 'bert.bahdanau_attention.linear_in.0.bias', 'bert.bahdanau_attention.linear_in.3.weight', 'bert.bahdanau_attention.linear_in.3.bias', 'bert.bahdanau_attention_3.linear_encoder.weight', 'bert.bahdanau_attention_3.linear_encoder.bias', 'bert.bahdanau_attention_3.linear_decoder.weight', 'bert.bahdanau_attention_3.linear_decoder.bias', 'bert.bahdanau_attention_3.linear_in.0.weight', 'bert.bahdanau_attention_3.linear_in.0.bias', 'bert.bahdanau_attention_3.linear_in.3.weight', 'bert.bahdanau_attention_3.linear_in.3.bias', 'bert.linear_out.0.weight', 'bert.linear_out.0.bias', 'bert.linear_out.3.weight', 'bert.linear_out.3.bias', 'bert.linear_out_3.0.weight', 'bert.linear_out_3.0.bias', 'bert.linear_out_3.3.weight', 'bert.linear_out_3.3.bias', 'bert.LayerNorm.weight', 'bert.LayerNorm.bias', 'cls.phrase_predictions.transform.dense.weight', 'cls.phrase_predictions.transform.dense.bias', 'cls.phrase_predictions.transform.LayerNorm.weight', 'cls.phrase_predictions.transform.LayerNorm.bias', 'cls.phrase_predictions.decoder.weight', 'cls.phrase_predictions.decoder.bias'] 2020-09-11 21:05:47,267: ***** Running training ***** 2020-09-11 21:05:47,267: Num examples = 25137 2020-09-11 21:05:47,267: Batch size = 32 2020-09-11 21:05:47,268: Num steps = 785 2020-09-11 21:05:47,539: Loading training examples for epoch 0 Training examples: 100%|██████████████████| 8379/8379 [01:00<00:00, 139.13it/s] 2020-09-11 21:06:56,683: Loading complete! Epoch 0: 0%| | 1/262 [18:56<82:19:17, 1135.47s/it, Loss: 4.97729]

    Estimated time for each epoch is roughly 80+ hours. I am using a Gtx 1050ti with a nvidia 440 driver, 8GB RAM and 16GB of swap memory. The nvidia-smi is listed below:

    nvidia-smi Fri Sep 11 19:21:59 2020
    +-----------------------------------------------------------------------------+ | NVIDIA-SMI 440.100 Driver Version: 440.100 CUDA Version: 10.2 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | |===============================+======================+======================| | 0 GeForce GTX 105... Off | 00000000:01:00.0 Off | N/A | | N/A 52C P0 N/A / N/A | 148MiB / 4042MiB | 0% Default | +-------------------------------+----------------------+----------------------+

    +-----------------------------------------------------------------------------+ | Processes: GPU Memory | | GPU PID Type Process name Usage | |=============================================================================| | 0 992 G /usr/lib/xorg/Xorg 64MiB | | 0 1446 G /usr/bin/gnome-shell 83MiB | +-----------------------------------------------------------------------------+

    Could you let me now how to improve timing? In a previoud issue, you had mentioned you were able to achieve minutes for each epoch.

    opened by ParadoxTwo 5
  • What is the .json config file for pre-trained sentibert?

    What is the .json config file for pre-trained sentibert?

    Hi, thanks for the nice work. I tried to run Sentibert finetuning with emocontext:

    CUDA_VISIBLE_DEVICES=0 python examples/run_classifier_new.py
    --task_name emocontext
    --do_train
    --do_eval
    --do_lower_case
    --data_dir datasets/emocontext
    --pretrain_dir results/sstphrase_pretrain/
    --bert_model bert-base-uncased
    --max_seq_length 128
    --train_batch_size 16
    --learning_rate 0.001
    --num_train_epochs 10
    --output_dir results/emocontext
    --seed 1
    --para sentibert

    But ran into the following error: ERROR - pytorch_pretrained_bert.modeling_new - Model name 'results/sstphrase_pretrain/' was not found in model name list (bert-base-uncased, bert-large-uncased, bert-base-cased, bert-large-cased, bert-base-multilingual-uncased, bert-base-multilingual-cased, bert-base-chinese, bert-base-german-cased, bert-large-uncased-whole-word-masking, bert-large-cased-whole-word-masking, bert-large-uncased-whole-word-masking-finetuned-squad, bert-large-cased-whole-word-masking-finetuned-squad, bert-base-cased-finetuned-mrpc). We assumed 'results/sstphrase_pretrain/sstphrase.json' was a path or url but couldn't find any file associated to this path or url.

    It looks like sstphrase.json is missing. I only managed to obtain sstphrase.bin from your download link. Can you please also provide the .json config file? Thanks.

    opened by plkmo 5
  • Differemce between transformer library and tokanization.py

    Differemce between transformer library and tokanization.py

    Hey,

    I looked into the preprocessing python file and you have used a user defined pytorch_pretrained_bert.tokenization instead of using the huggingface library transformer.

    Will i get the same result for sentiBERT if I use the below code:

    from transformers import BertTokenizer

    If not, could you tell me what is the difference between them?

    Thanks!

    opened by DeepakDhanasekar 3
  • FileNotFoundError: [Errno 2] No such file or directory:

    FileNotFoundError: [Errno 2] No such file or directory:

    Hey, thank you for the work! While training sst2, i came upon the FileNotFountError: [Errno 2] No such file or directory: '/stanford-corenlp-full-2018-10-05/sst2_train_text.txt.json'. Although, this json was created in the previous step and stored in the same directory i.e., in the stanford-corenlp-full-2018-10-05 folder. Any assistance would be of great help! Thank you!

    opened by dsekar189 3
  • Accuracy only 50% for sst-2

    Accuracy only 50% for sst-2

    Hello, I followed all the process as written in the GitHub page. But I got only 51% accuracy for sst-2 task. Then I tried checkpoints offered by your teams and didn't train by myself, which means I only do preprocessing and evaluation, and the results are still about 50%. And my colleague met the same problem. Do anyone met the same condition? What could possible be the problem?

    opened by Ifei0 2
  • Could it be possible for you to release the code for SentiBERT w/ token?

    Could it be possible for you to release the code for SentiBERT w/ token?

    And if its preprocessing is different from SentiBERT? If different, could it be possible for you to release, too?

    Also, I wonder how SentiBERT compares to the sentiment parse of stanford-corenlp.

    Could it be possible for you to release the model for SentiBERT w/ token?

    Thanks for your time :)

    opened by ZCR1998 0
  • Running on a new dataset

    Running on a new dataset

    Hi @WadeYin9712 and thanks so much for sharing your code. Would you please give some instruction how to do sentiment classification on a new dataset?(positive/negative/neutral) I want to use your pretreated model on the datasets to do classification on a totally new dataset.

    Thanks for your time :)

    opened by un-lock-me 0
  • Weights from pretrained model not used

    Weights from pretrained model not used

    Weights from pretrained model not used in BertForSequenceClassification: ['cls.predictions.bias', 'cls.predictions.transform.dense.weight', 'cls.predictions.transform.dense.bias', 'cls.predictions.transform.LayerNorm.weight', 'cls.predictions.transform.LayerNorm.bias', 'cls.predictions.decoder.weight', 'cls.seq_relationship.weight', 'cls.seq_relationship.bias', 'cls.phrase_predictions.transform.dense.weight', 'cls.phrase_predictions.transform.dense.bias', 'cls.phrase_predictions.transform.LayerNorm.weight', 'cls.phrase_predictions.transform.LayerNorm.bias', 'cls.phrase_predictions.decoder.weight', 'cls.phrase_predictions.decoder.bias'] Are these weights essential during finetuning? Did you come across the same problem when implementing sentibert? If so, how did you solve it? The bin file and json file are downloaed from your link. "这些参数没有加载成功是否会影响整体的准确率呀,您在实现的时候这些参数加载成功了么,模型文件和json文件是从您提供的链接下载的,应该没有问题"

    opened by AlanLinZhizhou 0
  • Could it be possible for you to release the split code for global-difficulty split?

    Could it be possible for you to release the split code for global-difficulty split?

    Thanks very much for your work. I am quite interested in your local/global difficulty analysis. Wonder would it be possible for you to release the corresponding code you used to make the split (how to calculate switch number) . We tried to split according to your description by our own but could not be able to produce the exact number.....(for ours, we manage to get a maximum global switches of 43 if consider leaves and 14 if only at phrase level while you report a maximum of 23 in the paper)

    Thanks in advance Best

    opened by Punchwes 2
  • Span files from emoint_st.py

    Span files from emoint_st.py

    Is there an updated version? Instead of getting the *span_3.npy and *span.npy files from the SST generated json, emoint_st.py created a span_3.npy and split.npy file. The two span.npy files are needed for run_classifier_dataset_utils_new.npy.

    opened by alicerueda 0
  • how to split this file?

    how to split this file?

    I am very interested in your program, but I encountered a problem in the program and processing part, how to divide this, and where do you put the two paths? Did not see that your file exists 截屏2020-11-01下午3 27 47

    opened by cuczy 0
Owner
Da Yin
Da Yin
The repo contains the code of the ACL2020 paper `Dice Loss for Data-imbalanced NLP Tasks`

Dice Loss for NLP Tasks This repository contains code for Dice Loss for Data-imbalanced NLP Tasks at ACL2020. Setup Install Package Dependencies The c

null 223 Dec 17, 2022
Pytorch reimplement of the paper "A Novel Cascade Binary Tagging Framework for Relational Triple Extraction" ACL2020. The original code is written in keras.

CasRel-pytorch-reimplement Pytorch reimplement of the paper "A Novel Cascade Binary Tagging Framework for Relational Triple Extraction" ACL2020. The o

longlongman 170 Dec 1, 2022
Reimplementation of the paper `Human Attention Maps for Text Classification: Do Humans and Neural Networks Focus on the Same Words? (ACL2020)`

Human Attention for Text Classification Re-implementation of the paper Human Attention Maps for Text Classification: Do Humans and Neural Networks Foc

Shunsuke KITADA 15 Dec 13, 2021
Cross-media Structured Common Space for Multimedia Event Extraction (ACL2020)

Cross-media Structured Common Space for Multimedia Event Extraction Table of Contents Overview Requirements Data Quickstart Citation Overview The code

Manling Li 49 Nov 21, 2022
Codebase for the Summary Loop paper at ACL2020

Summary Loop This repository contains the code for ACL2020 paper: The Summary Loop: Learning to Write Abstractive Summaries Without Examples. Training

Canny Lab @ The University of California, Berkeley 44 Nov 4, 2022
Alex Pashevich 62 Dec 24, 2022
Code release for "Transferable Semantic Augmentation for Domain Adaptation" (CVPR 2021)

Transferable Semantic Augmentation for Domain Adaptation Code release for "Transferable Semantic Augmentation for Domain Adaptation" (CVPR 2021) Paper

null 66 Dec 16, 2022
Official Implementation of LARGE: Latent-Based Regression through GAN Semantics

LARGE: Latent-Based Regression through GAN Semantics [Project Website] [Google Colab] [Paper] LARGE: Latent-Based Regression through GAN Semantics Yot

null 83 Dec 6, 2022
A Protein-RNA Interface Predictor Based on Semantics of Sequences

PRIP PRIP:A Protein-RNA Interface Predictor Based on Semantics of Sequences installation gensim==3.8.3 matplotlib==3.1.3 xgboost==1.3.3 prettytable==2

李优 0 Mar 25, 2022
Code for EMNLP 2021 main conference paper "Text AutoAugment: Learning Compositional Augmentation Policy for Text Classification"

Text-AutoAugment (TAA) This repository contains the code for our paper Text AutoAugment: Learning Compositional Augmentation Policy for Text Classific

LancoPKU 105 Jan 3, 2023
This repository contains the code for the CVPR 2021 paper "GIRAFFE: Representing Scenes as Compositional Generative Neural Feature Fields"

GIRAFFE: Representing Scenes as Compositional Generative Neural Feature Fields Project Page | Paper | Supplementary | Video | Slides | Blog | Talk If

null 1.1k Dec 30, 2022
Code to reproduce the results for Compositional Attention: Disentangling Search and Retrieval.

Compositional-Attention This repository contains the official implementation for the paper Compositional Attention: Disentangling Search and Retrieval

Sarthak Mittal 17 Oct 23, 2021
[NeurIPS 2021] Code for Unsupervised Learning of Compositional Energy Concepts

Unsupervised Learning of Compositional Energy Concepts This is the pytorch code for the paper Unsupervised Learning of Compositional Energy Concepts.

null 45 Nov 30, 2022
This repo is the code release of EMNLP 2021 conference paper "Connect-the-Dots: Bridging Semantics between Words and Definitions via Aligning Word Sense Inventories".

Connect-the-Dots: Bridging Semantics between Words and Definitions via Aligning Word Sense Inventories This repo is the code release of EMNLP 2021 con

null 12 Nov 22, 2022
TraND: Transferable Neighborhood Discovery for Unsupervised Cross-domain Gait Recognition.

TraND This is the code for the paper "Jinkai Zheng, Xinchen Liu, Chenggang Yan, Jiyong Zhang, Wu Liu, Xiaoping Zhang and Tao Mei: TraND: Transferable

Jinkai Zheng 32 Apr 4, 2022
CLIP: Connecting Text and Image (Learning Transferable Visual Models From Natural Language Supervision)

CLIP (Contrastive Language–Image Pre-training) Experiments (Evaluation) Model Dataset Acc (%) ViT-B/32 (Paper) CIFAR100 65.1 ViT-B/32 (Our) CIFAR100 6

Myeongjun Kim 52 Jan 7, 2023
Official repository for "On Generating Transferable Targeted Perturbations" (ICCV 2021)

On Generating Transferable Targeted Perturbations (ICCV'21) Muzammal Naseer, Salman Khan, Munawar Hayat, Fahad Shahbaz Khan, and Fatih Porikli Paper:

Muzammal Naseer 46 Nov 17, 2022
TransPrompt - Towards an Automatic Transferable Prompting Framework for Few-shot Text Classification

TransPrompt This code is implement for our EMNLP 2021's paper 《TransPrompt:Towards an Automatic Transferable Prompting Framework for Few-shot Text Cla

WangJianing 23 Dec 21, 2022
code for paper "Does Unsupervised Architecture Representation Learning Help Neural Architecture Search?"

Does Unsupervised Architecture Representation Learning Help Neural Architecture Search? Code for paper: Does Unsupervised Architecture Representation

null 39 Dec 17, 2022