This research delves into the intricate connection between self-attention mechanisms in large-scale pre-trained language models, like BERT, and human gaze patterns, with the aim of harnessing gaze information to enhance the performance of natural language processing (NLP) models.
-
Download dataset pwd:4x0l
-
cd Analysisand runpython bert_crf.pyto obtain self-attention of BERT saved tocorpus/ -
Calculate the spearmanr between self-attention and gaze by running
plot.py.
-
For those dataset without gaze signals, first
cd Gaze_prediction_model_V1/scripts/and runrun_roberta.py -
For GLUE and SNLI datasets,
cd source/, and run the corresponding Python file, such as -
For WSC, WiC, and COPA datasets,
cd WWC/, and revised the corresponding dataset to runpython run_main.py -
For LCSTS dataset,
cd LCSTS/, andpython train.py