Assessing syntactic abilities of BERT
Clone or download
Latest commit a9fa1ac Jan 5, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
results initial Jan 6, 2019
LICENSE Initial commit Jan 6, 2019 Update Jan 6, 2019 initial Jan 6, 2019 initial Jan 6, 2019 initial Jan 6, 2019 initial Jan 6, 2019 initial Jan 6, 2019 initial Jan 6, 2019
lgd_dataset.tsv initial Jan 6, 2019 initial Jan 6, 2019
marvin_linzen_dataset.tsv initial Jan 6, 2019 initial Jan 6, 2019


Assesing the syntactic abilities of BERT.


Evaluate Google's BERT-Base and BERT-Large models on the syntactic agreement datasets from Linzen, Goldberg and Dupoux 2016 and Marvin and Linzen 2018 and Gulordava et al 2018.

This is quite messy, as I hacked it together between things here and there. But I also believe it is accurate. This lists the data files and shows how to run the evaluation. For more details and results, see the arxiv report.

Data Files

Data taken from the github repos of Linzen, Goldberg and Dupoux (LGD), Marvin and Linzen (ML), and Gulordava et al.

File Description
marvin_linzen_dataset.tsv stimuli from Marvin and Linzen. I dumped it from the pickle files of ML
wiki.vocab from LGD, used for verb inflections (wiki.vocab)
lgd_dataset.tsv processed data from LGD data from Gulordava et al (

lgd_dataset.tsv is created by

gunzip agr_50_mostcommon_10K.tsv.gz
python > lgd_dataset.tsv

Obtaining the results

pip install pytorch_pretrained_bert

python > results/lgd_results_large.txt
python base > results/lgd_results_base.txt
python marvin > results/marvin_results_large.txt
python marvin base > results/marvin_results_base.txt
python gul > results/gulordava_results_large.txt
python gul base > results/gulordava_results_base.txt

Generating tables (for the PDF)