Skip to content

Probing and Generalization of Metaphorical Knowledge in Pre-Trained Language Modelss[ACL 2022]

Notifications You must be signed in to change notification settings

EhsanAghazadeh/Metaphors_in_PLMs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Metaphors in Pre-Trained Language Models:
Probing and Generalization Across Datasets and Languages

Accepted as a conference paper at ACL 2022

📝 Arxiv 🎥 Video 🖼️ Poster

Abstract: Human languages are full of metaphorical expressions. Metaphors help people understand the world by connecting new concepts and domains to more familiar ones. Large pre-trained language models (PLMs) are therefore assumed to encode metaphorical knowledge useful for NLP systems. In this paper, we investigate this hypothesis for PLMs, by probing metaphoricity information in their encodings, and by measuring the cross-lingual and cross-dataset generalization of this information. We present studies in multiple metaphor detection datasets and in four languages (i.e., English, Spanish, Russian, and Farsi). Our extensive experiments suggest that contextual representations in PLMs do encode metaphorical knowledge, and mostly in their middle layers. The knowledge is transferable between languages and datasets, especially when the annotation is consistent across training and testing sets. Our findings give helpful insights for both cognitive and NLP scientists.

Running Probings

An online colab notebook is available at Metaphor_Demo.ipynb

You can run the probings by running the following command:

python3 {EDGE_CODE_PATH/MDL_CODE_PATH} {MODEL_NAME} {TASK_NAME} {SEED}

Example:

python3 source_code/scripts/edge_probing.py bert-base-uncased trofi 0
python3 source_code/scripts/mdl_probing.py bert-base-uncased trofi 0

MODEL_NAME:

bert-base-uncased
roberta-base
google/electra-base-discriminator
xlm-roberta-base

TASK_NAME:

lcc
trofi
vua_verb
vua_pos
lcc_fa
lcc_es
lcc_ru

About

Probing and Generalization of Metaphorical Knowledge in Pre-Trained Language Modelss[ACL 2022]

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published