An Algorithmic Approach to Analyzing Rhetorical Structures (2024)

Abstract: Although diagrams are fundamental to Rhetorical Structure Theory, their interpretation has received little in-depth exploration. This paper presents an algorithmic approach to accessing the meaning of these diagrams. Three algorithms are presented. The first of these, called reenactment, recreates the abstract process whereby structures are created, following the dynamic of coherence development, starting from simple relational propositions, and combing these to form complex expressions which are in turn integrated to define the comprehensive discourse organization. The second algorithm, called composition, implements Marcu’s strong nuclearity assumption. It uses a simple inference mechanism to demonstrate the reducibility of complex structures to simple relational propositions. The third algorithm, called compress, picks up where Marcu’s assumption leaves off, providing a generalized fully scalable procedure for progressive reduction of relational propositions to their simplest accessible forms. These inferred reductions may then be recycled to produce RST diagrams of abridged texts. The algorithms described here are useful in positioning computational descriptions of rhetorical structures as discursive processes, allowing researchers to go beyond static diagrams and look into their formative and interpretative significance.

## introduction it has been shown that rhetorical structures and relational propositions are interchangeable @xcite . the structure of an rst diagram can be restated as a relational proposition and relational propositions can be returned to rst diagrams. relational propositions, as defined by @xcite @xcite , are implicit assertions arising between clauses within a text and are essential to the functioning of the text. they can be considered as an alter ego of rst relations, with each assertion consisting of a predicate (or relation) and two variables (representing a satellite and nucleus). because the predicate notation developed for relational propositions is python conformant @xcite , mapping rst diagrams to relational propositions opens the possibility of exploring rhetorical structures algorithmically, presenting a range of analytic possibilities. the immediate effect of rendering rst diagrams as code is to unlock the picture: if, as the saying goes, a picture is worth a thousand words, the diagram now becomes a movie. it is a story about what is happening in a text. the objective of the research described in this paper was to investigate some of these possibilities. three algorithms are presented, each addressing a distinct aspect of rhetorical structure theory. the first of these is called reenactment. this algorithm replays the abstract process of structure formation, demonstrating the step-by-step construction of discourse formation starting with elementary relational propositions, and combining these to form complex expressions which are in turn integrated to define the comprehensive discourse organization. the second algorithm, referred to as the composition algorithm, implements marcu's strong nuclearity assumption and demonstrates the reducibility of complex structures to simple relational propositions. the third algorithm, called compression, picks up where marcu leaves off, providing a generalized scalable method for progressive reduction of relational propositions down to their simplest possible forms. these algorithms provide the opportunity for a direct and deep look into information implicit in rst diagrams. a benefit of this is that it should set aside any notion that rst diagrams are incapable of articulating in-depth aspects of discursive development, or that they are merely static specifications @xcite . on the contrary, although rst is only a partial explanation of discourse coherence, the part it plays is an important one. if we can restate rst diagrams in computational terms and allow these terms to describe what a diagram is doing, then perhaps we can begin to enjoy a deeper appreciation for what they are telling us about the text, and that these diagrams, far from static depictions of discourse structure, are actually renderings of a dynamic process, showing how a discourse germinates from its elementary units to become a whole that is greater than its parts. ## framework the interlocking property of rhetorical structures, where a satellite's support for a nucleus creates a span which in turn becomes the satellite for yet another nucleus, suggests that the typical rhetorical relation is rhetorically transitive, with the consequence that their intended effects develop cumulatively across complex structures, ultimately converging on an identifiable locus of effect. this abstract process is an assumption of the research described here; otherwise, the algorithms would fail to achieve produce their expected results. potter's (2023a) algorithm for transforming rst analyses into relational propositions is used to provide the input for this framework. throughout this process, these propositions maintain their structural isomorphism with rst diagrams. marcu's strong nuclearity assumption, also known as the strong compositionality criterion, says that when two complex text spans are connected through a rhetorical relation, the same rhetorical relation holds between the nuclei of the constituent spans @xcite . this means that from relations between spans, simple structures may be inferred. the algorithmic implementation of this supports its application to rst analyses of any size. the reenactment algorithm implements a bottom-up perspective on rst structures by enacting the dynamic process of structure development, starting with elementary relational propositions, and combining these to form a complex expression ultimately of the comprehensive discourse organization. the compression algorithm implements a technique previously proposed by @xcite . as a generalization of strong nuclearity, it progressively eliminates the precedent satellite within the rst nuclear path to reduce the relational proposition to its simplest possible expression. the technique specifies delimited transitivity for handling multinuclears and unrealized relations. taken together the three algorithms provide a foundational set of capabilities for analyzing rhetorical structures and exploring various features of the theory, such as inference, transitivity, reducibility, intentionality, and structural dynamics. in short, the algorithms can be used for investigating a range of discourse characteristics following a well-defined algorithmic approach. these algorithms are neither large nor complex. they are of interest more for what they do rather than for how they do it. what they do is offer insights into the nature of discourse. how they do this is largely reliant on the representation of rst structures as pythonic relational propositions. i believe their simplicity is a by-product of the alignment of the theory with the discursive organizations it describes. ## related work while the literature on rhetorical structure theory is vast, only a rather narrow strand of that research is relevant to this study. this naturally encompasses the founding rst documents, including but not limited to @xcite and @xcite . these publications define rhetorical structure theory (rst) as a descriptive theory of text organization, as a tool for describing and characterizing texts in terms of the relations that hold among the clauses within a text. a detailed exemplification of the theory can be found in @xcite analysis of a fund-raising text. @xcite provide an in-depth discussion of the theoretical foundations of rst. of continuing research interest in rst has been the possibility that it could be used as a text summarization technology. most prominent in this area has been the works of @xcite @xcite @xcite . there has also been ongoing work in extending and refining the rst relation set. generally this has been aimed at enhancing the ability of parsers to correctly identify relations while at the same time increasing the specificity of relations @xcite . other research has been aimed at enriching the theory. in particular, marcu is known for articulating the aforementioned strong nuclearity assumption. @xcite explored the problems of nuclearity. in his investigation of different types of salience phenomena, he found that nuclearity as defined in rst tends to conflate information from different realms of description within a single structure. he proposed a multilevel analysis approach that would reconcile these issues. a variety of formalisms have been developed that would address limitations in rst (e.g., @xcite @xcite . an assumption made for this paper is that the theory and practice of rst is sufficiently well developed as to produce useful and interesting analyses. in a parallel but lesser-known universe is the theory of relational propositions. this theory is an antecedent to the conceptualization of rst. with relational propositions, relations between satellites and nuclei are treated as implicit coherenceproducing assertions @xcite . a relational proposition consists of a predicate and a pair of arguments. the predicate corresponds to the rst relation, and the arguments correspond to its satellite and nucleus. a shortcoming in the early work in relational propositions was its limitation to elementary expressions. there were no provisions for complex structures. @xcite attempted to address this but without success. that leaves off where this research begins. @xcite devised a functional notation to support representation of complex relational propositions. the original objective was to develop a deductive interpretation of rst, one that would support investigation of logical operations such as transitive implication in discourse. that work provided an initial proof of concept for the algorithms described in this paper. however, rather than rely on propositional logic, the discourse features of interest were accessed directly. this was expedited by using potter's (2023a) program for mapping of rst diagrams to relational propositions. automating this step enables scalability, reduces the likelihood of error, and eliminates a lot of tedium. because the notation used for these relational propositions is conformant with the python programming language, the algorithm effectively converts a diagram into machine processable code. an rst analysis like the arithmetic analysis shown in figure 1 can be automatically converted to its relational proposition: these encoded relational propositions are the drivers for the algorithms described here. each relation has a corresponding function within the condition(2,1) concession(7,6) condition(5,concession(7,6)) antithesis(4,3) evidence(condition(5,concession(7,6)),antithesis(4,3)) concession(condition(2,1),evidence(condition(5,concession(7,6)),antithesis(4,3))) ## algorithmic analyses of rhetorical structures as introduced earlier, this paper describes three algorithms for analyzing rhetorical structures. reenactment models the bottom-up production of discourse organization. composition implements @xcite strong nuclearity. and compression leverages the asymmetry of rst relations to implement transitive inference directly into relational propositions. each of these algorithms uses pythonized relational propositions as input. for each algorithm there is a set of functions called relation handlers, one handler per relation. typically, these functions return a tuple-formatted relational proposition, i.e., the name of the relation and a nested tuple containing satellite and nucleus identifiers, including the relation names and tuple information for any relational propositions nested within them. at runtime the handlers are invoked in order of precedence as specified by the relational proposition. each algorithm defines a collector function that manages the values returned by the relation handlers. the output consists of one or more relational propositions, constituting the reenactments, inferences, or compressions as determined by the algorithm. input to each algorithm starts with rst analyses created using rsttool or rst-web (o'donnell, 1997; zeldes, 2016). these analyses are transformed into relational propositions using potter's (2023a) conversion tool. the relational propositions are then input to the algorithms which transform them into reenacted, inferred, or compressed relational propositions. these relational propositions may be analyzed as is, or they may be used to construct new rst analyses. the following sections provide detailed descriptions of the algorithms and their applications. foot_0 ## how it works the algorithms described here all share a common design. each consists of two parts: a set of relation handlers and a core algorithm. a handler is provided for each relation in the rst relation set. these handlers are functions evaluated in response to each occurrence of their corresponding relation in a relational proposition. they are simple oneliners. each handler returns a tuple containing the function's name and a nested tuple containing its satellite and nuclear identifiers. the functions obtain their names at runtime using a system call. thus, in the reenactment and composition algorithms, an occurrence of the relational proposition concession(1,2) will return the tuple: ('concession',(1,2)), and an occurrence of the relational proposition evidence(3, concession(1,2)) will return the tuple: when a relational proposition is evaluated, each handler is called in precedence order, with each function returning its name and arguments to the calling function. in this way, the program essentially performs the relational proposition, starting with the innermost (hence higher precedence) functions, working outward to the edges of the expression. the reenactment algorithm exploits that process. the compress algorithm is only slightly more complicated. each of its relation handlers makes a call to the core compression algorithm, passing it its relation name and arguments. special handling for nonreducible relations is specified syntactically in the handler functions. the evaluation of the relational proposition shown at the top of figure 7 invokes each of the cited relation handlers and each of these call the compress function, first circumstance, followed by volitional_result, antithesis, concession, evidence, and finally the outermost relation, background. this leaves little for the core algorithm to do. since multinuclears are non-compressible, the algorithm simply formats them and returns the formatted expression. for compressible relations, the algorithm simply replaces the current relational proposition with its nucleus, thus for each step eliminating the relation and satellite. functionally, it infers the nucleus from the relational proposition. this is consistent with marcu's strong nuclearity assumption. because this process is implicit within the relational proposition, we can say it is also implicit within the rst diagram from which the proposition is derived, and therefore inferable from within the text itself. figure 7 shows the complete code for the compress algorithm. for space reasons, the list of relation handlers has been limited to what is required for the example. ## conclusion an rst analysis can be understood as an explanation of the organizational composition of a text. by identifying the text structure, by showing how its elements come together, an rst analysis explains how the text accomplishes what it is intended to do. the algorithms described in this paper contribute to that explanation. reenactment is a step-by-step articulation of coherence development. the composition algorithm identifies relational propositions implicit within the text. the compress algorithm performs a deconstruction of the structure from its totality down to its intentional essence. these algorithms show that rhetorical structures can be studied in terms of their relational propositions. the relational propositions generated by the algorithms are inferences which follow directly from the source rhetorical structure. for each inference there is an isomorphic rst analysis and a corresponding text, that is, a structure within the structure and a text within the text. thus, these simple algorithms provide interpretations of rhetorical structures as discursive processes, enabling the analyst to move beyond static diagrams and study formative and interpretative features of rhetorical structure. by positioning the algorithms within the framework of relational propositions, considerable simplicity is achieved. the algorithms extend the scope of rst as a tool for explaining discourse organization. input relational proposition relation handlers core algorithm compression output