Issues in the computational processing of Upamāalaṅkāra. (2023)

Abstract: Processing and understanding of figurative speech is a challenging task for computers as well as humans. In this paper, we present a case of Upamā alaṅkāra (simile). The verbal cognition of the Upamā alaṅkāra by a human is presented as a dependency tree, which involves the identification of various components such as upamāna (vehicle), upameya (topic), sādhāran.a-dharma (common property) and upamādyotaka (word indicating similitude). This involves the repetition of elliptical elements. Further, we show, how the same dependency tree may be represented without any loss of information, even without repetition of elliptical elements. Such a representation would be useful for the computational processing of the alaṅkāras.

## introduction sanskrit is one of the oldest natural languages with rich variety of literature ranging from vyākaran . a (grammar), śiks . ā (phonetics), nirukta (etymology), etc. to mīmāmsā (exegesis), nyāya (logic), kāvyaśāstra (poetics), sāhitya (literature), nāt . yaśāstra (dramaturgy), dharmaśāstra (jurisprudence), etc. kāvyaśāstra (poetics) is one of the subjects that has been dealt with elaborately in the sanskrit tradition. the study of alaṅkāras (that can loosely be translated as 'figures of speech') constitutes an important part of the study of this branch. figures of speech are an integral part of language. they are constantly used in common parlance as well as in literature. they contribute to the richness of the language and increase its effectiveness. in sanskrit poetics, the figures of speech have been categorized into 3 types: in arthālaṅkāras, upamā is one of the oldest figures of speech mentioned in the earliest text of kāvyaśāstra, that is nāt . yaśāstra of bharata. upamā serves as the basis for several other figures of speech such as apahnuti, sasandeha, utpreks . ā, rūpaka, etc. that are based on similarity. in this figure of speech, the central idea is to compare one object with another due to both possessing a common characteristic. herein, a comparison takes place by measuring the object of comparison closely with the standard of comparison. such a comparison may intend to exalt or degrade an object. 1. to exalt-e.g., mukham candrah . iva raman . īyam-'the face is as pleasant as the moon.' 2. to degrade-e.g., durjanavachah . halāhalam iva dussaham-'the speech of a wicked person is as unbearable as the poison called halāhala. 1 ' the notion of the english figure of speech-simile @xcite , is similar to the concept of upamā. upamā consists of four components, viz. processing of figurative language is a challenging domain in natural language processing (nlp). here are a few instances of computational work in this field in other languages. @xcite proposed a framework for annotating similes in a literary text in the english language. audichya and saini (2021) proposed a specific methodology for the identification of the three hindi 'alankaaras'. @xcite designed an end-to-end model for poetry generation based on conditioned recurrent neural networks (rnn). @xcite worked on automatic recognition and classification of comparisons and similes. @xcite focuses on metaphor detection in a poetry corpus. naaz and singh (2022) mapped the aesthetic properties of poetry onto a numeral scale for the hindi language. for the sanskrit language, @xcite designed a tool to identify and classify yamaka and anuprāsa, which are the types of śabdālaṅkāra. however, no work has been done in the field of arthālaṅkāras in sanskrit language from the computational point of view. the cognitive ability of the human mind is way more complex than a machine. upamā is a poetic device where a creative analogy is presented. unlike other simple sentences, sentences where upamā is employed, the tagging scheme is expected to provide certain more specifications than the thematic roles. this level of parsing is higher than the thematic roles level. we aim to parse sentences with upamā in a manner similar to how human beings understand it and then represent it within a parse tree.the current parser does not handle constructions with upamā alaṅkāra. we propose an extension to this parser to handle upamā alaṅkāra as well. first we present a diagrammatic representation of the human cognition of upamā. then, taking into account the limitation of the machine to deal with only words and not their meanings, we propose another representation that is feasible to arrive at automatically, yet not leading to any loss of information. ## background understanding a sentence with upamā alaṅkāra is not easy. one needs to first identify the word expressing similitude. this is followed by the identification of the common property and then the upamāna and upameya. once these are identified, then in order to understand the overall meaning of the sentence, typically the reader will construct two parallel sentences, one with upamāna and another with upameya by providing the elliptic words if any. for example, in the sentence mukham candrah . iva raman . īyam asti (the face is as pleasant as the moon.), the word raman . īyam (pleasant) is identified as the common property and then the upamāna and upameya are identified as 'candra' (the moon) and 'mukham' (the face) respectively, with 'iva' as the marker. now, the understanding that takes place in the mind of a reader is as follows: candrah . raman . īyah . asti (the moon is pleasant). on similar lines, mukham raman . īyam asti (the face is pleasant). thus, the reader provides the elliptic words and constructs two separate independent sentences and understands them. in order to develop a computational module for automatic handling of upamā alaṅkāra, since the identification of elliptic words and reconstruction of two sentences with their repetition is not feasible, we propose to analyse the sentence, taking the advantage that the upamāna and upameya in sanskrit have the same syntactic behaviour as adjective-substantive. further, the marker of upamā alaṅkāra provides a clue for identifying the upamāna-upameya relation. taking these clues, we propose a module to enhance the existing sanskrit parser. 2 in what follows, we first provide the classification of six types of upamā. each of these presentations includes a graphical representation of human understanding followed by the representation that we expect from the machine. in the fifth section, we discuss the potential problems in the implementation. this is followed by the conclusion and future scope for analysis of figures of speech. ## about upamā ala ṅkāra the literature in the sanskrit language has dealt with rhetorics in quite a detail. the literature available in the tradition of kāvyaśāstra on upamā alaṅkāra discusses various definitions of this figure of speech, followed by its types and examples. further, a few texts also explain the śābdabodha of upamā instances in navya-nyāya style from the logicians' perspective. here, we refer to mammat . ācārya's kāvyaprakāśa (kp, henceforth) for classification of upamā alaṅkāra into various types. we have chosen this text from kāvyaśāstra because the classification is easy and clear as it is done on syntactical grounds. this figure of speech has been divided into two types: this being a pilot study, we have considered the pūrnā variety where all the factors are present for better analysis at the initial stage. the pūrnā variety is further divided into 6 sub-types on the following two criteria: ## graphical representation herein, we give graphs for every variety of pūrnopamā in two ways. in the first type, we show how human intellect understands a sentence having upamā alaṅkāra. in this pattern, we divide the expression into two sentences. one is the upamāna sentence (sentence standing as topic) and another is the upameya sentence (sentence standing as vehicle). and these two sentences are connected by the word indicating similitude. while deriving these two different sentences from one sentence expressing 'upamā alaṅkāra', the words denoting common property i.e., the state or event in simile (samāna-dharma) have to be repeated in both. such a word indicating 'state' can be an adjective, a headword (verb) or a noun. also, there are a few words that are considered in both sentences but are not the 'state'. for example in the verse discussed in the section 4.3, the words 'bhuvanam' and 'babhāra' are repeated in both topic and vehicle sentences. but they cannot be termed as 'state', for they do not contribute to the beauty of expression of 'upamā'. on the contrary, they have been taken twice to complete the sentence and give the context. human intellect can make such distinction by understanding the role and the relation of each word in the sentence based on meaning. in pattern 2, the words are not repeated. a whole sentence is considered to be a single sentence. the reason for the non-repetition of the common property is as follows: the common property used for simile can be an action or a property, and it is only the context that tells us which one is being referred to. it may also involve extra linguistic information. for the machine learning techniques to learn this, we need a huge corpus with such instances, preferably annotated. in the absence of such a corpus, it is not possible even for the machine learning algorithms to mark this common ground for comparison. in the graphs the pattern code is as follows: essentially the four main components of upamā are shown in various shapes in both the patterns. the upameya is given in dashed oval. the upamāna is shown in dashed box. the dyotaka is shown in a pentagon shape. the common property is given in a simple box in the human understanding graph, whereas in machine graphs just like other components of the sentence, it is given in a simple oval shape like other sentential relations. common property has not been given a different shape in the machine graph because the machine cannot identify it. the dotted line in pattern 2 denotes the supplement of ellipsis ('adhyāhāra') of the dyotaka (comparator) when there are more than one pair of upameya and upamāna and only one comparator is provided. the first pattern does not require the node of dyotaka. we now discuss every variety of pūrnopamā and provide its diagrammatic representation. in this diagram, the main verb is connected to the kārakas and other indeclinables such as 'na'. further, the viśes . ya is connected to viśes . an . a. ## potential problems in the implementation of the proposed representation in this context, we anticipate a few challenges that a machine would face during implementation: finding solutions to these problems is a real challenge. the answers to these problems can be sought with the help of of ontological classification of such objects. the word net foot_3 or the concept net or the knowledge net of amarakośa foot_4 can also come to aid for this. similarly, the creation of a data set of possible pairs of upamāna and upameya with common ground can help the machine classify a word as a topic or vehicle in a given instance. however, such a data set will not be useful for the sentences where upamāna and upameya are not listed in this data set. ## conclusions and future scope while analysing any complex topic that has several components interconnected to each other, the graph is a suitable format for its cognition. we realize this prominently when we see a graphical representation of parsed sentences in samsaadhanii, wordnet, concept net, representation of the relations between the objects or concepts in scientific texts, etc. the inherent nature of a figure of speech like upamā is to have an interconnection between two objects, and there could be more than one such pair in a poetic instance. in such a situation, this graphical representation could be of great aid to the student or reader, since it eliminates ambiguity and room for doubt that could possibly arise while reading a complex statement. since this concept of upamā is found in other languages as well, a similar pattern of representation can be adopted by them while explaining the instances of this figure of speech in their respective languages. identifying the state in an instance of upamā, is a task that seems unachievable in the present scenario. however, this is an open field for researchers to develop a technique to identify it. further, we aim to construct such parse trees for another variety of upamā alaṅkāra known as luptopamāthat is subclassified into 19 different varieties in kp. we also aim to analyse the phenomena called camatkr . ti i.e., the poetic astonishment by analysing these dependency structures.