This repository contains code introduced in the following paper:
Neural Coreference Resolution for Arabic
Abdulrahman Aloraini, Juntao Yu and Massimo Poesio *equal contribution
In Proceedings of the Third Workshop on Computational Models of Reference, Anaphora and Coreference (CRAC@COLING), 2020.
pip install -r requirements.txt
.setup.sh
to download the fastText embeddings that required by the system and compile the Tensorflow custom kernels.Pre-trained models can be download from this link. We provide two pre-trained models:
Put the downloaded models along with the char_vocab.arabic.txt in the root folder of the code.
Modifiy the test_path and conll_test_path accordingly:
{
"clusters": [[[0,0],[5,5]],[[2,3],[7,8]],
"pred_mentions":[[0,0],[2,3],[5,5],[7,9]], #Optional
"doc_key": "nw",
"sentences": [["John", "has", "a", "car", "."], ["He", "washed", "the", "car", "yesteday","."],["Really","?","it", "was", "raining","yesteday","!"]],
"speakers": [["sp1", "sp1", "sp1", "sp1", "sp1"], ["sp1", "sp1", "sp1", "sp1", "sp1","sp1"],["sp2","sp2","sp2","sp2","sp2","sp2","sp2"]]
}
python preprocess_arabic.py test.jsonlines test.cleaned.jsonlines
.Then you need to run the extract_bert_features.sh
to compute the BERT embeddings for the test set.
Then use python evaluate.py config_name
to start your evaluation.
python get_char_vocab.py train.jsonlines dev.jsonlines
extract_bert_features.sh
to compute the BERT embeddings for training, development and test sets.python train.py config_name
The cluster ranking model takes about 40 hours to train (400k steps) on a GTX 1080Ti GPU.