- Python >= 3.6 and PyTorch >= 0.4.1
- AllenNLP package (if you use ELMo)
If you use conda
:
git clone https://github.com/allanj/pytorch_lstmcrf.git
conda create -n pt_lstmcrf python=3.7
conda activate pt_lstmcrf
# check https://pytorch.org for the suitable version of your machines
conda install pytorch=1.3.0 torchvision cudatoolkit=10.0 -c pytorch -n pt_lstmcrf
pip install tqdm
pip install termcolor
pip install overrides
pip install allennlp
- Put the Glove embedding file (
glove.6B.100d.txt
) underdata
directory (You can also use ELMo/BERT/Flair, Check below.) Note that if your embedding file does not exist, we just randomly initalize the embeddings. - Simply run the following command and you can obtain results comparable to the benchmark above.
If you want to use your 1st GPU device
python trainer.py
cuda:0
and train models for your own dataset with elmo embedding:python trainer.py --device cuda:0 --dataset YourData --context_emb elmo --model_folder saved_models
- Create a folder
YourData
under the data directory. - Put the
train.txt
,dev.txt
andtest.txt
files (make sure the format is compatible, i.e. the first column is words and the last column are tags) under this directory. If you have a different format, simply modify the reader inconfig/reader.py
. - Change the
dataset
argument toYourData
when you runtrainer.py
.
The preprocessed RR dataset is saved in ./data
. For more details regarding the data preparation step, please refer to RR.
@inproceedings{cheng2020ape,
title={APE: Argument Pair Extraction from Peer Review and Rebuttal via Multi-task Learning},
author={Cheng, Liying and Bing, Lidong and Qian, Yu and Lu, Wei and Si, Luo},
booktitle={Proceedings of EMNLP},
year={2020}
}