Python Tool for Corpus-Based Verification of AI-Generated Metaphors

Read full text
Authors: Dmitry Doltmurziev
Cited by: 2

Abstract

This repository contains a Python script developed for the verification of metaphor lists generated by AI language models using a local text corpus. The tool was designed within a study investigating the applicability of AI-generated lexical material in language teaching and the necessity of corpus-based validation. It enables users to determine whether generated metaphors occur in authentic discourse and to measure their frequency of use. The script performs exact phrase matching with limited morphological variation by generating regular forms (s, es, ed, ing). This approach ensures high computational efficiency when processing large corpora, while acknowledging certain limitations in capturing irregular forms and syntactic variation. The tool was tested on a large English-language corpus of United Nations documents (approx. 540 million words, 1990–2014). Due to size restrictions, the corpus is not included in this repository. The results produced by the script can be used for:- validating AI-generated lexical lists,- selecting relevant metaphors for teaching materials,- ranking expressions by frequency and difficulty level. Limitations:- no lemmatization,- no support for irregular verb forms,- no handling of word order variation,- restricted to English-language corpora. The code is intended for research and educational purposes.

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
12 April 2026