The troll data are download through Twitter (https://transparency.twitter.com/en/reports/moderation-research.html).
This repo is built upon a local copy of transformers==3.0.0.
This repo has been tested on torch==1.4.0 with python 3.7 and CUDA 10.1.
To start, create a new environment and install:
conda create -n metaTroll python=3.7
conda activate metaTroll
cd metaTroll
pip install -e .MODEL |
GITHUB |
|---|---|
| Induct | modified based on (https://github.com/zhongyuchen/few-shot-text-classification) |
| HATT | source code from authors (https://github.com/thunlp/HATT-Proto) |
| DS | source code from authors (https://github.com/YujiaBao/Distributional-Signatures) |
To further pre-train base BERT/XLM-R models:
Clone the transformer to local directory
git clone https://github.com/huggingface/transformers.git
For further pre-training the language models:
python transformers/examples/language-modeling/run_language_modeling.py ,
--output_dir='BERT_DAPT',
--model_type=bert ,
--model_name_or_path=bert-base-cased-freeze-we,
--do_train,
--overwrite_output_dir,
--train_data_file='train.txt',
--do_eval,
--block_size=512,
--eval_data_file='vali.txt',
--mlm"
This is the source code for [MetaTroll: Few-shot Detection of State-Sponsored Trolls with Transformer Adapters]
If you find this code useful, please let us know and cite our paper.
If you have any question, please contact Lin at: s3795533 at student dot rmit dot edu dot au.