MetaphorAID
MetaphorAID
MetaphorAID is a tool that utilizes generative artificial intelligence to identify and tag metaphorical expressions in the Hungarian language. Analyzing metaphors and other instances of non-literal language remains a significant challenge for natural language processing. The main reason is that it requires identifying meanings that cannot be described by rules and are often not even obvious to language users themselves. At the same time, it is necessary to recognize these expressions because they are unavoidable in many areas of everyday life (from medical communication to marketing and political communication, and to science and psychology). Therefore, identifying and analyzing metaphors contributes to our understanding of how we think about the phenomena of the world around us and ourselves within it. In mental crises, metaphor analysis can effectively determine the nature and intensity of the situation, making interventions and prevention more successful.
Until now, the most widely accepted and common method for identifying metaphorical expressions has been manual analysis, which requires the development of an annotation protocol and the training of annotators, as well as a considerable amount of work hours to complete the annotation and to compare and standardize the decisions of individual annotators. Many annotation protocols are now available for various languages worldwide, and our research group has been leading the effort to adapt them for the Hungarian language. The benefit of manual analysis using human resources is the development of a precise and organized database. However, the drawback is that this method is very time-consuming and labor-intensive, requiring a substantial financial investment. In recent years, efforts have been made to automate the identification of metaphors by leveraging the linguistic characteristics of metaphorical expressions, including their grammatical properties and multi-word association patterns. Still, these attempts have mainly focused on world languages that have well-developed linguistic resources. An earlier study conducted on the Hungarian language indicated that, compared to psycholinguistic and dictionary-based methods, the approach relying on linguistic patterns is the most effective. Nevertheless, its performance still falls short of expectations. In other words, it is not possible to automate and accelerate the identification of metaphors on a large scale based solely on recurring linguistic features in texts.
The main feature of our proposed solution is its combination of precise manual analysis, which limits the scale of the analysis, and fast machine analysis, which is less efficient. The MetaphorAID tool transfers the manual annotation protocol adapted to the Hungarian language into a machine environment using prompting techniques. Thus, generative AI is positioned as the human annotator, tasked with predicting whether a specific expression in a given text is metaphorical. Automatic prediction is preceded by linguistic analysis, and the tool—just like the linguist performing the analysis—is provided with the relevant entry from the Concise Dictionary of Hungarian to exploit dictionary meanings and the annotation protocol in the course of decision making. In addition to the prediction of metaphoricity, the reasoning of the LLM is also part of the output, as is the examination of whether other non-literal meanings (e.g., metonymy or generalization) can be considered for the given expression in addition to metaphor. During development, the tool achieved a balanced accuracy of nearly 80%, a remarkable result even in an international context. The output of the large language model is displayed in an annotation interface where the human analyst can check the results of the linguistic preprocessing, the relevant dictionary meanings, and the LLM’s prediction and reasoning. With this information, they have the option to approve or override the decision. MetaphorAID is an annotation tool that significantly accelerates the metaphor identification process and expands its scale, while maintaining the role and importance of human intervention.