TAILORED TEXT GENERATION

Abstract: A method and apparatus are described for generating prose text which is specific to a particular application. The method features the steps of inputting a text stream (14) containing at least one fixed prose phrase (16) and at least one directed prose expression (16a), and parsing the text stream (14) for copying each fixed prose phrase (16) and for replacing each directed prose expression (16a) with a prose construction (20) by referencing a data base (22). The method further includes the step of generating a prose output (28) by combining each fixed prose phrase (16) and prose construction (20) to form a stream of prose text.

Description: TAILORED TEXT GENERATION Background of the Invention This invention relates generally to expert systems and in particular to methods and apparatus which repeatedly perform a planning, reasoning, computation, or decision activity in many different situations and generate a natural prose text result that is highly customized to the situation, linguistically fluent, and appropriate. Many applications of so-called "expert systems" technology have a need to produce natural prose explanations of their "reasoning." Typically, such systems merely generate a record of the sequence of rules that were applied in reaching a conclusion, using a prestored natural language description of each rule. However, in many situations, such a record of the steps by which a conclusion was reached is not a suitable explanation for the end client. For example, in a report received from a financial advisor, the end client is usually interested in the reasons why a given recommendation is good for his financial situation and an explanation of the principles that justify its applicability to his or her situation. This report may be substantially different from a record of the deductive steps by which the financial "expert system" reached the conclusion(s) . A mechanism is thus required that is capable of generating an explanation that is sensitive to the interests and needs of the end client, that takes into account his or her level of experience and sophistication, and that addresses directly any background explanations necessary to explain terminology, introduce concepts, motivate the conclusions, etc. These are the kinds of issues a good writer takes into account and provides for in a document written for a specific audience. Research in natural language processing by computer is currently being pursued in a number of universities and research laboratories that, it is hoped, will enable computers to construct such explanations from deep principles of linguistics and cognitive science. However, today's technology for generating natural language prose is primitive and inadequate for the job of producing high quality descriptions. Such systems have only a rudimentary coverage of English grammar, and even less competence in rhetorical style. A computer system based on this technology, as it exists today, would make many obvious linguistic mistakes. For many applications, such as generating a recommendation for a program of investment by a bank, any errors in basic syntax and exposition would reflect negatively on the whole endeavor. On the other hand, many systems exist fo generating form letters and similar documents, specialized to an individual addressee, by the insertion of the person's name and possibly some other attributes at specified points in the document, the rest of which is copied verbatim from a source template. However, this technology is so primitive that the result is transparently a form letter. Thus, by itself, the technology to insert a text element from a data base into a slot in a text format is insufficient for generating a high quality description of a complex situation that can result from a complex analysis of a situation. Report generating systems do a better job of producing a readable view of a complex situation, but do so primarily through the creation of tables and graphs that present some portion of a data base or some computations such as totals and subtotals that are derived from the data base. They do not have the capacity to construct natural language descriptions of complex chains of reasoning. Many systems also allow the incorporation of boilerplate text from a library of text passages by specifying an identifier for the piece of text to be inserted. There are also many document formatting languages that allow embedded commands for formatting text in various ways such as underlining, centering, indenting, etc. Some of these systems allow the conditional insertion of a block of text depending on the setting of a selected variable in the context. In summary, none of the existing document formatting, mail merge, or report generating systems provide a capability for the generation of fluent natural language text that is both highly specific to an individual situation and linguistically fluent. Further, the state of the art in natural language generation from first principles is not adequate to produce the high quality output desired for many applications . . It is therefore a primary object of the invention to provide a method and apparatus for generating fluent natural language prose text that can be both highly specific to an individual situation and linguistically fluent. Other objects of the invention are a natural language generation process capable of providing a description of conclusions reached from a complex analysis of a situation, and for providing a linguistically fluent prose text directed to a specific user and adapted to a specific situation or context. Another object of the invention is a method and apparatus which provides sufficient flexibility and readability for enabling complex text to be generically created for a variety of complex and specific applications. Summary of the Invention The invention relates to a method and apparatus for generating prose text and, in particular, text which is specific to a particular application and end user. The method features the steps of inputting a text fragment from a text stream, the text fragment containing at least one (embedded) directed prose expression which can be adjacent one or more fixed prose phrases. The directed prose expression has an expression identifier, an expression operator, and a command body. The method further features parsing the input text fragment for copying each fixed prose phrase and for replacing each directed prose expression, the parsing step featuring recognizing each directed prose expression using the expression identifier, decoding the expression operator for the identified expression, and operating upon the command body in response to the decoded expression operator for generating a prose construction to replace the directed prose expression. The invention is thus directed to a system for producing high quality text that is tailored both to the results of a potentially complex analysis of an individual situation and to a specific intended audience. The method and apparatus of the invention permit a human author to design and specify a schematic text that is conditionalized and parameterized by aspects of a specific situation, and which can produce text that may vary substantially from case to case. Such variability can include specific observations and recommendations to make, as well as decisions about the detailed structure of individual observations and recommendations. For example, in a financial analysis system, the analysis can conclude that there are five assets that a client should reposition, each for a different reason. The author of the output text may want to provide for an introductory statement introducing the general subject of repositioning and initially mentioning the recommendations only at an aggregate level of how many recommendations are being made. At a later point, he would enumerate the individual recommendations and present the motivations for each recommendation. The invention provides such a text author with a set of directed prose expressions that can be incorporated into and between fixed prose text, the effect of which is to construct an appropriate prose text to match the specific situation at the time tne directed prose expressions are executed. The prose expressions can be compiled, similar to a programming language, for constructing highly tailored texts that adapt themselves, according to the operation being performed, to individual situations. The directed prose expressions include operators for iterating over objects from a data base of entities and generating descriptions of them, for inserting elements of "text" from a text library (which may itself contain embedded or directed prose expressions), for constructing elements of text by composition of smaller elements (which again may themselves contain embedded or directed prose expressions), and for inserting elements that are obtained or computed from a data base. The operators also allow the author to construct natural language descriptions of observations and proposed actions and describe the reasons for a conclusion. The operators can further initiate reasoning activities in the data base to draw conclusions that are required for the text but are not yet present in the data base. The operators can also construct elements of text ranging in size from the composition of entire documents to the construction of individual sentences or individual words. In generating such text, many technical linguistic decisions must be made in addition to achieving the correct overall flow of ideas. For example, a text directed to financial planning may need to adapt to whether a client is married, whether there are children and how many, whether the client is a male or female, what the first names of the children are, and many other details that typically vary from one situation to another. These distinctions show up in the choice of pronouns, whether to pluralize certain nominal references, and the choice of_ the correct verb form to match the subject of a sentence. For example, an automated financial planning analysis may have concluded that a client should invest some assets in tax free municipal bonds, and may be required to explain that the client should purchase bonds of municipalities in the state in which he lives in order to avoid state taxes as well as federal taxes. The desired text can read as follows: "I recommend that you invest $10,000 in a stock mutual fund and $10,000 in fixed income asset such as bonds. The stock fund provides an opportunity for appreciation, while the bond fund minimizes the overall risk. I would recommend tax free municipal bonds in your case because they are currently paying 9%, which is the equivalent of a taxable investment paying 18% in your tax bracket (49%). Since you reside in Massachusetts, you should invest in Massachusetts municipal bonds to avoid state taxes as well as federal taxes." This explanation is constructed, according to the invention, by composing two different recommendation "objects" — one object for a stock fund and the other object for municipal bonds, both in the amount of $10,000. The dollar amounts, in this case, might be retrieved from the recommendation objects in the data base, the amounts having been previously determined and stored in the data base. The second sentence is a standard explanation of the motivation for diversifying between stock and fixed income investments and is inserted here because of the presence of a corresponding reasoning step leading to the recommendations. (Absent the "corresponding reasoning step," the second sentence would not appear.) The third sentence is generated by a record of a reasoning step that concluded that tax free municipals are advantageous when their effective after tax return based on the client's marginal tax rate is greater than available returns from taxable investments of comparable risk. The fourth sentence is dictated by a directed prose expression having a conditional operator that is sensitive to the residence of the client and the locations of available municipal bonds. Brief Description of the Drawings Other objects, features, and advantages of the invention will appear from the following description of a preferred embodiment taken together with the drawings in which: Figure 1 is a schematic block diagram of apparatus for carrying out the method of the invention; Figure 2 is a schematic representation of the operation of an apparatus in accordance with the illustrated embodiment of the invention; and Figure 3 is a detailed flow chart outlining the method of the illustrated embodiment of the invention. Description of a Preferred Embodiment Referring to Fig. 1, a computed text document is generated during the analysis of input data by the expert system, and typically is generated at the end of the analysis. According to the invention, the apparatus has available to it a schematic text fragment 10. This text fragment is read or scanned by a procedure for inputting text fragments to the system over a line 10a to a data processor 10b. According to the inputting method, fixed prose phrases, that is text material which will not be altered (noncommand text material), are transferred to an open output stream over lines 10c to a display device lOd such as a cathode ray tube or a printer or for storage. Portions of the text fragment which are directed prose expressions are detected and invoke embedded commands. In the preferred embodiment of the invention, the directed prose expressions are signaled by a distinguishing escape character or expression identifier (" " in the illustrated embodiment), that signals or marks the beginning of the expression. Delimiters are used to separate the command body (any additional parameters or text used by the command) from the remaining text. Directed prose expressions can invoke procedures that return text to be transferred to the output stream, transfer text directly to the output stream, or return further schematic text fragment(s) which themselves are to be scanned for direct prose expressions. The process can be nested, recursively, to arbitrary depths, so that the operation upon a directed prose expression can result in a schematic text fragment, which can itself contain directed prose expressions which can generate schematic text fragments, which contain directed prose expressions that refer to data base records which can contain references to schematic text fragments, and so on. Some expression operators can make reference to entries in a data base (or a knowledge base) of static or dynamic information, which entries may themselves contain references to schematic text fragments containing further directed prose expressions, etc. Referring to Fig. 2, at step 12, the analysis process initiates a procedure for generating a text document. The text document is generated from a schematic text fragment 14. The schematic text fragment contains fixed prose phrases in an adjacent relationship with directed prose expressions (represented as small boxes 16). The directed prose expressions invoke computations that can include recursive calls to computed text invocations. In the illustrated embodiment, the first directed prose expression 16a refers to and accesses a portion 20 of a data base 22 which contains, for example, a reference to a schematic text fragment 24 which invokes another schematic text fragment 26, and which in turn contains an -operator that triggers a computation specified by an executable procedure 28. Referring to Fig. 3, when the text generation procedure 12 is invoked, it repeatedly scans the input text file, at 30, looking for the end of the file. If the end is found, the text output terminates, at 32. If the end of the file is not found, the next character is read, at 34, and is checked, at 36, for an expression identifier or escape character that signals, in the illustrated embodiment, a directed prose expression. Each time a directed prose expression is found in the text, the operator is read at 37 and the command body is read at 38. The command expression operator is then looked up at 39 and decoded in a dispatch table 40 to determine the code needed to be executed to evaluate, at 42, the arguments of the command. That code is then executed at 44. The code can use parameters and other schematic text fragments from the input text fragment, leaving the scanning pointer at the end of the body of that directed prose expression so that when execution of the command is completed, scanning can begin at that point for subsequent text to be output and subsequent directed prose expressions. At this point, processing loops back to step 30. When a further directed prose expression is not detected in step 36, the character of text of the schematic text fragment is written in the output stream, at 45, and the process loops back to the end-of-file test at 30. The format of a directed prose expression consists of an expression identifier or escape character (the symbol @ in this illustrated embodiment), followed by an expression operator identifier, optionally followed by a command body enclosed in parentheses or brackets. Each expression operator has an associated code definition which knows the format of the command body for the operator and knows how to access and interpret that command body as it is received from the input stream. The set of expression operators is open ended, so that new operators can be defined and added to the system. According to the illustrated embodiment, an initial set of operators includes: A. @obs(<retrieval key> <secondary sort attribute>) This operator retrieves each of a set of observations from a data base record of the observations made by a reasoning system and for each such observation accesses an associated schematic text fragment characterizing how to generate a natural language expression of that observation. The "retrieval key" specifies a retrieval index for a specific class of observations to be accessed. The secondary sort attribute, if present, is the name of an attribute that each retrieved instance is expected to have, and will be used to sort the observations into a preferred order for presentation to the end user. For example, @obs(TaxSituation Importance) would access all of the observations dealing with a client's tax situation and would generate a text version of each one by accessing schematic text fragments from the data base record of that observation. The resulting observations would be generated and presented in order of importance. For example, each observation record can have a text generation field that will contain the text schema to be used to generate its output description. (In a knowledge based system with inheritance, this field may be inherited from a more general class definition, instead of being stored separately for each observation record.) Each such retrieved text schema will be given to the text generator in an environment in which directed prose expressions will be able to access other fields of that observation record to obtain additional parameters to be used in constructing the observation text. B. @rec(<retrieval key> <secondary sort attribute>) This operator is similar to the §obs operator, but accesses a set of recommendation objects associated with the specified "retrieval key" and generates text renditions of those recommendations in the same way that §obs generates text renditions of observations. C. @get(<access path>) This operator will retrieve the value at the end of the access path. The value can be used as a parameter to some procedure, or as a text element to be incorporated into the generated text output. The access path consists of a sequence of attribute or field names beginning from some root in the current context. For example, @get(FirstName ClientSpouse) would get the first name of the client's spouse in a given case. D. §pick(<object> <condition/value list>*) This operator has an "object" in its command body followed by an arbitrary number of condition/value lists that specify different results under different conditions. The object determines a focused element about which different conditions will be tested. Each condition/value list consists of a conditional operator (e.g., equality), some parameters for that conditional operator, and a result to be returned if that conditional operator, applied to the initial object and the associated parameters, is satisfied. For example, the condition/value list (EQ MALE "his") specifies that if the "object" is equal to the flag MALE, then the resulting string will be "his". Formats for condition/value lists can include: (EQ <reference object> <result>) (MEMB <list of reference objects> <result>) (LIST <result>) (IF <condition> <result>) (ELSE <result>) The first argument to. PICK, the "object," can be a variable name or a form to be evaluated. The remaining arguments, the condition lists, are clauses specifying different values depending on the condition being tested. The first element in each clause specifies the condition being tested; the second element generally specifies what that condition is operating on; and the remaining element (in this case usually a string of characters or another schematic text fragment) is the value to be returned if the condition is true. Thus, each condition/value list consists of a conditional operator (EQ, MEMB, LIST, IF, and ELSE), possibly followed by parameters for that operator (all except the LIST and ELSE cases), followed by a result to be used if that operator, applied to the initial focused element and those parameters, is satisfied. The conditions can involve equality of the focused element to the value of an expression (EQ), membership of the focused element in a list (MEMB) , whether the focused object is a list (LIST), and arbitrary computational tests (IF). The ELSE clause, which should always occur as the last conditional clause, if present, indicates what to do when none of the previous conditional tests is satisfied. A register in the apparatus stores a computed text variable which is bound to the focused element (effectively, the "object") of the pick command before the clauses are tested; this register value can be accessed within the case clauses by use of an @pickval() form. Note that the result of a condition/value list can consist of a schematic text fragment which can in turn contain embedded commands. The method can also require computational tests to be effected to determine whether a condition is satisfied. The format for a PICK expression is illustrated by the following somewhat artificial example (comparable to an IF-THEN-ELSE format): §PICK(X (EQ MALE "his") (MEMB (F FEMALE) "her") (IF (GREATERP X 1) "their") (ELSE (ERROR "UNEXPECTED VALUE" X))) In this example, if the value of the variable "X" is "MALE," the value of the PICK expression will be "his"; if the value is either "F" or "FEMALE" (that is, a member of the list (F FEMALE)) then the PICK expression returns "her"; if the value of "X" is greater than 1 then the PICK expression returns "their"; and if none of the clauses preceding the ELSE clause is true, the function ERROR is called to indicate that there is an error in the value of "X." An example of the use of a PICK expression would be: "Your spouse's IRA contribution is limited to the amount of @PICK(ClientSex (EQ M "her")(EQ F "his") (ELSE (ERROR "ClientSex" ) ) ) income." The PICK operator is a very powerful operator that can be used to define more specialized operators to be added to the operator inventory. E. @lib(<identifier>) This is an operator that retrieves a schematic text fragment from a library of text fragments. The identifier is the name of the text fragment to be retrieved, and the "lib" operator results in that fragment of text being scanned by the text generator as if it had occurred in the body of the text being scanned. F. @his/her(<sex flag>) This is an operator that generates a personal pronoun "his" or "her", depending on whether the given sex flag is male or female. G. §plural(<reference> <word> <plural form>) This operator generates the singular or plural form of a word depending on whether the indicated reference is to a single object or a list of objects. The indicated plural form of the word, if specified, is to be used for the plural form, while the specified word is used for the singular. If the word is pluralized by simply adding an "s," or if the plural form is known from a dictionary or a regular morphological rule, then the explicit plural form can be omitted from the body of the command. The first argument to the plural operator can return a number (in which case the word will be pluralized if the number is greater than 1), a list (in which case the word will be pluralized if the length of the list is greater than 1), or a predicate value such as "T" (in which case the word will be pluralized depending on whether that value is true or false) . H. §plural-poss(<reference> <word> <plural form>) This operator is similar to the plural operator and takes arguments in exactly the same form and produces a possessive form of the word in either the singular or plural as appropriate (e.g., "child's" or "children's") . An example of the use of the plural and plural- poss operators would be: "Your @plural(Clien IRAs IRA) will shelter @plural-poss(ClientIRAs it) income from federal taxes. " This text fragment will produce either "Your IRAs will shelter their income..." or "Your IRA will shelter its income..." depending on whether the list "ClientlRAs" has more than one element. I. @with(<access form> <text body>) This operation provides for iterative generation of text forms. The access form (which can be any computed text) is evaluated. If it returns a list, the text body is scanned in accordance with the invention, once for each element of the iteration list, and all resulting text is inserted into the output stream. A computed text variable, in effect operating as a pointer, is bound to the current element of the iteration list before the text body is evaluated. It can be accessed within and, in effect, by the text body for inserting references to the iteration element in the resulting text stream, by use of an operator, @withval(). (This operator accesses the variable of iteration in the most immediate dominating ©with or @join expression. ) J. §tag(<tag name> <tag value form>) This operator provides for generalized variables in computed text. If a tag value form is specified, it is assigned to and can subsequently be retrieved by the tag name. If no tag value form is specified, the variable value of the tag name is retrieved. K. @incase(<case identifier> <text body>) All knowledge base access forms occur in the context of a specific case; and the INCASE operator can change the case using this form of command. The text body is a schematic text fragment, that can contain embedded operators, and which is then processed for the case specified by the case identifier. L. @conj(<access form> <conjunction word>) This operator allows the formation of conjunctions. The access form is assumed to be a list, which may have only a single element. The conjunction word is either "and" or "or." The result is a linguistic conjunction of the elements returned by the access form using the specified conjunction. If there are more than two elements, commas are used in the form: "a, b, and c." If there is only one element in the list, the result is that element alone. M. @verb(<subject access form> <plural subject verb> <singular subject verb>) This operator generates an inflected form of a verb to match the subject in a sentence (for example, "the planes fly" or "the plane flies"). If the subject access form returns a list with more than one element, then the plural subject verb form is used, otherwise the singular subject verb form is used. N. §join(<access form> <join word> <clause text body>) This operator is a generalization of §conj() . The access form is assumed to be a list. The join word is typically either "and" or ,r or." The clause text body is a text fragment. The clause text body is evaluated once for each element of the list returned by the access form. The computed text pseudo-variable @withval() can be used inside the clause text body. Note that §conj (@get(<some fact>)and) can be written as @join(@get(<some fact>)and @withval( ) ) . 0. @dot(<text body>) This operator treats text as a dot point. It sets up the correct margins and places a bullet in front of the text. P. @$(<access form>) This operator formats the result of an access (assumed to be a number) as a dollar amount. Q. @%(<access form> <decimal places>) This operator adds proper percentage value formatting to the result of an access (assumed to be a number) which is first rounded to the specified number of decimal places to the right of the decimal point. R. §exhibit(<exhibit name>) This operator includes the named exhibit in the text body. S. @graph(<graph name>) This operator includes the named graph in the text body. T. §cr() This operator generates a carriage return or end of line. U. @instancesof(<class name>) This operator returns a list of the instances (members) of the indicated class. Examples 1. "Nested command structure" The Original Text Phrase: "Your @LIB(spousePhrase) is well covered in case of your accidental death." where the Library Text Phrase for "spousePhrase" is: @PICK(@GET(sex Spouse) (EQ FEMALE wife @GET(firstName Spouse)) (EQ MALE husband @GET(firstName Spouse))) results in: "Your wife Joan is well covered in case of your accidental death." where the knowledge base values specify "Spouse" with a value of "FEMALE" for "sex", and a value of "Joan" for the "firstName." Nesting of the command is shown in several ways: a. The text in the @LIB is nested in the original text phrase; b. The §GET(sex Spouse) is nested within the @PICK form and is used for its contents in the resulting text; and c. The §GET(firstName Spouse) is nested within the @PICK form and used for its contents in the resulting text. 2. "Invoking a reasoning process in the command body": Any knowledge base value that is retrieved may cause a reasoning process to occur. Thus the text phraser §INCASE(HypotheticalCase §GET(net ssetValue Client) ) could initiate the calculation of the aggregation of all assets of the client in a hypothetical case, where reasoning is necessary to determine which assets are to be retained in the hypothetical case, relative to a current context. 3. "Recursively invoking computational procedures" and "Operators for invoking iterative generation of text fragments": Any text phrase can refer to others, even to itself. Consider the Original Text Phrase: @WITH(§GET(listValue)@LIB(ListSummary) ) Assume that the following phrase is held in a library entry known as "ListSummary, " with the purpose of summarizing all elements held in a complex list of data, ignoring its fine structure: @PICK(@WITHVAL( ) (LIST @WITH(@WITHVAL( )@LIB( istSummary) ) ) (ELSE Entry: §WITHVAL( )@CR( ) ) IF the @GET(listValue) was the list (First(Second Third) (Fourth (Fifth Sixth))); the original text phrase would produce the following results: Entry:First Entry:Second Entry:Third Entry:Fourth Entry:Fifth Entry:Sixth The following chart illustrates how the recursion through the data structure occurs. The @WITHVAL() form allows reference to the current element of iteration within the set being iterated across in the @WITH( ) form. Each time an @WITH is called, any old value of iteration is saved and a new one created local in scope to the current iteration. Depth of Text Produced Recursion How Produced 1. "Entry:First" Produced from the first reference to the library phrase under the original text form. The ELSE clause of the pick was used since the first element of iteration was not a list. 2. "Entry:Second" From a recursive call on the library entry. Since the second element of iteration was a list, the first PICK clause was evaluated, which caused a recursive call to the library entry underneath a new iteration form. Within the recursive call, the first element is not a list, so the ELSE clause of the pick was vised to produce the output text. 3. "Entry:Third" From a recursive call on the library entry, as with the previous case. 4. "Entry:Fourth" From another recursive call under the first use of iteration within the PICK clause. 5. "Entry:Fifth" A recursive call underneath a recursive call. The element of iteration was again a list, and caused a recursive call to the library text entry. 6. "Entry:Sixth" Underneath the same iteration form as the previous case. "Generating successive text fragments in association with successive elements from a database" : There are two options: using the iteration form or using special knowledge base forms that imply iteration: First case: ©WITH(dlNSTANCESOF(FinancialAction Recommendation)§GE (recommended Action) ) would produce a text fragment for each instance of FinancialActionRecommendation in the knowledge base. Second case: §OBS(taxObservation) would iteratively produce a text fragment for each observation in the knowledge base that is marked as being a taxObservation. The iteration is implicit in the internal definition of the §OBS() operator. Conclusion This invention thus provides a clean and comprehensible interface between the reasoning of a knowledge based system and a system that produces high quality, highly tailored output text characterizing the result of the reasoning. Such reasoning can include observations that result from an analysis of a situation and recommendations that are reached as a result of that analysis. It is a practical compromise between full natural language generation from first principles, on the one hand, and simple "canned" text with direct inclusions from a data base on the other. This invention can be used in a variety of situations where high quality prose text is to be generated from a complex situation described in a data base. For example, it can be used to produce customized versions of maintenance manuals, instruction manuals, legal instruments, operating procedures, etc. Although specific operators and syntactic conventions are described herein, the invention is intended to cover a diversity of different syntactic representations of the same kinds of operations. Further, although the invention is presented here as an interpreter that executes the commands as the text is generated, the schematic text fragments can also be compiled into procedures that more efficiently generate the corresponding text at run time. Although the illustrated embodiment of this invention is in English, the same method can be applied to other languages. For more highly inflected languages such as French, German, or Italian, the method would make use of additional or expanded forms of operators for choosing inflected forms of nouns and verbs as in English. In general, an operator ©inflect(<gender> <number> <word> <inflectional paradigm>) would produce the appropriate inflected form of the indicated word (noun, verb, or adjective), using the indicated inflectional paradigm (which may be accessed from a dictionary, if known) . Additions, subtractions, deletions, and other modifications of the disclosed embodiment of the invention, including a compiled form of the method and apparatus, will be apparent to those practiced in the art and are within the scope of the following claims.

Claims: What is claimed is: 1. A method for generating prose text comprising the steps of inputting a text fragment, said text fragment containing at least one directed prose expression and optionally at least one fixed prose phrase, said expression having an expression identifier, an expression operator, and a command body, outputting an expanded text stream, said expanded text stream containing only prose text, parsing said input text fragment for copying each said fixed prose phase to said expanded text stream and for replacing each said directed prose expression for inclusion in said expanded text stream, said parsing step comprising the steps of recognizing each directed prose expression from said expression identifier, decoding the expression operator for an expression, and operating, in response to said decoded expression operator, upon said command body, for generating a prose text construction to replace the directed prose expression. 2. The method of claim 1 further comprising the step of providing a plurality of expression operators, each operator having associated therewith a selected format for its associated command body. 3. The method of claim 2 wherein said operators include a subset of "obs," "rec," "get," "pick," "his/ her," "lib," "plural," "plural-poss, " "with," "tag," "incase," "conj," "verb," "join," "dot," "$," "%," "cr," "exhibit," "graph," and "instancesof." 4. The method of claim 2 further .comprising the step of including relational operations in said command body. 5. The method of claim 2 further comprising the step of. including nested directed prose expressions in said command body. 6. The method of claim 5 further comprising the steps of including in said command body a nested directed expression for outputting a prose characterization of observations resulting from a knowledge based analysis of a situation. 7. The method of claim 5 further comprising the step of including in said command body a nested directed expression for outputting a prose characterization of recommendations resulting from a knowledge based analysis of a situation. 8. The method of claim 2 further comprising providing operators for choosing appropriate pronouns in a generated prose text. 9. The method of claim 2 further comprising the step of providing operators for choosing appropriate plural forms of words in a generated prose text. 10. The method of claim 2 further comprising the step of providing operators for choosing appropriate inflected forms of nouns in a generated prose text. 11. The method of claim 2 further comprising the step of providing operators for choosing appropriate inflected forms of verbs for a generated prose text. 12. The method of claim 2 further comprising the step of providing operators for choosing appropriate inflected forms of adjectives in a generated prose text. 13. The method of claim 2 further comprising the step of providing operators having a conditional "IF-THEN-ELSE" command body for selecting a generated prose text. 14. The method of claim 2 further comprising the step of providing operators having a computational testing of conditions for determining a generated prose text. 15. The method of claim 2 further comprising the step of providing operators for invoking a reasoning process in the command body for determining a generated prose text. 16. The method of claim 2 further comprising the step of providing operators having a command body for recursively invoking computational procedures for generating partial prose text and other schematic text fragments. 17. The method of claim 2 further comprising the step of providing operators for generating successive text fragments in correspondence with successive elements from a data base using associated schematic text fragments associated with said elements. 18. The method of claim 2 further comprising the step of providing operators in a schematic text fragment for invoking iterative generation of text fragments, said iterative process occurring for elements retrieved from one of a data base and a knowledge base. 19. An apparatus for generating prose text comprising means for inputting a text fragment, said text fragment containing at least one directed prose expression and optionally a fixed prose phrase, said expression having an expression identifier, an expression operator, and a command body, means for parsing said input text fragment for reproducing each said fixed prose phrase in an expanded text stream, and for replacing each said directed prose expression for inclusion in said expanded text stream, means for outputting an expanded text stream, said expanded text stream containing only prose text, said parsing means comprising means for recognizing each directed prose expression from said expression identifier, means for decoding the expression operator for an expression, and means for operating, in response to said decoded expression operator, upon said command body, for generating a prose text construction to replace the directed prose expression. 20. The apparatus of claim 19 further comprising means for providing a plurality of expression operators, each operator having associated therewith a selected format for its associated command body. 21. The apparatus of claim 20 further comprising means for including relational operations in said command body. 22. The apparatus of claim 20 further comprising means for including nested directed prose expressions in said command body. 23. The apparatus of claim 20 further comprising means for including in said command body a nested directed expression for outputting a prose characterization of observations resulting from a knowledge based analysis of a situation. 24. The apparatus of claim 20 further comprising 10 means for including in said command body a nested directed expression for outputting a prose characterization of recommendations resulting from a knowledge based analysis of a situation. 25. The apparatus of claim 20 further comprising 15 means for invoking a reasoning process in the command body for determining a generated prose text. . 26. The apparatus of claim 20 further comprising means for recursively invoking computational 20 procedures, for generating partial prose text and other schematic text fragments. 27. The apparatus of claim 20 further comprising means for generating successive text fragments in correspondence with successive elements " from a data base using associated schematic text fragments associated with said elements. 28. The apparatus of claim 20 further comprising means for defining operators in a schematic text fragment for invoking iterative generation of text fragments, said iterative process occurring for elements retrieved from one of a data base and a knowledge base.

Inventors: SMITH TERRENCE M, WOODS WILLIAM A JR, SMITH, TERRENCE, M., WOODS, WILLIAM, A., JR.
Applicants: APPLIED EXPERT SYSTEMS INC, APPLIED EXPERT SYSTEMS, INC.
Application year: 1988
Main classification: G06F7
IPC codes: G06F17