FigureOut - Automatic Detection of Hebrew Metaphors throughout the Ages


Israel Ministry of Science and Technology Grant, 2021, 600,000 NIS, 3 years


Prof. Ophir Münz-Manor,The Open University of Israel
Prof. Benny Kimelfeld, Technion, Israel Institute of Technology
Dr. Yonatan Belinkov, Technion, Israel Institute of Technology

The ability to distinguish between figurative and literal language is essential for computers to understand text in a natural language. This capability is crucial for many tasks, such as sentiment analysis, machine translation, and summarization. At the same time, the differentiation between the figurative and the literal is a major interpretative task for scholars of literature, especially of poetry. While several machine learning models for this task have been developed, most focus on modern non-poetic texts, and as far as we know, none deal with Hebrew. Our project seeks to fill this gap by developing tools for the automatic detection of figurative language in Hebrew poetry. We focus specifically on metaphors in a corpus of poems written in the Galilee between the fifth and eighth centuries CE. The metaphors in the poems were previously annotated manually by literary experts and we use them to train our models and validate their results. 

In view of the fact that Hebrew is a morphologically-rich language, NLP in Hebrew is more challenging than that in languages with simpler morphologies. Token classification can be accomplished using a trained encoder, such as BERT, that was pre-trained on masked language modelling on a large corpus and then fine-tuned on a small labeled dataset. For Hebrew, we are using AlephBERT and fine-tuning it for metaphor detection using the aforementioned labeled dataset. We are considering additional alternatives, one of which is to fine-tune BEREL, which was pretrained on Rabbinic Hebrew that is more similar to ours, although its corpus was much smaller. Our hypothesis is that the BEREL model will produce better results since it was trained on a language that is more similar to Piyyut than modern Hebrew. As previously noted, the task is challenging, and at the moment, we are obtaining a score of 56 F1 on it; at this point already, it is obvious that a pre-trained model is very important for this task. 


Figure 1: Distribution of the metaphor ratio in the Pre-Classical Piyyut corpus
Figure 2: Distribution in the metaphor ratio in the Pinchas corpus