Hidden in Plain Sight: Can G erman W iktionary and Wordnets Facilitate the Detection of Antithesis? (2023)

Abstract: Existing wordnets mainly focus on synonyms, while antonyms have often been neglected, especially in wordnets in languages other than English. In this paper, we show how regular expressions are used to generate an antonym resource for German by using Wiktionary as a source. This resource contains antonyms for 45499 words. The antonyms can be used to extend existing wordnets. We show that this is important by comparing our antonym resource to the antonyms in OdeNet, the only freely available German wordnet that contains antonyms for 3059 words. We demonstrate that antonyms are relevant for the detection of the rhetorical figure antithesis. This figure has been known to influence the audience by creating contradiction and using a parallel sentence structure combined with antonyms. We first detect parallelism with part-of-speech tags and then apply our rule-based antithesis detection algorithm to a dataset of the messenger service Telegram. We evaluate our approach and achieve a precision of 57% and a recall of 45% thus overcoming the existing approaches.

## introduction the goal of natural language processing (nlp) is to enable computers to automatically analyze text and to understand its (sometimes subtle) underlying meaning. while this is a relatively easy task for most humans, it is difficult for computers, as good results depend on available language resources. examples of such resources are lexicons, dictionaries, or databases. one of the most wellknown lexical-semantic databases, or knowledge bases, is the princeton wordnet @xcite for the english language. for text understanding of non-english texts, wordnets in other languages have been developed. however, two problems are often encountered. the first problem is common in nlp: good resources are only available in "popular" languages with many speakers (e.g., english), while less-or lowresourced languages are often neglected. the second problem is that some wordnets are not freely accessible or have poor quality @xcite . in this paper, we want to focus on antonyms in the german language: while synonyms are easier to obtain from existing wordnets, antonyms only get marginal attention. so far, freely available german antonyms can only be found in the open german odenet @xcite and ba-belnet, a multilingual encyclopedic dictionary and semantic network that combines different sources like wordnet, wikipedia, wiktionary, etc. @xcite . we aim to use a different antonym resource for the task of antithesis detection -a rhetorical figure that is constructed by using parallel phrases that contain a pair of antonyms. as rhetorical figures always have a function @xcite , this figure is used to express tension, to make a comparison, or to reveal contradicting behavior, ideas, or statements. for example, the biblical antithesis "the spirit is willing, but the flesh is weak" (matthew 26:41) expresses the contrast between mind and body. @xcite presents a study on how antitheses are used in arguments in environmental science policy journal articles to show the contrast between the view of environmentalists and engineers. in politics, its usage can influence the audience and increase the scepticism towards the authorities by showing that their actions are contradictory, raising a feeling that they are unable to govern people successfully. by detecting antitheses in politically related texts, people's opinions can be better evaluated by understanding the hidden notions expressed by this figure: by using it for contrasting comparisons ("they are allowed to do this" vs. "we are not allowed to do that"), people are made jealous and incited to riot. it is important to prevent this by understanding the role of antithe-sis, especially in crisis situations, e.g., a pandemic, war, or in energy crises. we consider antithesis detection as a binary classification problem and tackle it with a rule-based approach. as a dataset, we use posts by a german journalist on the messenger service telegram in which he criticizes the german government during the covid-19 pandemic. the parallel structure of those posts is identified by using part-of-speech (pos) tags. for the antonym detection, we rely on a word-based comparison. however, we realized that both odenet and babelnet cannot satisfy our requirements for this task: we expect the antonym resource to be as complete as possible, i.e., containing antonyms for as many words as possible. furthermore, we are interested in achieving a high recall to find most of the antitheses. in addition, we want the resource to be freely available. for babelnet, it was difficult to retrieve all words with their respective antonyms, as we could not locate a list of all words contained in babelnet. furthermore, the extraction is limited by so-called babelcoins where one coin represents one query: to retrieve one antonym, at least three different queries are necessary. in addition, by manually checking babelnet, we realized that only few words contain antonyms which are often not german. odenet offers more antonyms and it provides a file of every word. with this file, we were able to extract all antonyms from odenet. however, we were still not able to identify most of the relevant antitheses (see section 5 for a detailed comparison, especially the remainder of this paper is structured as follows: in section 2, we describe related work on wordnets, wiktionary as data source, and antithesis detection. section 3 gives insights into the process of building the antonym dictionary. the antithesis detection process is described in section 4. the evaluation in section 5 compares our antonym resource with the antonyms in odenet. we also evaluate the performance of the rule-based antithesis detection approach. the following discussion includes a critical review of our methods and results. the paper concludes in section 6. the code and data relevant for this paper are available online. foot_1 2 related work we will first give an overview of different wordnets for the german language and the sources that can be used to construct a language resource. the second part briefly defines antithesis and presents approaches for its detection. ## antonym resource creation the data on wiktionary pages are only semistructured and the structure even differs between languages @xcite . typically, a german wiktionary page of a certain word contains subsections describing its pronunciation, meanings, synonyms, antonyms, idiomatic expressions, etc. 4 below the section of the german entry are properties often displayed in other languages, e.g., english, swedish, etc. the german wiktionary dumps (here: from 2021-11-21 17:50:44) that are created regularly and are available online foot_4 are used to create the antonym resource. the structure of such a file is shown in appendix a.1. we parse the xml dump file with elementtree foot_5 from the python standard library, and search for the string "gegenwörter" (antonyms). antonyms are extracted by using regular expressions. we ensure that only german antonyms are extracted and not words from other languages that are also present on some pages. ## antithesis detection to highlight the relevance of antonyms in nlp in general and especially in the context of rhetorical figure detection, we focus on the figure antithesis, a figure combining parallel phrases with antonyms. as definitions for rhetorical figures have never been precise or uniform, the detection of antitheses poses the following challenges: those issues are tackled in the following way: challenge 1 -phrases: we define relevant phrases by the occurrence of specific markers such as punctuation marks, the word "als" (as/when), or "und" (and). considering quotation marks as such markers or removing them can also yield a parallel structure. a sentence is split at the occurrence of such markers into individual phrases. only phrases that consist of more than one word are considered. challenge 2 & 3 -parallelism: parallel phrases do not have to be necessarily within one sentence, only within one post. we define parallelism by repeating pos tags, e.g., the/det night/noun is/aux long/adv, the/det day/noun is/aux short/adv ./ punct the spacy pos tagger foot_6 also supports the german language. we use the trained pipeline de_dep_news_trf with the highest accuracy for pos tags (99%). 8 despite the high accuracy, false labelled pos tags can occur, causing the algorithm not to recognize the parallel structure. furthermore, we replace the pos tag "propn" for proper nouns with the tag "noun", as proper nouns are just a further specification of general nouns (e.g., (company) names, brands, etc.). we do not use a strict definition of parallelism but accept some deviations: if a phrase consists of 3 or fewer words, perfect parallelism is required, i.e., perfectly repeating pos tags. if a phrase consists of more than three words, we defined a levenshtein distance: in our case, the number of pos tags between two phrases has to match at least to 75 %. to investigate parallelism further to find the optimal threshold for parallelism is considered future work. challenge 4 -antonyms: with adequate language resources, finding antonyms should not be a challenge. however, as already mentioned, the functionality of existing resources is limited. with our generated dictionary from wiktionary, we hope to cover most of the existing antonyms. dependent on how strictly fahnestock's definition is interpreted, it would be necessary to define for each antonym pair a distance function to determine the appropriateness of an antonym pair. green and crotts (2020) consider synonyms of antonyms in their antithesis detection. we will not include synonyms, not only because of the lack of resources but also because the function of the antithesis is weakened if the predictability of antonyms decreases. another problem that both green and crotts (2020) and @xcite face are polarity shifters and negation cues: for example, "unethical" is considered to be the opposite of "ethical". however, "unethical" is semantically very close to "not ethical". as we are looking for antonyms on a word basis, we are not able to capture those negations. another problem that was also identified by @xcite is that opposing concepts cannot be recognized. a further challenge in the german language is the so-called tmesis with separable verbs: a particle is split from its core, or prefixes are inserted in the process of inflection, changing their position in a sentence. even lemmatizers are not able to transform those words into their original lemma. ## evaluation we evaluate two aspects: (1) we want to quantitatively compare the created antonym resource with odenet's antonyms, which is so far the best wordnet for german antonyms. ( 2 ## conclusion as wordnets mainly focus on synonyms, we constructed a resource for antonyms from the ger-man wiktionary. we highlighted the relevance of antonyms by using the created resource to detect the rhetorical figure antithesis, a persuasive figure that is often used in arguments. antithesis detection can enable the identification of bias and persuasion, which is helpful in a political context as our dataset demonstrated. with our rule-based approach, we were able to identify parallel phrases and achieved a recall of 45 %, whereas odenet was only able to identify 8.8 % of the antitheses. the limited availability of language resources, their functionality, and the need of datasets are still challenges that must be addressed. in the future, we want to improve the detection of antithesis. with language models and deep learning, we assume to achieve higher precision and recall. data augmentation techniques need to be considered to tackle the imbalance of the dataset. wordnets can help here by replacing words with their synonyms.