WO2004046967A1 - Navigation in hierarchical structured transaction processing system - Google Patents

Navigation in hierarchical structured transaction processing system Download PDF

Info

Publication number
WO2004046967A1
WO2004046967A1 PCT/US2003/034134 US0334134W WO2004046967A1 WO 2004046967 A1 WO2004046967 A1 WO 2004046967A1 US 0334134 W US0334134 W US 0334134W WO 2004046967 A1 WO2004046967 A1 WO 2004046967A1
Authority
WO
WIPO (PCT)
Prior art keywords
int
nodes
node
thesaurus
word
Prior art date
Application number
PCT/US2003/034134
Other languages
French (fr)
Inventor
Prashant Parikh
Stanley Peters
Original Assignee
Semiosis L.L.C.
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Family has litigation
First worldwide family litigation filed litigation Critical https://patents.darts-ip.com/?family=32297678&utm_source=google_patent&utm_medium=platform_link&utm_campaign=public_patent_search&patent=WO2004046967(A1) "Global patent litigation dataset” by Darts-ip is licensed under a Creative Commons Attribution 4.0 International License.
Application filed by Semiosis L.L.C. filed Critical Semiosis L.L.C.
Priority to AU2003286718A priority Critical patent/AU2003286718A1/en
Publication of WO2004046967A1 publication Critical patent/WO2004046967A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures
    • G06F16/322Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/93Document management systems
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99931Database or file accessing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99931Database or file accessing
    • Y10S707/99932Access augmentation or optimizing
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99931Database or file accessing
    • Y10S707/99933Query processing, i.e. searching
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99931Database or file accessing
    • Y10S707/99933Query processing, i.e. searching
    • Y10S707/99934Query formulation, input preparation, or translation
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99931Database or file accessing
    • Y10S707/99933Query processing, i.e. searching
    • Y10S707/99936Pattern matching access
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10TECHNICAL SUBJECTS COVERED BY FORMER USPC
    • Y10STECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y10S707/00Data processing: database and file management or data structures
    • Y10S707/99941Database schema or data structure
    • Y10S707/99942Manipulating data structure, e.g. compression, compaction, compilation

Definitions

  • the present invention relates to information processing and, more particularly, computer based transaction processing.
  • a graph structure is a collection of points, called “vertices”, and a collection of lines, called “edges”. Each edge joins a pair of vertices or a single point to itself.
  • a simple example of a network represented by a graph structure is a road map.
  • the vertices represent towns or cities.
  • the edges represent the roads that connect the towns and cities.
  • Another type of network familiar to anyone who has a telephone is an automated telephone voice response system, such as commonly utilized by many large companies, to direct incoming calls to particular individuals or departments or to assist the caller in performing a transaction, such as making a purchase.
  • That type of telephone network can also be represented as a graph structure.
  • the system When the system answers an incoming call, it transmits a verbal description or prompt to the caller: "If you would like to speak to Harry, press 1; if you would like to speak to Fred, press 2".
  • verbal description to mean a set of words relating to the subject matter whether presented audibly or in written form. The verbal descriptions may range from a few words to an entire document worth of text).
  • a first vertex on the graph represents the initial prompt, which a caller hears upon reaching the telephone response system. If the user's response is pressing 1, calls are directed along a first edge to Hany, represented by a second vertex.
  • the call is directed along a second edge to Fred, represented by a third vertex. Then, if the chosen person is not available, the caller is asked whether the caller wishes to leave a message. If the response is positive, the caller is directed along another edge to the selected person's voice mail, which would be represented by another vertex of the graph.
  • the object in navigating the graph is to get from the first vertex to the goal vertices. If this is not done as quickly and efficiently as possible the user may become frustrated and give up. Moreover, as the number of possible choices or nodes in the network becomes larger, the number of possible pathways between the first vertex and the goal vertices multiplies rapidly. Therefore, the ability to reach the goal vertex can become more difficult, require navigation of an excessive number of choices or nodes, or discourage a user before the goal vertex is even reached.
  • the present invention creates a method for navigating efficiently and naturally through a series of choices to obtain information, perform transactions, or accomplish some similar goal.
  • the invention is implemented in a programmed computer that has a hierarchically configured decisional network that must be navigated as part of the processing and is constructed to accept inputs or data and process them in a manner that facilitates navigation of the network vertices more efficiently.
  • FIG. 1 is an example graph representing a simple, generic hierarchically arranged transaction processing or decisional system suitable for use with the invention
  • FIG. 2 is an example portion of a graph used to illustrate jumping among nodes in accordance with one variant of the invention
  • FIG. 3 is an example portion of a graph in a simple interactive voice response ("iNR") system used to illustrate grouping in accordance with one variant of the invention
  • FIG. 4 is an example portion of a graph in a simple interactive television program listing used to illustrate another variant of the invention.
  • FIG. 5 is an example portion of a graph in a simple geographic information system used to illustrate a further variant of the invention.
  • FIG. 6 is an example portion of a graph for a simple automated voice response system used to illustrate a more complex variant of the invention
  • FIGS. 7 A, 7B, and 8-10 are collectively a flowchart illustrating an example setup process for use in accordance with an example implementation of one variant of the present invention.
  • FIGS. 11-14 are collectively an overall flowchart illustrating an example process in accordance with a further variant of the present invention.
  • mathematicians refer to a "path" from one vertex in a graph to another specified vertex in the graph as consisting of a sequence of edges that connect the vertices between the first vertex and the final vertex. If the path contains an edge sequence that is "closed”, meaning that it loops back on itself, the path is called a "circuit” or a "cycle”.
  • a graph structure is considered to be “connected” if there is at least one path connecting every pair of vertices.
  • Our invention is particularly applicable to transactional processing as applied to instances where graph theory can be used to represent the transactions as a set of options and when the options are structured according to a connected graph that contains no circuits.
  • graph theory can be used to represent the transactions as a set of options and when the options are structured according to a connected graph that contains no circuits.
  • a graph that contains no circuits.
  • a "menu tree” can be regarded as a series of vertices in a hierarchy or ordered pattern, arranged in rows of increasing numbers of vertices.
  • a "menu tree” can be represented as a “tree” in which (i) the vertices are all the options provided anywhere in the "menu tree", plus a first vertex, (ii) every vertex except the first vertex, i.e., every “option vertex”, is associated with the verbal description (or such other means) by which a "menu” presents that option, (iii) an edge connects the first vertex to each vertex that the first "menu” presents to the user as an option, and (iv) each other vertex is similarly connected by edges to every other vertex that the corresponding "menu” presents to the user as an option. As the number of options increases, so does the length of paths from the first vertex to goal vertices.
  • the user can navigate the graph or tree in a way that allows them to skip from one vertex to another vertex that may be many rows down the graph or tree and/or where the vertices may not be connected together by an edge. This eliminates the necessity for making many choices.
  • Particular implementations make it possible to jump laterally from one vertex to another if the navigation enters a wrong branch of the tree or if the user changes his goal.
  • the approach is accomplished through associating each vertex with a verbal description (or prompt), and matching words in users' requests and responses with these verbal descriptions to enable the selection of vertices that may not be directly connected to the user's current location in the graph or tree by an edge.
  • the present invention is applicable to a wide range of different networks, which can be mathematically represented by graph structures consisting of vertices and edges and should not be considered to be limited to the particular application described.
  • Representative examples of suitable applications for the invention mclude implementing an enhanced and more efficient "Find” function or file system browser for personal computer operating systems, a navigation system for television program listing, document management or retrieval systems, a "geographic information system" in an automobile that allows location of addresses or business(es) meeting certain criteria, or other devices that incorporate some hierarchical navigation aspect as part of its operation.
  • FIG. 1 is an example graph 100 representing a possible hierarchically arranged transaction processing or decisional system suitable for use with the invention.
  • the individual boxes 102 - 120 are referred to as "nodes" and each represents a specific choice or option in the hierarchy. For purposes described in more detail below, each node is arbitrarily uniquely identified in some manner.
  • the individual nodes 102 - 120 are numbered 1 through 10 starting from the top node 102 in the hierarchy.
  • Each "node” is associated with exactly one verbal description, for example in the case of an airline system, a verbal description relating to some aspect of the reservation process.
  • Each such description contains "key” words that are deemed to be of importance and other words that can be disregarded. For example, one node may have the associated verbal description "Would you like to make a reservation?" In this description, there is only one "key” word - "reservation” deemed important, so all of the other words in the description can be ignored.
  • the terms "domestic” and "international” are “key” words.
  • the word “flight” could be a "key” word, for example, for a system that involves not only airline travel but also rail and/or cruise travel or it could be an "ignored” or stop word for a purely airline related system because it has minimal meaning in that context. Again, the other words can be ignored as well.
  • each node allows the creation of a list of all the key words and their associated nodes so that, if a key word is duplicated in two or more nodes, it need only be listed once.
  • a hierarchical tree related to "pens” might have nodes for ball-point pens, fine point pens, medium point pens, fountain pens, felt-tip pens, quill pens, erasable pens, etc.
  • the keywords are obtained from the collection of available descriptions found in the particular application in which the invention will be used.
  • each particular node where the keyword appears is associated with the keyword.
  • the keyword "point” might appear in nodes 2, 3, 6, 7, 13 and 15.
  • the keyword “erasable” might appear in nodes 3, 4, 5, 6 and 22.
  • An index, as described more fully below, associating these keywords with the nodes containing them is then created, for example: point: 2, 3, 6, 7, 13,15 erasable: 3, 4, 5, 22
  • the "tree” can be negotiated by allowing presentation of relevant verbal descriptions for the nodes associated with a term, irrespective of where in the hierarchy they are, thereby causing a "jump" to a particular node without necessarily traversing the tree in the rigid hierarchical manner.
  • the specific formats used and presented in these examples are purely for illustration purposes. It should be understood that that other techniques for interrelating data, such as hash tables, direct or indirect indexing, etc. can be substituted in a straightforward manner.
  • the relationship between the word and a node could be configured such that the location of the word in a list as the "n-th" item could be used as an index into another list containing the nodes correlated to the list.
  • a similar approach could be used for the thesaurus, the important aspect relative to the invention being the relationship among certain words and the node(s) in which they occur and, where applicable, the relationship between certain words and "synonyms" for those words, not the data structure or its form or format whereby that information is kept or maintained.
  • Example 1 illustrates, in simplified form, how an index is used to jump among nodes with reference to FIG. 2.
  • the hierarchical tree 200 represents a portion of a more complex tree specifically involving possible decision relating to fruit and a decision between two specific types of fruits, an apple and an orange.
  • an inverted index would be created that includes an association of "Fruit” with the top node 202, "Apple” with the bottom left node 204, and "Orange” with the bottom right node 206.
  • that association can be created using node identifiers, in this example, the node identifiers 1A01, 1A02 and 1A03 are arbitrarily assigned and used.
  • the information can be stored in a file, for example, as follows:
  • Example 1 graph of FIG. 2 applies, but relevant portion of the index is as follows:
  • a user response containing the keyword "apple” would identify nodes with identifiers 1A02 and 2F09.
  • the verbal descriptions from both nodes would be presented to the user, likely in alternative fashion.
  • node 2F09 might be more appropriate because it is part of the "drinks" portion of the overall hierarchy.
  • This example illustrates the "grouping" aspect using a simplified graph 300 representing a portion of an airline reservation system as shown in FIG. 3.
  • the graph of FIG.3 can be thought of as part of a very simple interactive voice response (“IVR") system.
  • IVR interactive voice response
  • each node is uniquely identified, for example, by the numbers 1 through 7 and the identified terms "Reservation”, “Domestic”, “International”, “Business Class”, “Economy Class” are deemed the relevant keywords.
  • keywords could be single words, phrases of two or more words, or even some other form of information like a specific data pattern.
  • the top node is assigned the number 1
  • its two child nodes Domestic and International
  • the grandchild nodes i.e. at the lowest level in the hierarchy
  • the last two entries in the inverted index are each associated with two nodes, 4 and 6 in the first case, and 5 and 7 in the second.
  • the verbal descriptions associated with each identified node could be presented together or in sequence.
  • a set of rules can be established, for example, such that if an,' identified node is a sub-node of another identified node, only the verbal description of the sub- node(s) is provided because of inherent redundancy.
  • the verbal description associated with the "reservations" node can be suppressed if it can be determined that business class necessarily implies reservations.
  • a search of the inverted index would identify nodes 4 and 6 (310, 314) from different parts of the tree are associated with the keywords in the query, and thus the system, in presenting the verbal descriptions from each, in effect, alters the tree structure and groups these nodes in the result.
  • the combination of result nodes presented depends upon the user query or response, not that predetermined by the graph structure itself.
  • teachings of the present invention allow for construction of a more flexible system than available in the prior art.
  • Example 4 illustrates the addition of a simple thesaurus as an aspect of a system so that a synonym of a keyword may also be used by the system to jump to the desired nodes in the graph.
  • Example 4 is discussed with reference to a portion 400 of an interactive television program listing system as shown in FIG. 4.
  • Such a system implementing the invention will allow a user to speak to or interact with a device to look for programs of his choice by time slot, genre, favorite actor or actress, etc.
  • each node 402, 404, 406 is uniquely identified by a string of six characters, the portion of which corresponding to FIG. 4 is shown as follows.
  • thesaurus can be created associating the two.
  • thesaurus terms to be equated to the keywords can be taken from a standard thesaurus or can be custom created for the particular application.
  • the equating of terms can be done in any of a myriad of different ways, the exact implementation details of which however re irrelevant to the invention, but a few representative examples of which however are contained herein for purposes of illustration.
  • the equating can be done on a purely word basis.
  • a file can be constructed such that one or more single word synonyms are directly associated with an index word, for example as follows:
  • the synonyms can be equated with the node identifier(s) corresponding to the index term, for example as follows: Movies, Flicks - vnymos
  • the system would still have to search the index after the thesaurus has provided the proper index term(s).
  • the thesaurus provides a direct link to the respective node(s) so that re-searching is not required.
  • the system would search the inverted index of keywords and fail to locate "Movies” as a keyword. As a result, it would search the thesaurus and find that the word "Movies” is a synonym that can be correlated with a keyword. At this point, depending upon the particular thesaurus, it would either return to the inverted index and search using the synonym keyword "Films" and return the result as the node 406 identified by "vnymos", or go directly to the node 406 identified by "vnymos” based upon the thesaurus entry.
  • the thesaurus concept can be extended further so that an initially unknown word (i.e. a word that is neither a keyword nor a thesaurus word) can be learned by the system and added to a thesaurus for future use.
  • an initially unknown word i.e. a word that is neither a keyword nor a thesaurus word
  • FIG. 5 is a portion 500 of a larger system graph as part of a very simple "geographic information system" found in some automobiles, kiosks and elsewhere today.
  • a system enables a user to, among other things, identify and get information about different locations in an environment. For example, information about particular types of restaurants in an area.
  • the inverted index for the portion 500 shown in FIG. 5 could look as follows:
  • a user issues the following query to the system "fast food” in order to find a quick meal.
  • the system first offers the verbal description from the top level node(s) 502 to the user - in this example, just "Restaurants".
  • the user presumably provides a positive response.
  • This example illustrates how additional meanings for an existing thesaurus term or phrase can be learned by the system for future use, whether the existing thesaurus term or phrase was an original thesaurus term or one previously learned with continuing reference to FIG. 5.
  • the system would go directly to the "Pizza” node. However, the user will reject “Pizza", having “burgers” in mind. By rejecting the "Pizza” node 504 description, the user indicates that the "Pizza” node 504 is not of interest.
  • the system is therefore configured with a further set of rules, in this case one in which the system goes up in the hierarchy to a higher node, the top node 502 in this portion of the example, and provides the verbal descriptions for the other nodes 502, 504, 506, 508 so as to cause a tracing down the tree. This can be illustrated by the following “dialog":
  • the system can always jump to fixed ancestor(s) (either the top node or a parent or some ancestor(s) at an intermediate point) or a fixed level (e.g. halfway from the top).
  • fixed ancestor(s) either the top node or a parent or some ancestor(s) at an intermediate point
  • a fixed level e.g. halfway from the top
  • a more flexible alternative uses the information recorded in the thesaurus to find every synonym for "pizza” in the thesaurus and collect all the other keywords associated with those ⁇ ,-v synonyms. Then the system would search the inverted index to identify all the nodes associated with these other associated keywords and identify the most common ancestor of all of those nodes and go to it.
  • the system makes use of known properties of the one meaning of "fast food", which is "Pizza”, to construct an intelligent hypothesis about where the other meanings of "fast food” might lie in the graph. This allows the user to reach another meaning with the least effort and allows the system thereby to learn what the new meaning of "fast food” is more efficiently.
  • the system is constructed to track the frequency of use of a particular term in the thesaurus.
  • the tracking can be done for all entries in the thesaurus, for only those added as part of the "learning" process, or for some specified combination thereof.
  • some specified criterion is used to determine when, and which terms, if any, should be removed from the thesaurus.
  • the criterion can be based upon usage relative to time, usage of a particular term relative to some other term(s), term usage relative to overall thesaurus usage, or simply elimination of all added terms not used since the last purge.
  • a further enhanced implementation can be constructed so the system is dynamically * updating the thesaurus, either adding meanings or dropping meanings for existing and/or initially unknown words.
  • a further advantage to the invention is that, in some implementations, it can be configured so that, when there are multiple relevant nodes to be presented, an associated ranking can be used to determine the type, method or order of presentation. For example, the ranking can be based upon the frequency of use of particular nodes, which is tracked in these implementations, so that the most frequently selected or used nodes are presented first, more prominently, or in a particular manner.
  • the user's selection will cause one entry to have a greater frequency of usage relative to the other entry, for example a selection of "Burgers" will make it have a higher frequency of usage and, accordingly, a higher ranking for the next instance of use.
  • the "Burgers” node 506 will have the higher frequency of usage and, accordingly, will be presented first, or more prominently, or in some other specified manner because of its ranking. If the frequency reverses with use so that the "Pizza” node 504 outranks “Burgers” node 506, then the "Pizza” node 504 will supplant the "Burgers” node 506.
  • Example 8 allows the node rankings to be used to prune the nodes themselves, hi this variant, a criterion can be specified, typically zero usage over a long specified period of time, that is used to remove an entire node. This is advantageously made possible because of the system's ability to "jump" among nodes. Thus, it may occur that a node within the tree is never accessed, but a child node of that node is. In some variants therefore, when this state exists for a sufficiently long period of time, the system is constructed to delete that node.
  • this process will not even affect the "learning" process because, even if no user action ever directly causes the node to be presented, if the learning process causes the node to be presented the node's access frequency will be non-zero and it will not be "pruned".
  • the "jumps" can occur from any node to any node, i.e. vertically and/or laterally and to another node that is higher, lower or on the same "level” as the node from which the jump is made. All manner of vertical and lateral jumps from multiple nodes to multiple nodes are possible.
  • the verbal description from the identified node may be the one issued whereas, in others (like an IVR system), the verbal descriptions for the children of the identified nodes may be what is presented. Nevertheless, in both cases, the process as described above by way of example will be the same or directly analogous.
  • FIG. 6 illustrates a simplified example of an "interactive voice response unit” (IVR) hierarchy 600 that might be used in the airline industry.
  • IVR interactive voice response unit
  • a real menu tree used in an IVR may have any number of nodes from several, up to a thousand, or more.
  • a tree with 4 branches from each node and which has 5 levels uniformly would have 1365 nodes.
  • the tree 600 is a hierarchical tree and consists of the following nodes and branches:
  • Initial start 602 domestic flight arrival information (node al) 604 domestic reservations (node a2) 606 international flight arrival information (node a3) 608 international reservations (node a4) 610
  • the node 604 identified by al is a service node with pre-recorded information.
  • the node 606 has two child node a 2, first/business class (node a5) and economy (node a6).
  • the node 608 identified by a3 is service node with pre-recorded information.
  • the node identified as a4 has three child nodes identified as first class (node a7), business class (node a8), and economy (node a9).
  • the nodes 612, 614, 616, 618, 620 identified as a5, a6, a7, a8, a9 are all service nodes (i.e. terminal nodes) where a respective customer service representative will interact with the caller.
  • a real system may also have a choice at the top level or at each level for a live operator and may even have a choice to go back to the previous menu.
  • the caller would be able to say what he was looking for (e.g. "I want to make a domestic business class reservation") and the system would identify and respond with the appropriate node 612 (e.g.
  • the system implementing the invention can further include an option that the entire transaction (e.g. the making of the reservation) would be carried out through natural language interactions with the system without the intervention of a human customer service representative.
  • the entire transaction e.g. the making of the reservation
  • all the details of his domestic reservation are obtained by the system and the system updates a database accordingly and issues whatever commands are required (e.g. the mailing of a ticket) to be carried out by some human representative later.
  • variants of a system implemented in accordance with the invention can incorporate an automatically generated or updated thesaurus, which greatly expands the range of words or terms a caller can use.
  • the user is not restricted to parroting the highly constrained script as required by other interactive voice response systems, nor is the user limited to traversal to a connected node.
  • a system can be constructed that is able to learn new words or terms that it may not have understood the first time. For example, if a user asks for "coach class” and the system does not have the word “coach” or the phrase "coach class” in its keyword list or in its current thesaurus, then on this first occasion, it offers the user a traditional path down the conventional tree.
  • the thesaurus is a dynamically changing entity, continually updating itself by learning new words and terms and learning new "meanings" (i.e. new actions or responses) for existing te ⁇ ns.
  • Implementations according to the invention can also allow novel groupings of nodes to be presented to the caller based on his query. If he asks for "economy class" without specifying whether he wants an international or domestic reservation, then the system would offer him the nodes a6 and a9 (appropriately phrased in natural language), and allow him to further choose whether he wants international or domestic reservations, something current systems do not offer. In other words, the system can pick out the relevant responses from different branches of the tree and pool them togefherand offer them to the caller.
  • FIGS. 7 through 14 are illustrative of a functional example of the general method of a more complex variant the invention as would be implemented in software according to the flowcharts in this case for a newspaper subscription application. It should be understood that particular details are provided in the description below merely for completeness or because they are necessary or helpful for forming an understanding of the particular implementation. They are not to be considered essential for implementing the invention. Similarly, details unrelated to or unnecessary for understanding the invention have been omitted to avoid confusion.
  • An example implementation is described and contains two programs, a preparatory program, illustrated in FIGS. 7-10 and a transaction or query processing program, illustrated in FIGS. 11-14.
  • a particular software implementation fairly corresponding to the flowcharts of FIGS. 7 - 14 appears in the Appendix A that follows. The program contained therein, is written in the "C" programming language for execution on any personal computer having a processor, memory , input-output, etc. capabilities to run the particular application in its intended environment.
  • the first program process of FIGS. 7-10 constructs an inverted index and an application-specific thesaurus and the second program process of FIGS. 11-14 uses those constructs in a transaction processing system to interact with a user.
  • the file named 'p' contains a list of prompts or verbal descriptions in a hierarchical relationship (i.e. they can be visualized or arranged in a tree-type graph).
  • the file named 'w' contains documents that are related to the prompts or verbal descriptions in 'p'.
  • 'w' could contain a training manual for customer service personnel or a website document that is likely to contain material that is related to the queries customers may have.
  • This file is used to create a thesaurus.
  • the file named 'f contains forms that are used to elicit relevant information from customers. They have fields like 'name', for example, which would be used by the system to ask and record a caller's name.
  • the file named 'x' contains an index associating the forms in with terminal prompts or descriptions in 'p'. Once a terminal prompt is reached in the process, the corresponding form from the file 'x' is activated, and the system proceeds to elicit information from the user.
  • the file named 's' contains a list of application-specific stop words, many of which are high-occurrence and/or generally uninformative words like 'a', 'an', 'the' or 'from' or words with a high-occurrence in for the particular application such that they have little meaning, for example, 'fly' in an airline reservation system, 'street' in a navigation system, 'file' in a computer search tool. These are eliminated from 'p' and 'w' and 'f before processing, because they don't carry any useful information for the application.
  • the file 't.cfg' contains the thesaurus and inverted index that will be constructed by the program.
  • the thesaurus could be a separate file from the inverted index file and either or both could be made up of multiple files.
  • the file 'l.cfg' is a file that is used to store newly learned words. As with the t.cfg' file, the 'l.cfg' file need not be a separate file, it could be part of 't.cfg', or part of a separate thesaurus and/or inverted index file. Similarly, the 'l.cfg' file could be made up of several files.
  • the files p, w, f, x, and s are each read and processed as follows. It should be understood that the order of processing of file 'p' relative to file 'f or their respective sub-processing components, although shown sequentially, could be done in a myriad of ways including doing each of the reading extracting and storing concurrently or as a common operation (i.e. reading for both is done before extracting for both, etc.).
  • keywords are extracted from p and from f . These are initially just all the words or terms contained in the prompts in p.
  • the keywords are stored, for example, in a temporary file.
  • thesaurus words are extracted from w. These are initially just all the words or terms in w. They are also stored, for example, in a temporary file.
  • Stop words are loaded from s (902) and stop words and duplicate words are eliminated from keywords and thesaurus words stored in the temporary files.
  • the thesaurus is constructed in accordance with FIGS. 9 and 10 described in overview as follows: a. Increment the file of thesaurus words with keywords from p and f remaining after elimination of stop words. b. Create a matrix of thesaurus words as row words (or words listed along the rows of the matrix) against keywords as column words (or words listed along the columns of the matrix). c. Count the number of co-occurrences of each row word with each column word of the matrix in the documents contained in w and fill in that number in the corresponding matrix cell. (For example, a co-occurrence of a pair of words may be defined as that pair occurring in the same paragraph.
  • w is made up of a hundred paragraphs, then take each pair of row word and column word and count the number of times this pair occurs within the space of each of the hundred paragraphs in w. For each pair, the pair may co-occur zero or more times in a paragraph and add up the number of co-occurrences in all the paragraphs in w.
  • the cosine values for all pairs of row words and column words are calculated and stored, for example, in a new matrix.
  • the top 'n' cosine values are identified as are the corresponding keywords. For example, in an airline system context, if there are two row words 'coach' and 'economy', where 'economy' is also a keyword (originally from p and/or f), and if the cosine value of this pair or words is among the top 'n' cosines for the word 'coach', then 'economy' is identified as a synonymous keyword for coach.
  • a new file can then be created, formatted for example, by listing thesaurus words on the left (e.g. coach), and against each thesaurus word, its associated keywords (e.g. economy). This is referred to as an inverted index (i.e. the thesaurus) of row words and their keyword synonyms.
  • this file will now contain words like 'coach' coupled with its particular alternative meanings, one of which may be 'economy'.
  • the user interactive transaction processing program, the second program will later use this thesaurus file when a caller uses a word like 'coach' in his query to determine the relevant keywords (like 'economy'). This will enable the program to find the relevant prompt with which to respond to the user.
  • another inverted index is created using the files p, f, and x.
  • This index will contain a list of keywords from p and/or f associated with the prompts in which they occur.
  • the second program will look up the thesaurus, find the keywords corresponding to it (e.g. 'economy'), and then look up the inverted index to find the prompts corresponding to 'economy' and other corresponding keywords.
  • the file t.cfg can be created from them for use by the second program.
  • FIGS. 11 through 14 One example of the program flow for a fairly generic transaction processing program implementing one variant of the invention is illustrated in the flowcharts of FIGS. 11 through 14. This example is configured to incorporate a collection of several of previously described simple aspects. To demonstrate the functions of this program and how this program operates, for context, we use an example interaction that a calling customer might have with this example system.
  • the keywords, thesaurus words, prompts from t.cfg. are loaded (1104), as are the learned words from l.cfg. Initially, l.cfg will be empty as the program has not yet learned any new words.
  • the forms and index of forms against prompts from f and x respectively are loaded, as are stop words from s.
  • the program opens the interaction with a greeting (1106) and an elicitation of the first query from the caller (1108). This might be: "Thank you for calling the New Herald. How may we help you?"
  • the keywords and the thesaurus words remaining in the query are identified (1202, 1204) by comparing with the list in t.cfg and l.cfg. As we have assumed that "subscribe" is neither, we have none.
  • the prompts that best match the identified keywords and thesaurus words are selected (1206). As there are no such words identified, there are no prompts selected.
  • the program arrives at a decision in the flowchart: are any nodes selected? (1208). Since the answer is in the negative, the program will follow the branch and select the top level node (1218). (Note: These top level prompts are the ones at the top level of the menu tree.) This completes the prompt selection process. The process then proceeds to the second part of the query process.
  • the process proceeds with another decision: has a single leaf prompt been selected? (1210). Since the top level prompts are selected (of which there are more than one and also none is a leaf prompt), a negative answer is the result.
  • the program returns to selecting verbal descriptions by identifying the keywords and the thesaurus words remaining in the query by comparing with the list in t.cfg and l.cfg (1202, 1204). "Subscriptions" is now synonymous with a keyword and it is identified. The program will again select verbal description(s) that best match the identified keywords and thesaurus words (1206).
  • the program then arrives at a decision branch (1208) in the flowchart: are any nodes selected? Since the answer is affirmative, it follows that branch and exits the prompt selection process and returns to the query process.
  • the program will again return through a loop to the prompt selection process (1202, 1204; 1206) where the program will identify the keywords and the thesaurus words remaining in the query by comparing with the list in t.cfg and l.cfg. "Order" and "subscription" are now identified.
  • Verbal descriptions are selected that best match the identified keywords and thesaurus words. Now assume this is just the prompt "Would you like to order a subscription?” from the three descriptions above.
  • the program will then arrive at a decision branch (1208) in the flowchart: are any nodes selected? Since the answer is affirmative, it follows that branch and exits the prompt selection process and returns to the query process to again arrive at a decision: has a single leaf node been selected? (1210). This time the answer is yes, a single prompt has been reached, which is also a leaf prompt, since it is at the bottom of the menu tree.
  • the form is processed in the following way:
  • the first part is a decision: is it a response form? (1302). The answer is no.
  • the system then issues questions to the caller based on the form and accepts information back (1304).
  • the questions are of the form "Please tell us your name", “Where do you live?", "Do you want an annual or half-yearly subscription?” etc.
  • the caller provides the information to the system.
  • the system then calls an external routine to store the information in a database.
  • the routine returns another form to the system (1306) and returns in a loop to the question: is it a response form? (1302). Since the form contains questions about the payment, based on the type and period of subscription selected by the caller, the answer will be negative.
  • the system then issues these questions to the caller and the caller provides the required information (1304).
  • the system then repeats the information and gets a confirmation from the caller.
  • This routine (1306) then returns a response form and again returns in the loop to the question: is it a response form? (1302). This time the answer is yes.
  • the system then issues a response (1308) thanking the caller for the subscription, and exits this process returning to FIG. 11.
  • the learning process begins with a decision: is the word already in l.cfg? (1402). The answer is no, since l.cfg is initially empty and the word has not been encountered before.
  • the program asks the caller if he wishes to continue (1114) (i.e. are there any further queries). We assume the answer is no and the system thanks the user and exits.
  • the dialogue continues in this way with the system eliciting the required information from the caller.
  • verbal description that enables him to carry out his goal and updating the thesaurus when the goal vertex is reached by associating the recorded previously unknown words in the user's response with the keywords that are associated with the verbal description reached by the user; f) recording, when the goal vertex is reached, the pairs of synonyms in the user's responses and the keywords that are associated with the verbal description reached by the user; g) removing associations between keywords and their synonyms from the thesaurus that have not been accessed more than a specified amount of times within a specified period (this can be based upon a parameter set in the system by the system's administrator or can occur as part of program maintenance or updates); h) selecting the verbal descriptions that best meet the user's goal as indicated by the keywords and synonyms in the user's response by identifying the keywords in the user's response and/or the keywords corresponding to synonyms in the user's response and computing a degree of match between each verbal description and the identified keywords, in accordance with conventional linguistic processing techniques; i) computing the degree of
  • numRow processFile(wdoc, &rowTerms, webThreshold);
  • ⁇ numWords removeNulls((*cArray), numWords); sortArray((*cArray), numWords); return numWords; ⁇ ****************************************************** Prompts Processing
  • eraseZeroes removes the row with all zero column in the matrix int eraseZeroes() ⁇ intj, k; int cond;
  • createThesaurus Function to Create Thesaurus of rowTerms by taking the index words matching the top 5 cosine values. void createThesaurus()
  • floatSort Sorts the array of cosine values and corresponding index of index words in reverse order. floatSort(int *colnum, double *tmpcos, int numRow)
  • ⁇ tmpcount createA ⁇ ray(formlist[i]->fields
  • j]->Choice[k], tmparray); for(l 0; 1 ⁇ tmpcount; 1++) addWord(&wordList, tmparray[l], ++words); ⁇
  • ⁇ i merge Array(cArray, wordList, count, words); sortArray((*cArray), i); return i;
  • stemlib.c This program contains functions related to stemming algorithim /* This is the Porter stemming algorithm, coded up in ANSI C by the author. It may be be regarded as cononical, in that it follows the algorithm presented in Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14, no. 3, pp 130-137, only differing from it at the points maked -DEPARTURE- below.
  • the algorithm as encoded here is particularly fast.
  • b is a buffer holding a word to be stemmed.
  • the letters are in b[k0], b[k0+l] ... ending at b[k].
  • hi fact kO 0 in this demo program, k is readjusted downwards as the stemming progresses. Zero termination is not in fact used in the algorithm.
  • /* m() measures the number of consonant sequences between kO and j. if c is a consonant sequence and v a vowel sequence, and ⁇ cauliflower> indicates arbitrary presence,
  • steplab() gets rid of plurals and -ed or -ing. e.g. caresses -> caress ponies -> poni ties -> ti caress -> caress cats -> cat feed -> feed agreed -> agree disabled -> disable matting -> mat mating -> mate meeting -> meet milling -> mill messing -> mess meetings -> meet
  • steplc() turns terminal y to i when there is another vowel in the stem.
  • */ void steplcO ⁇ if (ends(" ⁇ 01" "y") && vowelinstemO) b[k] 'i'; ⁇
  • step3() deals with -ic-, -full, -ness etc. similar strategy to step2.
  • step4() takes off -ant, -ence etc., in context ⁇ c>vcvc ⁇ v>. */ void step4()
  • step5() removes a final -e if m() > 1, and changes -11 to -1 if m() > l.
  • p is a char pointer
  • the string to be stemmed is from p[i] to p[j] inclusive.
  • dialog.c This is main program of dialog module
  • dialog.c The main function for the interactive dialog program, loads all the global arrays and variables before calling the interacitve function.
  • the Configuration file for Thesaurus contains Prompts, index, basic thesaurus etc.
  • the Learning Thesaurus - used to store learnt words and to refer to them.
  • readArray Reads the file and fills the rows and columns of the given arrays int readArray(FILE * ⁇ , char *head, char ***ch_array, int ccount, int ***int_array, int icount, int sp)
  • loadMenuTree loads the menutree from file to menuList array int loadMenuTree (FILE * ⁇ , char *head)
  • interPrompts - Intersection of prompts unionPrompts Union of prompts
  • *n2 Promptlntersection(t2Prompts, ⁇ , *n2, m);
  • PromptUnion does a union of arrays pointed by pi and p2 and stores in pi . returns the total elements in result int PromptUnion(int *pl, int *p2, int nl, int n2)
  • Promptlntersection does a intersection of arrays pointed by pi and p2 and stores in pi . returns the total elements in result int Promptlhtersection(int *pl, int *p2, int nl, int n2)
  • GetPrompt Returns the final prompt selected by user int GetPrompt(int *Parray, int pent)
  • ⁇ pent removeZeros(Parray,pcnt); continue;
  • ⁇ t PromptUnion(array, tmparray2, t, t2); return t;
  • HEADER FILES (C) globalvar.h: Header file for global variables extern FILE *webDoc, *phoneDoc; extern int numColumn, numRow, numlndex, numMenu; extern int startPoint, eofFlag, topValues; extern char **rowTerms, **columnTerms, **prompts, **stop ords; extern double **matrix, **cosine; float phoneThreshold, webThreshold; extern int **indexList, **menuList, **thesaurus; extern int numStopWord, numOrgRow; void stemArray(char **list, int arrayLen); extern int numForms, numPF; int stemWord(char *); extern char ***Fprompts; extern int numForms, numPF; extern stract form **formlist;
  • MAKE FILE makefile Makefile for compiling the source code. all: t d demoran t: main.o process. o arrayhb.o stemhb.o formhb.o cc -g main.o process.o arrayhb.o stemhb.o formhb.o -o t -lm d: dialog.o interactive.o arrayhb.o stemhb.o formhb.o cc -g dialog.o interactive.o arrayhb.o stemhb.o formhb.o -o d demoran: demorun.c cc demorun.c -o demoran main.o: main.c process.h arraylib.h forms.h cc -c -g main.c process.
  • PARAMETER FILES t.ini This file contains parameters required for program 't' pdoc p # phonedoc wdoc w # webdoc sdoc s # stopwords fdoc f # forms xdoc x # link of forms & prompts- cfg z.cfg # config file pt 0.02 # phoneThreshold wt 0.0006 # webThreshold tv 5 # top Values for cosine d.ini: This file contains parameters required for program 'd' cfg t.cfg # config file lcfg l.cfg # learn file sdoc s # stopwords fdoc f # forms xdoc x # x minprompt 2 # minimum no of prompts timeout 30 # timeout sees for other options
  • the website address is www.newherald.com. Would you like any other information about the website? Are you calling about advertisements?
  • the New Herald Large Type Weekly offers a select package of the week's news printed in 16-point type— about twice the size of the regular type size. With its updated, color-enhanced design, The Large Type Weekly is a striking—and clearly readable way to enjoy The New Herald. A mail subscription of The New Herald Large Type Weekly makes a great gift for yourself or someone you care for.
  • the New Herald Large Type Weekly offers a select package of the week's news printed in 16-point type-about twice the size of the regular type size. With its updated, color-enhanced design, The Large Type Weekly is a striking— and clearly readable way to enjoy The New Herald. A mail subscription of The New Herald Large Type Weekly makes a great gift for yourself or someone you care for.

Abstract

A method performed in a system having multiple navigable nodes interconnected in a hierarchical arrangement involves receiving an input containing at least one word identifiable with at least one keyword, identifying at least one node, other than the first node, not directly connected to the first node, but associated with the at least one keyword, and jumping to the identified node (fig. 6). A transaction processing system having a hierarchical arrangement of nodes and is configured for user navigation among the nodes (fig. 5). The system has an inverted index correlating keywords with at least some nodes in the arrangement so that when the user provides an input in response to a verbal description and the response includes a meaningful word correlatable with a keyword, the system will identify at least one node correlated to the meaningful word by the inverted index and jump to that node without first traversing any other node (fig. 9).

Description

NAVIGATION IN A HIERARCHICAL STRUCTURED TRANSACTION PROCESSING SYSTEM
FIELD OF THE INVENTION
The present invention relates to information processing and, more particularly, computer based transaction processing.
NOTICE OF COPYRIGHT RIGHTS
A portion of the disclosure of this patent document, particularly the Appendix, contains material that is protected by copyright. The copyright owner has no objection to the facsimile reproduction of the patent document or the patent disclosure as it appears in the Patent and Trademark Office file or records, but otherwise reserves all copyright rights whatsoever.
BACKGROUND OF THE INVENTION
In everyday life, networks of choices set forth in a particular order or hierarchy are encountered with increasing frequency. Usually, it is desired to traverse the network in the most efficient manner possible to accomplish a particular goal.
In modern mathematics, graph theory is used to study networks of hierarchical choices. The hierarchical networks can be represented as a graph structure. Graph theory finds practical applications in chemistry, computer science, economics, electronics and linguistics.
A graph structure is a collection of points, called "vertices", and a collection of lines, called "edges". Each edge joins a pair of vertices or a single point to itself.
A simple example of a network represented by a graph structure is a road map. The vertices represent towns or cities. The edges represent the roads that connect the towns and cities.
Another type of network familiar to anyone who has a telephone is an automated telephone voice response system, such as commonly utilized by many large companies, to direct incoming calls to particular individuals or departments or to assist the caller in performing a transaction, such as making a purchase.
That type of telephone network can also be represented as a graph structure. When the system answers an incoming call, it transmits a verbal description or prompt to the caller: "If you would like to speak to Harry, press 1; if you would like to speak to Fred, press 2". (In general, we will use "verbal description" to mean a set of words relating to the subject matter whether presented audibly or in written form. The verbal descriptions may range from a few words to an entire document worth of text). A first vertex on the graph represents the initial prompt, which a caller hears upon reaching the telephone response system. If the user's response is pressing 1, calls are directed along a first edge to Hany, represented by a second vertex. If the response is pressing 2, the call is directed along a second edge to Fred, represented by a third vertex. Then, if the chosen person is not available, the caller is asked whether the caller wishes to leave a message. If the response is positive, the caller is directed along another edge to the selected person's voice mail, which would be represented by another vertex of the graph.
In general, whether for a telephone response network or for any other application representable by a graph structure, the caller or user of the system will have some goal. By "goal" we mean a combination of transactions and information accesses which the user seeks to accomplish. By "transaction" we mean an operation performed electronically with a user. In general, there will also be a combination of vertices or nodes in the graph that best represent or are closest to the goal the user is trying to accomplish. We call these vertices the "goal vertices".
For the user, the object in navigating the graph is to get from the first vertex to the goal vertices. If this is not done as quickly and efficiently as possible the user may become frustrated and give up. Moreover, as the number of possible choices or nodes in the network becomes larger, the number of possible pathways between the first vertex and the goal vertices multiplies rapidly. Therefore, the ability to reach the goal vertex can become more difficult, require navigation of an excessive number of choices or nodes, or discourage a user before the goal vertex is even reached.
SUMMARY OF THE INVENTION
The present invention creates a method for navigating efficiently and naturally through a series of choices to obtain information, perform transactions, or accomplish some similar goal. The invention is implemented in a programmed computer that has a hierarchically configured decisional network that must be navigated as part of the processing and is constructed to accept inputs or data and process them in a manner that facilitates navigation of the network vertices more efficiently.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is an example graph representing a simple, generic hierarchically arranged transaction processing or decisional system suitable for use with the invention;
FIG. 2 is an example portion of a graph used to illustrate jumping among nodes in accordance with one variant of the invention;
FIG. 3 is an example portion of a graph in a simple interactive voice response ("iNR") system used to illustrate grouping in accordance with one variant of the invention;
FIG. 4 is an example portion of a graph in a simple interactive television program listing used to illustrate another variant of the invention;
FIG. 5 is an example portion of a graph in a simple geographic information system used to illustrate a further variant of the invention;
FIG. 6 is an example portion of a graph for a simple automated voice response system used to illustrate a more complex variant of the invention;
FIGS. 7 A, 7B, and 8-10 are collectively a flowchart illustrating an example setup process for use in accordance with an example implementation of one variant of the present invention; and
FIGS. 11-14 are collectively an overall flowchart illustrating an example process in accordance with a further variant of the present invention.
DETAILED DESCRIPTION
In graph theory, mathematicians refer to a "path" from one vertex in a graph to another specified vertex in the graph as consisting of a sequence of edges that connect the vertices between the first vertex and the final vertex. If the path contains an edge sequence that is "closed", meaning that it loops back on itself, the path is called a "circuit" or a "cycle". A graph structure is considered to be "connected" if there is at least one path connecting every pair of vertices.
Our invention is particularly applicable to transactional processing as applied to instances where graph theory can be used to represent the transactions as a set of options and when the options are structured according to a connected graph that contains no circuits. We call such a graph a "tree". We use the term "menu tree" for a network that provides a "menu" of options, typically presented as verbal descriptions, to assist a user in making a series of choices through which he or she is able to accomplish one or more of his or her information access or transaction goals. Informally, a "menu tree" can be regarded as a series of vertices in a hierarchy or ordered pattern, arranged in rows of increasing numbers of vertices. More precisely, a "menu tree" can be represented as a "tree" in which (i) the vertices are all the options provided anywhere in the "menu tree", plus a first vertex, (ii) every vertex except the first vertex, i.e., every "option vertex", is associated with the verbal description (or such other means) by which a "menu" presents that option, (iii) an edge connects the first vertex to each vertex that the first "menu" presents to the user as an option, and (iv) each other vertex is similarly connected by edges to every other vertex that the corresponding "menu" presents to the user as an option. As the number of options increases, so does the length of paths from the first vertex to goal vertices.
In overview, in accordance with the teachings of our invention, the user can navigate the graph or tree in a way that allows them to skip from one vertex to another vertex that may be many rows down the graph or tree and/or where the vertices may not be connected together by an edge. This eliminates the necessity for making many choices.
Particular implementations make it possible to jump laterally from one vertex to another if the navigation enters a wrong branch of the tree or if the user changes his goal. The approach is accomplished through associating each vertex with a verbal description (or prompt), and matching words in users' requests and responses with these verbal descriptions to enable the selection of vertices that may not be directly connected to the user's current location in the graph or tree by an edge.
In some variants, we create a system with the unique ability to learn by incorporating previously unknown words, keyword or synonyms of keywords so that the system modifies itself to thereby increase the likelihood that a user will efficiently and quickly reach the goal.
For purposes of illustration, the invention will be described by way of example, first using a series of simple examples followed by a more complex example of a more detailed and commercially suitable example variant, in the context of a menu-type automated telephone voice response system for a publication, a hierarchical network of the type that is frequently encountered and easily understood that implements a combination of some of the features of the simple examples in order to illustrate how those features can be combined or overlayed. « :.
It should be understood that the present invention is applicable to a wide range of different networks, which can be mathematically represented by graph structures consisting of vertices and edges and should not be considered to be limited to the particular application described. Representative examples of suitable applications for the invention mclude implementing an enhanced and more efficient "Find" function or file system browser for personal computer operating systems, a navigation system for television program listing, document management or retrieval systems, a "geographic information system" in an automobile that allows location of addresses or business(es) meeting certain criteria, or other devices that incorporate some hierarchical navigation aspect as part of its operation.
In order to more fully understand the invention, various independent aspects are now presented below by way of simple illustrative examples. In this manner the teachings of the invention can be understood in a way that makes it possible to use, overlay and/or combine those aspects in a beneficial manner in an implementation of the invention. Depending upon the particular implementation of the invention, one or more of the aspects may be used together in various permutations and/or combinations, with the understanding that different permutations and/or combinations may be better suited for particular applications or have more or less benefits or advantages than others.
The underlying scenario common to all these basic examples is that there is a hierarchical arrangement to the possible choices that can be illustrated in a form of "tree" structure.
FIG. 1 is an example graph 100 representing a possible hierarchically arranged transaction processing or decisional system suitable for use with the invention. The individual boxes 102 - 120 are referred to as "nodes" and each represents a specific choice or option in the hierarchy. For purposes described in more detail below, each node is arbitrarily uniquely identified in some manner. In the example of FIG. 1, the individual nodes 102 - 120 are numbered 1 through 10 starting from the top node 102 in the hierarchy.
Each "node" is associated with exactly one verbal description, for example in the case of an airline system, a verbal description relating to some aspect of the reservation process. Each such description contains "key" words that are deemed to be of importance and other words that can be disregarded. For example, one node may have the associated verbal description "Would you like to make a reservation?" In this description, there is only one "key" word - "reservation" deemed important, so all of the other words in the description can be ignored.
A level in the hierarchy below that one may be used to obtain further narrowing information, for example, using the verbal description "Is the reservation for a domestic or international flight?" In this description, the terms "domestic" and "international" are "key" words. Similarly, the word "flight" could be a "key" word, for example, for a system that involves not only airline travel but also rail and/or cruise travel or it could be an "ignored" or stop word for a purely airline related system because it has minimal meaning in that context. Again, the other words can be ignored as well.
The unique identification of each node allows the creation of a list of all the key words and their associated nodes so that, if a key word is duplicated in two or more nodes, it need only be listed once. For example, a hierarchical tree related to "pens" might have nodes for ball-point pens, fine point pens, medium point pens, fountain pens, felt-tip pens, quill pens, erasable pens, etc. By using this approach, one could list the keyword "point" once, but associate it with each of the nodes where that keyword appears by using the unique identifier for each node where the term appears.
In this manner the keywords are obtained from the collection of available descriptions found in the particular application in which the invention will be used. In addition, each particular node where the keyword appears is associated with the keyword. Thus, with respect to the pen application above, the keyword "point" might appear in nodes 2, 3, 6, 7, 13 and 15. Similarly, the keyword "erasable" might appear in nodes 3, 4, 5, 6 and 22. An index, as described more fully below, associating these keywords with the nodes containing them is then created, for example: point: 2, 3, 6, 7, 13,15 erasable: 3, 4, 5, 22
By making use of these associations the "tree" can be negotiated by allowing presentation of relevant verbal descriptions for the nodes associated with a term, irrespective of where in the hierarchy they are, thereby causing a "jump" to a particular node without necessarily traversing the tree in the rigid hierarchical manner.
Various examples will now be presented to illustrate certain concepts related to the invention. It should be understood that while these examples are presented in the context of things and likely experiences of ordinary people, the same approach can be applied to other forms of transaction processing including navigating through hierarchically nested data files in a computer system, pattern analysis or image processing, etc. the term "transaction" as used herein relating to traversal through a hierarchy to a goal, not mathematical calculation per se.
Moreover, the specific formats used and presented in these examples are purely for illustration purposes. It should be understood that that other techniques for interrelating data, such as hash tables, direct or indirect indexing, etc. can be substituted in a straightforward manner. Thus, for example,, the relationship between the word and a node could be configured such that the location of the word in a list as the "n-th" item could be used as an index into another list containing the nodes correlated to the list. A similar approach could be used for the thesaurus, the important aspect relative to the invention being the relationship among certain words and the node(s) in which they occur and, where applicable, the relationship between certain words and "synonyms" for those words, not the data structure or its form or format whereby that information is kept or maintained.
Example 1
Example 1 illustrates, in simplified form, how an index is used to jump among nodes with reference to FIG. 2. In this example, the hierarchical tree 200 represents a portion of a more complex tree specifically involving possible decision relating to fruit and a decision between two specific types of fruits, an apple and an orange.
In prior art hierarchical trees, navigation of this graph 200 would necessarily involve going through the "fruit" node 202 in order to reach the "apple" 204 or "orange" 206 nodes. As a result, assuming this simple tree was part of a larger tree for an on-line supermarket that prompted the user for what they wanted to purchase, the exchange would be both rigid and time consuming. For example, in response to a prompt "What do you want to purchase?" if the response was anything other than "fruit" traversal to the "fruit" node 202 could not occur. At the point in the tree that would lead to the "fruit" node 202, neither apple nor orange would be an acceptable response.
In accordance with the invention, assuming the only relevant keywords for that portion of the tree were "fruit", "apple" and "orange", an inverted index would be created that includes an association of "Fruit" with the top node 202, "Apple" with the bottom left node 204, and "Orange" with the bottom right node 206. As shown above, that association can be created using node identifiers, in this example, the node identifiers 1A01, 1A02 and 1A03 are arbitrarily assigned and used. Thus, the information can be stored in a file, for example, as follows:
Fruit, 1A01
Apple, 1A02
Orange, 1A03
Accordingly, to navigate the system 200, when a response to a verbal description is provided by a user, possible keywords are identified in the response and used to search the index and identify any node to which the response may be directed, irrespective of the hierarchy. Thus, a user response of "an orange" to a verbal description located above the "fruit" node 202 in the hierarchy, for example, "What would you like to buy today?" would cause the system to identify "orange" as a key word from the response, search the index, and directly identify node 1 A03 (206) as the node whose verbal description should be presented next, thereby avoiding the need to traverse intervening nodes, for example, through the "fruit" node (202) 1 A01, at all. This illustrates an example of a simple jump according to the invention.
Example 2
Having illustrated a simple "node jump" a more complex (and likely) scenario can be shown. In this example, the Example 1 graph of FIG. 2 applies, but relevant portion of the index is as follows:
Fruit, 1A01 Apple, 1A02, 2F09
Orange, 1A03
As a result, there are two nodes relevant to the keyword "apple" one being the node 204 in the portion of the graph shown in FIG. 2 and one in the node uniquely identified as 2F09 located somewhere else in the hierarchy (not shown).
In this example, a user response containing the keyword "apple" would identify nodes with identifiers 1A02 and 2F09. In this case, and unlike the prior art, the verbal descriptions from both nodes would be presented to the user, likely in alternative fashion. Thus, if the user did not want an apple, they wanted apple cider, node 2F09 might be more appropriate because it is part of the "drinks" portion of the overall hierarchy.
Thus, presenting the user with the verbal description from both nodes would likely result in a jump to the portion of the graph nearer to node 2F09 since it is closer to the user's goal thereby speeding up the process and avoiding potentially confusing or frustrating the user.
Example 3
While the verbal descriptions associated with various nodes will generally be chosen to accurately represent the node, in accordance with certain variants of the invention, it is possible to create a situation where a user response takes them away from their ultimate desired goal. Nevertheless, by using the teachings of the present invention, the user can often still be brought to their goal quicker than possible with the prior art because the user need not rigidly trace through the hierarchy. This is accomplished by virtue of the "grouping" aspect inherent in some implementations of the invention.
This example illustrates the "grouping" aspect using a simplified graph 300 representing a portion of an airline reservation system as shown in FIG. 3.
In particular, the graph of FIG.3 can be thought of as part of a very simple interactive voice response ("IVR") system.
As described above, each node is uniquely identified, for example, by the numbers 1 through 7 and the identified terms "Reservation", "Domestic", "International", "Business Class", "Economy Class" are deemed the relevant keywords. Note, there is no requirement for a the "keyword" to be a single word, in some implementations, keywords could be single words, phrases of two or more words, or even some other form of information like a specific data pattern.
Again, an inverted index is created as described above associating those keywords with the nodes, in this case: Reservation, 1
Domestic, 2
International, 3
Business Class, 4, 6
Economy Class, 5, 7
Assuming that the top node is assigned the number 1, its two child nodes (Domestic and International) are assigned the numbers 2 and 3, and the grandchild nodes (i.e. at the lowest level in the hierarchy) have been assigned numbers 4, 5, 6, and 7 taken from left to right each node can be uniquely located. Note that the last two entries in the inverted index are each associated with two nodes, 4 and 6 in the first case, and 5 and 7 in the second.
Using the above, the concept of grouping of nodes from different parts of the graph (i.e. nodes that are not siblings or nodes that do not have a common parent) can be explained.
Presume that the response to a verbal description presented as an initial query of "What do you want to do?" was "Make a business class reservation." In this case there are two keywords present, "reservation" and "business class".
Depending upon the particular implementation, as noted previously, the verbal descriptions associated with each identified node could be presented together or in sequence. Alternatively, and as is the case here, a set of rules can be established, for example, such that if an,' identified node is a sub-node of another identified node, only the verbal description of the sub- node(s) is provided because of inherent redundancy. Thus, since both "business class" nodes 310, 314 are sub-nodes of the "reservation" node 302, the verbal description associated with the "reservations" node can be suppressed if it can be determined that business class necessarily implies reservations.
In this example, a search of the inverted index would identify nodes 4 and 6 (310, 314) from different parts of the tree are associated with the keywords in the query, and thus the system, in presenting the verbal descriptions from each, in effect, alters the tree structure and groups these nodes in the result. Thus, the combination of result nodes presented depends upon the user query or response, not that predetermined by the graph structure itself.
Of course, the goal would still not be reached because of the ambiguity caused by "Business Class" being under both "Domestic" and "International". However, that ambiguity can be handled by suitable wording of the following verbal descriptions and whether they are combined or provided sequentially or by other nodes. Example 4
A persistent and further drawback present in the prior art is the inability to operate if any term other than the specific allowed terms are provided. Thus, in an INR of the prior art, providing anything other than the recognized term(s) will likely result in meaningless repeat of the same inquiry by the IVR or an error.
Advantageously, the teachings of the present invention allow for construction of a more flexible system than available in the prior art. Specifically, we can incorporate a thesaurus to accommodate synonyms for the keywords.
Example 4 illustrates the addition of a simple thesaurus as an aspect of a system so that a synonym of a keyword may also be used by the system to jump to the desired nodes in the graph. Example 4 is discussed with reference to a portion 400 of an interactive television program listing system as shown in FIG. 4.
Such a system implementing the invention will allow a user to speak to or interact with a device to look for programs of his choice by time slot, genre, favorite actor or actress, etc.
This example, as with the other examples above, use an inverted index, in this case one where each node 402, 404, 406 is uniquely identified by a string of six characters, the portion of which corresponding to FIG. 4 is shown as follows.
Programs; acgyct
Sitcoms; ifgnxh
Films; vnymos
Since a common synonym for "Films" is "Movies" a thesaurus can be created associating the two. Depending upon the particular implementation, thesaurus terms to be equated to the keywords can be taken from a standard thesaurus or can be custom created for the particular application. In addition, the equating of terms can be done in any of a myriad of different ways, the exact implementation details of which however re irrelevant to the invention, but a few representative examples of which however are contained herein for purposes of illustration.
In one example case, the equating can be done on a purely word basis. For example, a file can be constructed such that one or more single word synonyms are directly associated with an index word, for example as follows:
Movies, Flicks - Films
Alternatively, the synonyms can be equated with the node identifier(s) corresponding to the index term, for example as follows: Movies, Flicks - vnymos
In the former case, the system would still have to search the index after the thesaurus has provided the proper index term(s). In the latter case, the thesaurus provides a direct link to the respective node(s) so that re-searching is not required.
In the system of Example 4, a user who provides the input "Movies" would cause the processing to occur as follows.
The system would search the inverted index of keywords and fail to locate "Movies" as a keyword. As a result, it would search the thesaurus and find that the word "Movies" is a synonym that can be correlated with a keyword. At this point, depending upon the particular thesaurus, it would either return to the inverted index and search using the synonym keyword "Films" and return the result as the node 406 identified by "vnymos", or go directly to the node 406 identified by "vnymos" based upon the thesaurus entry.
Of course, it is possible (and likely) that in actual usage a synonym will be associated with more than one keyword. For example, "Comedies" may be associated with both the keywords "Sitcoms" and "Films", resulting in, for example, the following entry in a thesaurus:
Comedies - Sitcoms, Films
In this case, a search for "Comedies" would result in the system identifying that the synonym was associated with nodes 404, 406 for both "Sitcoms" and "Films", and it would return; both terms or node identifiers corresponding to the two keywords as the result.
Example 5
Advantageously, the thesaurus concept can be extended further so that an initially unknown word (i.e. a word that is neither a keyword nor a thesaurus word) can be learned by the system and added to a thesaurus for future use.
This example is described with reference to FIG. 5 which is a portion 500 of a larger system graph as part of a very simple "geographic information system" found in some automobiles, kiosks and elsewhere today. Such a system enables a user to, among other things, identify and get information about different locations in an environment. For example, information about particular types of restaurants in an area.
In this example, the inverted index for the portion 500 shown in FIG. 5 could look as follows:
Restaurants, 1
Pizza, 2 Burgers, 3
Chinese, 4
A user issues the following query to the system "fast food" in order to find a quick meal.
The system's search of both the index and thesaurus would result in the "term", in this case a phrase, not being found in either. In this case, it is an unknown phrase, and the system has to learn the "meaning" of the term.
To do this, the system first offers the verbal description from the top level node(s) 502 to the user - in this example, just "Restaurants". The user presumably provides a positive response. (Of course, in a real system, it is possible and likely there are more top level nodes than just one. In that case, the user would be offered two or more of these nodes, and would have to select "Restaurants" to match his intended request.)
Continuing on, once the user has responded affirmatively, the system moves down the tree and offers the verbal description from each of the child nodes: "Pizza" (504), "Burgers" (506), and "Chinese" (508). Presuming that the user picks "Pizza", the transaction interaction would look something like this:
User: Fast food
System: Restaurants?
User: Yes'
System: Pizza, Burgers, or Chinese?
User: Pizza
At this point, the system has "learned" for the time being that it can equate "fast food" with "pizza" and can add "fast food" as a synonym to "pizza" in the thesaurus.
This user, who first used the unknown term "fast food", had to trace a path down the tree. However, now the system is able to associate "pizza" with "fast food" and create or add a thesaurus entry to reflect this association, for example as follows:
Fast food - Pizza
Thus, the system has learned a meaning of the initially unknown term "fast food" and has added it to the thesaurus for future use.
As a result, a subsequent uses of the same term "fast food" will enable the system to jump directly to the "pizza" node 504.
Example 6
This example illustrates how additional meanings for an existing thesaurus term or phrase can be learned by the system for future use, whether the existing thesaurus term or phrase was an original thesaurus term or one previously learned with continuing reference to FIG. 5.
At this point, the inverted index is unchanged as:
Restaurants, 1
Pizza, 2
Burgers, 3
Chinese, 4
Additionally, presume the following entry now exists in the thesaurus.
Fast food - Pizza
Suppose a new user now issues the query "fast food" as above, but with "Burgers" rather than "Pizza" in mind.
Based upon the thesaurus, the system would go directly to the "Pizza" node. However, the user will reject "Pizza", having "burgers" in mind. By rejecting the "Pizza" node 504 description, the user indicates that the "Pizza" node 504 is not of interest. The system is therefore configured with a further set of rules, in this case one in which the system goes up in the hierarchy to a higher node, the top node 502 in this portion of the example, and provides the verbal descriptions for the other nodes 502, 504, 506, 508 so as to cause a tracing down the tree. This can be illustrated by the following "dialog":
User: Fast food
System: Pizza?
User: No
System: Restaurants?
User: Yes
System: Pizza, Burgers, or Chinese?
User: Burgers
This time, although this user has had to trace through at least a portion of the path from a higher-level node 502 of the tree 500, the system has learned yet another meaning for "fast food". It now adds this meaning to the earlier entry in the thesaurus, for example as:
Fast food - Pizza, Burgers
It has now learned two meanings for future use. If a user were now to issue the query "Fast food", the system would respond with the verbal descriptions from the nodes 504, 506 corresponding to both Pizza and Burgers. Thus, the system can keep learning new meanings of terms based on the intended meanings of users "deduced" from the interactions between users and the system.
Of course, the nature and extent to which the system will incorporate synonyms and/or keywords in a continual learning process will not only depend upon its construction and rules, but also on the quality of the original thesaurus and the quality of the initial inverted index. In addition, where in the tree the system jumps if the user rejects the initial meaning(s) offered by the system can be handled different ways in different implementations.
For example, the system can always jump to fixed ancestor(s) (either the top node or a parent or some ancestor(s) at an intermediate point) or a fixed level (e.g. halfway from the top). This approach has the advantage of being simple to implement, but it has the problem of inflexibility because it may be relatively efficient for certain graphs and associated verbal descriptions, but not for all. For example, if two or more nodes' verbal descriptions are offered and rejected, the relevant node selected would have to be common ancestor(s) of the offered nodes, h other words, with reference to Example 6 which is part of a larger tree, going up to the "Restaurants" node 502 would mean going to the parent of the "Pizza" node 504 rather than all the way to the top in the larger tree containing the portion 500 shown.
A more flexible alternative uses the information recorded in the thesaurus to find every synonym for "pizza" in the thesaurus and collect all the other keywords associated with those ■ ,-v synonyms. Then the system would search the inverted index to identify all the nodes associated with these other associated keywords and identify the most common ancestor of all of those nodes and go to it. By using the information in the thesaurus in this way the system makes use of known properties of the one meaning of "fast food", which is "Pizza", to construct an intelligent hypothesis about where the other meanings of "fast food" might lie in the graph. This allows the user to reach another meaning with the least effort and allows the system thereby to learn what the new meaning of "fast food" is more efficiently.
Example 7
Of course, just as it may be desirable to create implementations to add meanings to the thesaurus, it may be equally or more desirable to cause an existing meaning for a thesaurus word to be dropped, for example, due to relative lack of use. This process is described with continuing reference to FIG. 5 and the associated inverted index, particularly with respect to the thesaurus entry resulting from the most recent example.
Fast food - Pizza, Burgers In this example, presume that there have been several uses of the query "fast food" and that the user(s) issuing these queries have almost always selected "Burgers" and almost never "Pizza".
In accordance with another implementation of the invention, the system is constructed to track the frequency of use of a particular term in the thesaurus. Depending upon the particular implementation, the tracking can be done for all entries in the thesaurus, for only those added as part of the "learning" process, or for some specified combination thereof.
In addition, some specified criterion is used to determine when, and which terms, if any, should be removed from the thesaurus. Depending upon the particular implementation the criterion can be based upon usage relative to time, usage of a particular term relative to some other term(s), term usage relative to overall thesaurus usage, or simply elimination of all added terms not used since the last purge.
Thus, presuming that the system has kept track of the frequency of use of different meanings of "fast food", and that "Pizza" does not meet the criterion for a sufficiently high frequency, the meaning "Pizza" can be dropped as a synonym for "Fast food" and the entry (after , purging) would look as follows:
Fast food - Burgers
Thus, a further enhanced implementation can be constructed so the system is dynamically * updating the thesaurus, either adding meanings or dropping meanings for existing and/or initially unknown words.
Example 8
A further advantage to the invention is that, in some implementations, it can be configured so that, when there are multiple relevant nodes to be presented, an associated ranking can be used to determine the type, method or order of presentation. For example, the ranking can be based upon the frequency of use of particular nodes, which is tracked in these implementations, so that the most frequently selected or used nodes are presented first, more prominently, or in a particular manner.
For example, this can be illustrated by continuing from Example 1, where the thesaurus entry was as follows:
Fast food - Pizza, Burgers Under the assumption that the system has been tracking the frequency of usage of the "Pizza" node and the "Burgers" node and each has been accessed an identical number of times. When a user enters the query "Fast food", as above, the system presents the user with both the "Pizza" node 504 and the "Burgers" node 506, but because it tracks usage and the usage is the same, it presents them in the order they are listed, i.e. "Pizza" and then "Burgers". However, at this point, the user's selection will cause one entry to have a greater frequency of usage relative to the other entry, for example a selection of "Burgers" will make it have a higher frequency of usage and, accordingly, a higher ranking for the next instance of use.
Thus, the next time the system will be presenting both the "Pizza" and "Burgers" nodes to a user, the "Burgers" node 506 will have the higher frequency of usage and, accordingly, will be presented first, or more prominently, or in some other specified manner because of its ranking. If the frequency reverses with use so that the "Pizza" node 504 outranks "Burgers" node 506, then the "Pizza" node 504 will supplant the "Burgers" node 506.
Example 9
A further variant of Example 8 allows the node rankings to be used to prune the nodes themselves, hi this variant, a criterion can be specified, typically zero usage over a long specified period of time, that is used to remove an entire node. This is advantageously made possible because of the system's ability to "jump" among nodes. Thus, it may occur that a node within the tree is never accessed, but a child node of that node is. In some variants therefore, when this state exists for a sufficiently long period of time, the system is constructed to delete that node. It should be understood that, if handled properly, this process will not even affect the "learning" process because, even if no user action ever directly causes the node to be presented, if the learning process causes the node to be presented the node's access frequency will be non-zero and it will not be "pruned".
In addition, by tracking access frequency on a node basis, a qualitative evaluation of the hierarchical system can be made and visualized. This makes it possible to review the overall hierarchy after some period of time and periodically optimize it based upon the result instead of relying purely upon the dynamic optimization that inherently and naturally flows from use of the teachings of the invention.
Having now described various component aspects of different variants implementing the invention, by way of the above examples, it should be understood that the "jumps" can occur from any node to any node, i.e. vertically and/or laterally and to another node that is higher, lower or on the same "level" as the node from which the jump is made. All manner of vertical and lateral jumps from multiple nodes to multiple nodes are possible. In addition, it should be understood that in some applications (like document retrieval systems) the verbal description from the identified node may be the one issued whereas, in others (like an IVR system), the verbal descriptions for the children of the identified nodes may be what is presented. Nevertheless, in both cases, the process as described above by way of example will be the same or directly analogous.
Having described the various aspects individually a more commercially suitable example, employing a combination of the above examples, can now be presented with reference to FIG. 6 which illustrates a simplified example of an "interactive voice response unit" (IVR) hierarchy 600 that might be used in the airline industry. Of course, a real menu tree used in an IVR may have any number of nodes from several, up to a thousand, or more. For example, a tree with 4 branches from each node and which has 5 levels uniformly would have 1365 nodes. As shown in FIG. 6, the tree 600 is a hierarchical tree and consists of the following nodes and branches:
Initial start (node aO) 602 domestic flight arrival information (node al) 604 domestic reservations (node a2) 606 international flight arrival information (node a3) 608 international reservations (node a4) 610 The node 604 identified by al is a service node with pre-recorded information. The node 606 has two child node a 2, first/business class (node a5) and economy (node a6). The node 608 identified by a3 is service node with pre-recorded information. The node identified as a4 has three child nodes identified as first class (node a7), business class (node a8), and economy (node a9).
The nodes 612, 614, 616, 618, 620 identified as a5, a6, a7, a8, a9 are all service nodes (i.e. terminal nodes) where a respective customer service representative will interact with the caller.
Of course, a real system may also have a choice at the top level or at each level for a live operator and may even have a choice to go back to the previous menu.
Even for such a simple example, in a traditional interactive voice response system, the caller would have to listen to several choices and then traverse a path down to a service node. Someone interested in business class reservations on a domestic flight would have to traverse the path (aO, a2, a5) for example. This involves listening to multiple choices at each level of the tree (e.g. first a prompt at aO, then four prompts offering al, a2, a3, and a4 at the next level, at which the caller would choose a2, and finally two prompts offering a5 and a6, at which level the caller would choose a5 and then wait for the operator) and then making a choice by pressing an appropriate number on the telephone dial pad or alternatively saying the appropriate number. In certain cases, he may make a mistake: he may choose international reservations when he is interested in domestic reservations or something similar (simply by pressing the wrong number on his touch-tone telephone or saying the wrong number). If he does, then he has no choice but to disconnect the phone and redial the number (or if the system has a backtracking option, then he can backtrack, but even here he has wasted valuable time). h contrast, in accordance with a system implementing the invention, the caller would be able to say what he was looking for (e.g. "I want to make a domestic business class reservation") and the system would identify and respond with the appropriate node 612 (e.g. a5 in this case or the relevant customer service representative directly), hi other words, it would enable the caller to skip to the correct node(s) without having to trace through the entire path. If the user makes a mistake, he could ask for something different wherever he finds himself in the tree, and skip laterally or vertically to his preferred choice.
The system implementing the invention can further include an option that the entire transaction (e.g. the making of the reservation) would be carried out through natural language interactions with the system without the intervention of a human customer service representative. In other words, all the details of his domestic reservation are obtained by the system and the system updates a database accordingly and issues whatever commands are required (e.g. the mailing of a ticket) to be carried out by some human representative later.
While it is true that some more advanced interactive voice response systems available today allow for natural language interactions, they are highly constrained natural language interactions with relatively little or no intervention by a human operator. However, unlike with systems using the invention, those systems still require direct path traversal through the hierarchy (i.e. jumping to non-connected nodes is not contemplated or possible, let alone allowed). Moreover, such systems still typically use a limited list of keywords, which the caller is required to use to correctly traverse to the next connected node.
In contrast, variants of a system implemented in accordance with the invention can incorporate an automatically generated or updated thesaurus, which greatly expands the range of words or terms a caller can use. hi these variants, the user is not restricted to parroting the highly constrained script as required by other interactive voice response systems, nor is the user limited to traversal to a connected node. In these more complex implementations of the invention, a system can be constructed that is able to learn new words or terms that it may not have understood the first time. For example, if a user asks for "coach class" and the system does not have the word "coach" or the phrase "coach class" in its keyword list or in its current thesaurus, then on this first occasion, it offers the user a traditional path down the conventional tree. But it tracks what the user did, what node of the tree the user went to, and on this basis, it learns a new response to "coach class". The next time a caller (either the same person or a different person) uses the words "coach class" the system does not offer the traditional path as it did the first time, but instead it offers a new set of nodes based on what it learned the first time. Thus, in such implementations, the thesaurus is a dynamically changing entity, continually updating itself by learning new words and terms and learning new "meanings" (i.e. new actions or responses) for existing teπns.
Implementations according to the invention can also allow novel groupings of nodes to be presented to the caller based on his query. If he asks for "economy class" without specifying whether he wants an international or domestic reservation, then the system would offer him the nodes a6 and a9 (appropriately phrased in natural language), and allow him to further choose whether he wants international or domestic reservations, something current systems do not offer. In other words, the system can pick out the relevant responses from different branches of the tree and pool them togefherand offer them to the caller.
This functioning of the system, by which it is able to skip around laterally or vertically in the tree, is enabled by the associating of natural language (i.e. human language) verbal descriptions with each node, and then using these as an initial basis for the navigation, augmented, in some variants, by a dynamically changing thesaurus that greatly expands its range and comprehension.
Thus, based upon a conceptual understanding of the above examples, further details of the process will now be presented.
The flowcharts of FIGS. 7 through 14 are illustrative of a functional example of the general method of a more complex variant the invention as would be implemented in software according to the flowcharts in this case for a newspaper subscription application. It should be understood that particular details are provided in the description below merely for completeness or because they are necessary or helpful for forming an understanding of the particular implementation. They are not to be considered essential for implementing the invention. Similarly, details unrelated to or unnecessary for understanding the invention have been omitted to avoid confusion. An example implementation is described and contains two programs, a preparatory program, illustrated in FIGS. 7-10 and a transaction or query processing program, illustrated in FIGS. 11-14. In addition, a particular software implementation fairly corresponding to the flowcharts of FIGS. 7 - 14 appears in the Appendix A that follows. The program contained therein, is written in the "C" programming language for execution on any personal computer having a processor, memory , input-output, etc. capabilities to run the particular application in its intended environment.
Broadly, the first program process of FIGS. 7-10 constructs an inverted index and an application-specific thesaurus and the second program process of FIGS. 11-14 uses those constructs in a transaction processing system to interact with a user.
In the preparatory program of FIGS. 7 A, 7B and 8-10, the shorthand names of files that the program uses and the contents of the corresponding files are as follows. Notably, both the process parts shown in FIG. 7A and 7B as well as the process part shown in FIG. 8 are indicated as start points. This is because they are each independent of each other in that any of the three could start before any other or two or more could be run concurrently. Thus, it should not be presumed that hey are mutually exclusive or any one is per se required for the invention. Moreover, it should be understood that any one or more could have been undertaken. at a different time, by a different entity, or for a different application. Whether one or more of the portions shown in FIG. 7A, FIG. 7B or FIG. 8 are the starting points, the starting point for actual operational processing will be the same.
The file named 'p' contains a list of prompts or verbal descriptions in a hierarchical relationship (i.e. they can be visualized or arranged in a tree-type graph).
The file named 'w' contains documents that are related to the prompts or verbal descriptions in 'p'. For example, 'w' could contain a training manual for customer service personnel or a website document that is likely to contain material that is related to the queries customers may have. This file is used to create a thesaurus.
The file named 'f contains forms that are used to elicit relevant information from customers. They have fields like 'name', for example, which would be used by the system to ask and record a caller's name.
The file named 'x' contains an index associating the forms in with terminal prompts or descriptions in 'p'. Once a terminal prompt is reached in the process, the corresponding form from the file 'x' is activated, and the system proceeds to elicit information from the user. The file named 's' contains a list of application-specific stop words, many of which are high-occurrence and/or generally uninformative words like 'a', 'an', 'the' or 'from' or words with a high-occurrence in for the particular application such that they have little meaning, for example, 'fly' in an airline reservation system, 'street' in a navigation system, 'file' in a computer search tool. These are eliminated from 'p' and 'w' and 'f before processing, because they don't carry any useful information for the application.
The file 't.cfg' contains the thesaurus and inverted index that will be constructed by the program. Of course, in alternative variants, the thesaurus could be a separate file from the inverted index file and either or both could be made up of multiple files.
The file 'l.cfg' is a file that is used to store newly learned words. As with the t.cfg' file, the 'l.cfg' file need not be a separate file, it could be part of 't.cfg', or part of a separate thesaurus and/or inverted index file. Similarly, the 'l.cfg' file could be made up of several files.
With reference to FIGS. 7 A, 7B and 8 through 10, the processes as carried out by the first program are as follows. It bears noting that, although the process and its components are presented by way of example in a particular order, unless a specific process component is expressly stated to necessarily have to occur at a particular time or after some other particular process component, or two process components must necessarily occur in sequence because one , relies upon completion of the other before it can start, no order should be implied or considered yi required since the order in different implementations may be different and may vary based upon the particular programmer, programming language and or computer involved.
The files p, w, f, x, and s are each read and processed as follows. It should be understood that the order of processing of file 'p' relative to file 'f or their respective sub-processing components, although shown sequentially, could be done in a myriad of ways including doing each of the reading extracting and storing concurrently or as a common operation (i.e. reading for both is done before extracting for both, etc.).
Specifically, keywords are extracted from p and from f . These are initially just all the words or terms contained in the prompts in p. The keywords are stored, for example, in a temporary file.
Similarly, thesaurus words are extracted from w. These are initially just all the words or terms in w. They are also stored, for example, in a temporary file.
Stop words are loaded from s (902) and stop words and duplicate words are eliminated from keywords and thesaurus words stored in the temporary files. The thesaurus is constructed in accordance with FIGS. 9 and 10 described in overview as follows: a. Increment the file of thesaurus words with keywords from p and f remaining after elimination of stop words. b. Create a matrix of thesaurus words as row words (or words listed along the rows of the matrix) against keywords as column words (or words listed along the columns of the matrix). c. Count the number of co-occurrences of each row word with each column word of the matrix in the documents contained in w and fill in that number in the corresponding matrix cell. (For example, a co-occurrence of a pair of words may be defined as that pair occurring in the same paragraph. If w is made up of a hundred paragraphs, then take each pair of row word and column word and count the number of times this pair occurs within the space of each of the hundred paragraphs in w. For each pair, the pair may co-occur zero or more times in a paragraph and add up the number of co-occurrences in all the paragraphs in w.)
This process yields a matrix filled with nonnegative integers in each cell. It is then possible to consider each row of numbers as a vector associated with the corresponding row word., When viewed geometrically, these vectors, one for each row word, form angles with each other in;'* a multi-dimensional space. As a result, we can calculate the cosine of each such angle by computing scalar products for the angles. Thus, we compute the cosines of the angles formed by the vectors associated with each pair of row words.
The cosine values for all pairs of row words and column words are calculated and stored, for example, in a new matrix.
For each row word, the top 'n' cosine values are identified as are the corresponding keywords. For example, in an airline system context, if there are two row words 'coach' and 'economy', where 'economy' is also a keyword (originally from p and/or f), and if the cosine value of this pair or words is among the top 'n' cosines for the word 'coach', then 'economy' is identified as a synonymous keyword for coach.
A new file can then be created, formatted for example, by listing thesaurus words on the left (e.g. coach), and against each thesaurus word, its associated keywords (e.g. economy). This is referred to as an inverted index (i.e. the thesaurus) of row words and their keyword synonyms. Essentially, this file will now contain words like 'coach' coupled with its particular alternative meanings, one of which may be 'economy'. The user interactive transaction processing program, the second program, will later use this thesaurus file when a caller uses a word like 'coach' in his query to determine the relevant keywords (like 'economy'). This will enable the program to find the relevant prompt with which to respond to the user.
Optionally, to provide the system with a set of prompts or verbal descriptions with which to respond to a user, another inverted index is created using the files p, f, and x. This index will contain a list of keywords from p and/or f associated with the prompts in which they occur. Thus, when a user uses a synonym like 'coach' in a query, the second program will look up the thesaurus, find the keywords corresponding to it (e.g. 'economy'), and then look up the inverted index to find the prompts corresponding to 'economy' and other corresponding keywords.
Once both the inverted index and thesaurus files have been created, the file t.cfg can be created from them for use by the second program.
One example of the program flow for a fairly generic transaction processing program implementing one variant of the invention is illustrated in the flowcharts of FIGS. 11 through 14. This example is configured to incorporate a collection of several of previously described simple aspects. To demonstrate the functions of this program and how this program operates, for context, we use an example interaction that a calling customer might have with this example system.
Following the example is the Appendix contains that program code essentially implementing a variant of the invention largely corresponding to that of FIGS. 7 through 14.
The particular example we use for purposes of illustration is for an automated telephone system for a newspaper, like the New York Times. For simplicity, every item in the flowchart is not traced through since, an understanding of the process with respect to one path will be sufficient to allow an understanding of the other paths.
The example begins with "I want to subscribe" uttered by the caller to the system. We will assume that the first three words of the query (i.e. "I", "want", and "to") are stop words and the last word (i.e. "subscribe") is neither a keyword nor a thesaurus word.
The process as carried out by the second program are as follows:
The files t.cfg, l.cfg, f, x, and s are read (1102).
The keywords, thesaurus words, prompts from t.cfg. are loaded (1104), as are the learned words from l.cfg. Initially, l.cfg will be empty as the program has not yet learned any new words. The forms and index of forms against prompts from f and x respectively are loaded, as are stop words from s. The program opens the interaction with a greeting (1106) and an elicitation of the first query from the caller (1108). This might be: "Thank you for calling the New Herald. How may we help you?"
The caller then utters his or her statement: "I want to subscribe".
The stop words in the statement are first eliminated, leaving behind just the word "subscribe".
The statement is then processed in the following way:
The keywords and the thesaurus words remaining in the query are identified (1202, 1204) by comparing with the list in t.cfg and l.cfg. As we have assumed that "subscribe" is neither, we have none.
The prompts that best match the identified keywords and thesaurus words are selected (1206). As there are no such words identified, there are no prompts selected.
The program arrives at a decision in the flowchart: are any nodes selected? (1208). Since the answer is in the negative, the program will follow the branch and select the top level node (1218). (Note: These top level prompts are the ones at the top level of the menu tree.) This completes the prompt selection process. The process then proceeds to the second part of the query process.
The process proceeds with another decision: has a single leaf prompt been selected? (1210). Since the top level prompts are selected (of which there are more than one and also none is a leaf prompt), a negative answer is the result.
These prompts or verbal descriptions are issued to the user (caller) and elicit another response. Assume that the offered verbal descriptions are as follows: System: Are you calling about subscriptions?
System: Is there a problem with your paper or delivery?
System: Would you like information about the New York Times website?
System: Are you calling about advertisements?
System: Are you calling about something else?
Assume further that the caller responds as follows: User: I am calling about subscriptions.
As a result, the program returns to selecting verbal descriptions by identifying the keywords and the thesaurus words remaining in the query by comparing with the list in t.cfg and l.cfg (1202, 1204). "Subscriptions" is now synonymous with a keyword and it is identified. The program will again select verbal description(s) that best match the identified keywords and thesaurus words (1206).
For example, assume these are: System: Would you like to order a subscription?
System: Would you like to give a gift subscription?
System: Would you like to change your address or change any other information?
The program then arrives at a decision branch (1208) in the flowchart: are any nodes selected? Since the answer is affirmative, it follows that branch and exits the prompt selection process and returns to the query process.
This begins with another decision box: is a single leaf node selected? (1210). The answer is no, since tliree prompts have been selected.
Next, these verbal descriptions are issued to the caller and the system will await his response (1220). We assume the caller responds as follows: User: I want to order a subscription
The program will again return through a loop to the prompt selection process (1202, 1204; 1206) where the program will identify the keywords and the thesaurus words remaining in the query by comparing with the list in t.cfg and l.cfg. "Order" and "subscription" are now identified.
Verbal descriptions are selected that best match the identified keywords and thesaurus words. Now assume this is just the prompt "Would you like to order a subscription?" from the three descriptions above.
The program will then arrive at a decision branch (1208) in the flowchart: are any nodes selected? Since the answer is affirmative, it follows that branch and exits the prompt selection process and returns to the query process to again arrive at a decision: has a single leaf node been selected? (1210). This time the answer is yes, a single prompt has been reached, which is also a leaf prompt, since it is at the bottom of the menu tree.
This is followed by another decision: any verbal description corresponding to the node? (1212). The program checks t.cfg and finds the answer is no.
The branch then leads to yet another decision (1214): is a form for verbal description available? The answer by checking the index x is the yes branch. This leads to the portion of the flowchart of FIG. 13.
The form is processed in the following way:
The first part is a decision: is it a response form? (1302). The answer is no. The system then issues questions to the caller based on the form and accepts information back (1304). The questions are of the form "Please tell us your name", "Where do you live?", "Do you want an annual or half-yearly subscription?" etc. The caller provides the information to the system.
It repeats the information the caller has given the system and asks if the information is correct. Let us assume the user confirms that the information is correct.
The system then calls an external routine to store the information in a database. The routine returns another form to the system (1306) and returns in a loop to the question: is it a response form? (1302). Since the form contains questions about the payment, based on the type and period of subscription selected by the caller, the answer will be negative.
The system then issues these questions to the caller and the caller provides the required information (1304).
The system then repeats the information and gets a confirmation from the caller.
The information is passed to another routine (mentioned in the form) to update the database. This routine (1306) then returns a response form and again returns in the loop to the question: is it a response form? (1302). This time the answer is yes. The system then issues a response (1308) thanking the caller for the subscription, and exits this process returning to FIG. 11.
The system now exits the query process as well since the caller's query has been completely processed and the corresponding actions taken by the system. It now returns to the main part of the program.
The next process in the main part of the program is a question: is there an unknown word in the caller's query? (1112). The answer is yes, since the word "subscribe" in the initial query was not known to the system. This invokes the portion of the flowchart of FIG. 14.
The system therefore has to learn this previously unknown word:
The learning process begins with a decision: is the word already in l.cfg? (1402). The answer is no, since l.cfg is initially empty and the word has not been encountered before.
The corresponding "NO" branch is followed and the word is added to the list of learned words (initially empty) with keywords from the final single leaf prompt that was selected (1404).
The system then records these changes in l.cfg (1408) and returns to the main part of the program in FIG. 11. It has now learned the meaning of the initially unknown word "subscribe".
Next, the program asks the caller if he wishes to continue (1114) (i.e. are there any further queries). We assume the answer is no and the system thanks the user and exits.
Now, having described the example traversal of one path through the second program with reference to the flowchart, an example dialogue for the path traversal that has taken place is presented so the complete transaction can now be understood. Dialogue:
Caller: I want to subscribe
System: Are you calling about subscriptions?
System: Is there a problem with your paper or delivery?
System: Would you like information about the New York Times website?
System: Are you calling about advertisements?
System: Are you calling about something else?
Caller: I am calling about subscriptions
System: Would you like to order a subscription?
System: Would you like to give a gift subscription?
System: Would you like to change your address or change any other information?
Caller: I want to order a subscription
System: Please tell us your name
Caller: Bertrand Russell
System: Where do you live?
The dialogue continues in this way with the system eliciting the required information from the caller.
Having demonstrated traversal in a system where the system was constructed to learn when an unknown word is used, what happens the second time a caller uses the same word "subscribe" in a query after it has been learned by the system can now be demonstrated. This demonstrates the power of including the optional feature of learning in the program.
In this case, the dialogue that occurs when a new caller uses the word "subscribe" following the above is now presented. Dialogue:
Caller: I want to subscribe
System: Please tell us your name
Caller: J. L. Austin
System: Where do you live? Thereafter, the process continues. Notably, the system has now learned the correct response to the query "I want to subscribe".
Other Variants
Having described several simple and more complex examples that make it possible to use the invention, other variants can now be presented. Examples of such optional functions that can be incorporated into other variants, individually or collectively, include: a) creating the thesaurus by providing access to a collection of multiple documents and determining synonymy based on sufficient similarity of meaning with the keywords as measured by the frequency of co-occurrence of the keywords in the collection of documents; b) identifying words in the user's response by recording the response for future learning; c) parsing out of a response all non-stop word unknown terms or keywords; d) identifying synonyms for all non-stop terms in the user's response; e) cycling between user and system responses until the user reaches a vertex (i.e. verbal description) that enables him to carry out his goal and updating the thesaurus when the goal vertex is reached by associating the recorded previously unknown words in the user's response with the keywords that are associated with the verbal description reached by the user; f) recording, when the goal vertex is reached, the pairs of synonyms in the user's responses and the keywords that are associated with the verbal description reached by the user; g) removing associations between keywords and their synonyms from the thesaurus that have not been accessed more than a specified amount of times within a specified period (this can be based upon a parameter set in the system by the system's administrator or can occur as part of program maintenance or updates); h) selecting the verbal descriptions that best meet the user's goal as indicated by the keywords and synonyms in the user's response by identifying the keywords in the user's response and/or the keywords corresponding to synonyms in the user's response and computing a degree of match between each verbal description and the identified keywords, in accordance with conventional linguistic processing techniques; i) computing the degree of match between verbal descriptions and identified keywords by utilizing the pairs of synonyms in user's response and the keywords associated with the verbal descriptions reached by users as previously recorded; j) responding to the user on the basis of verbal descriptions selected by presenting the user with verbal descriptions that best match the user's previous response; k) for "best match" variants, in the event that even the best matches have a low degree of match, the best "n" verbal descriptions are presented to the user ("n" being a number representing a predetermined system parameter);
1) for "best match" variants, in the event that the best matches have a low degree of match, the user is automatically connected to a human operator, when or if a human operator is available; m) for "best match" variants in the event that the best matches have a low degree of match, the best "n" verbal descriptions are presented to the user, along with an option of being connected to a human operator when or if a human operator is available; n) presenting the user with those verbal descriptions that best match the user's previous response in order to elicit any information from the user that may be required to accomplish the user's goal; o) recording information elicited from a user in a database for future use; p) selecting multiple verticies in the graph structure that are not connected to a previously selected vertex, based upon parameters associated with nodes correlated to keywords and synonyms in a user's response; q) selecting a vertex in the graph structure in the same row as the previously selected vertex based upon the keywords and synonyms in the user's response; and/or r) updating the thesaurus by adding words from a user's response that are not in the thesaurus.
Finally, it is to be understood that various variants of the invention including representative embodiments have been presented to assist in understanding the invention. It should be understood that they are not to be considered limitations on the invention as defined by the claims, or limitations on equivalents to the claims. For instance, some of these variants are mutually contradictory, in that they cannot be simultaneously present in a single embodiment. Similarly, some advantages are applicable to one aspect of the invention, and inapplicable to others. Thus, no particular features or advantages should be considered dispositive in determining equivalence.
It should therefore be understood that the above description is only representative of illustrative embodiments. For the convenience of the reader, the above description has focused on a representative sample of all possible embodiments, a sample that teaches the principles of the invention. The description has not attempted to exhaustively enumerate all possible combinations or variations, for example, those arising out of the use of particular hardware or software, or the vast number of different types of applications in which the invention can be used. That alternate embodiments may not have been presented for a specific portion of the invention, or that further undescribed alternate embodiments may be available for a portion of the invention, is not to be considered a disclaimer of those alternate embodiments. One of ordinary skill will appreciate that many of those undescribed embodiments incorporate the minimum essential aspects of the invention and others incorporate one or more equivalent aspects.
APPENDIX A
FILE IDENTIFICATION Main Source Files main.c, process. c, arraylib.c, stemlib.c, dialog.c, interactive. c, formlib.c Header Files globalvar.h, process.h, arraylib.h, forms.h Make Files
Makefile Parameter Files t.ini, d.ini Data Files p, w, s, f, x, a Configuration Files t.cfg, l.cfg Shell Script Files acct_info, add_acct, chg_acct, getjpymt, updt_pymt, susp_deli, updt_acct, prefer
MAIN SOURCE CODE (in C) main.c: Main Program to process p and w to create the thesaurus
SOURCE CODE DOCUMENTATION
#include <stdio.h> #include <string.h> #include "process.h" #include "arraylib.h" #include "forms.h" int numColumn = 0, numRow = 0 , numhidex = 0, numMenu; int top Values = 5 ; char **rowTerms, **columnTerms, **prompts, **stop Words; double **matrix, **cosine; float phoneThreshold = 0.02, webThreshold = 0.0006; int **indexList, **menuList, **thesaurus, **promptKeys; int numStopWord = 0; int numForms, numPF; struct form **formlist; char ***Fpromρts, *wdoc, *pdoc, *sdoc, *fdoc, *xdoc, *cfg; main(int argc, char *argv[]) { int i ;
PRINT THESAURUS PROGRAM INFO
/* if (argc != 5) { printf("Usage Instructions: t p w f x\n"); printf("Parses w for matrix row terms and p for matrix column terms.W); printf("*** Exiting, goodbye.W); exit(l); } */ if(argc != 2) { printf("Usage Instructions: t <ini-file>\n"): printf("*** Exiting, goodbye.\n"); exit(l); }
OPEN INPUT FILES
readini(argv[l]); loadStopWords(sdoc); numPF = loadFormsList(xdoc); numForms = loadForms(fdoc); PREPARATION FOR PHONEDOC PARSING
printf("\nReading files ....\n"); numColumn = processFile(pdoc, &columnTerms, phoneThreshold);
// printf("The document contains %d relevant terms.\n\n", numColumn);
// This routine will add the keywords from the Forms into ColumnTerms. numColumn = addFormKeys(&columnTerms, numColumn);
// printf("The document contains %d relevant terms.\n\n", numColumn);
PREPARATION FOR WEBDOC PARSING
numRow = processFile(wdoc, &rowTerms, webThreshold);
MERGE COLUMNTERMS & FINALTERMS INTO ROWTERMS
numRow - mergeArray(&rowTerms, columnTerms, numRow, numColumn); sortArray(rowTerms, numRow);
// printf("The document contains %d relevant terms.\n\n", numRow);
MATRLX CONSTRUCTIONS
printf("loading prompts ...\n", numlndex); numlndex = loadPrompts(pdoc); printf("processing words ...\n", numlndex); createMatrix(wdoc) ; numRow = eraseZeroes(); calcCosine(); fillhidexO;
// This function will add leaf prompts to the index keywords from Forms.
// appendlndex(argv[3]); createThesaurus() ;
// printf("created thesaurus .\n\n", numlndex); printf("saving data ...\n"); saveData(cfg); printf("done.\n"); } readini(char * filenm)
{
FILE * fp; char buf[80], key[80], value[80], comment[80]; int cnt; if ((fp=fopen(filenm,"r"))==NULL)
{ perror(filenm); exit(l);
} while (fgets(buf,79,fp)!=NULL)
{ sscanf(buf,"%s %s %s",key,value, comment); if (!strcmp(key, "pdoc")) pdoc=strdup(value); if (!strcmp(key, "wdoc")) wdoc=strdup(value); if (!strcmp(key, "sdoc")) sdo c=strdup (value) ; if (!strcmp(key, "fdoc")) fdoc=strdup(value) ; if (!strcmp(key, "xdoc")) xdoc=strdup(value); if (!strcmp(key, "cfg")) cfg=strdup(value); if (!strcmp(key, "pt")) sscanf(buf,"%s %f %s",key,&phoneThreshold, value);
//phoneThreshold=(float)atof(value); if (!strcmp(key, "wt")) sscanf(buf,"%s %f %s",key,&webThreshold, value); if (!strcmp(key, "tv")) topValues=atoi(value);
} }
process.c: This program contains various functions called from Main
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "globalvar.h"
#include "arraylib.h"
#include "forms.h"
#defme min(x, y) (x < y) ? x : y int *rowcount, *colcount; int processFile(char ^filename, char ***cArray, float threshold) {
FILE * fp; char tmpWord[50], paraFlag; int i, numWords = 0, wordLen = 0, totWords = 0; float *freqArray; fp = fileOpen(filename,"r"); *cArray = NULL; freqArray = NULL; while((wordLen = fetch Word(fp, tm Word)) != 0) { totWords++; if (! inArray(stop Words, tmpWord, numStopWord)) { // ignore stopwords stemWord(tmp Word) ; if (i = inArray(*c Array, tmpWord, numWords)) { freqArray [i - 1]++;
} , else { addWordfcArray, tmpWord, ++numWords); freqArray = (float *) realloc(freqArray, numWords * sizeof(float)); freqArray[num Words - 1] = 1;
} } } // printf("Totwords = %d, numWords = %d\n",tot Words, numWords); for ( i = 0; i < numWords; i++)
{ if ((float)(freqArray[i] / totWords) >= tlireshold)
(*cAiray)[i] = NULL;
} numWords = removeNulls((*cArray), numWords); sortArray((*cArray), numWords); return numWords; } **************************************************************************** Prompts Processing
******************************************************* *******************:].:]=/
int loadPrompts(char *filename)
{ char buffer[256]; int i = 0,j, len, nc; int level[10], tabs, m = 0; FILE * fp;
for (i = 0; i < 10; i++) level[i] = 0; fp = fileOpen(filename,"r"); prompts = NULL; menuList = NULL; j = i = 0; while (fgets(buffer, 256, fp) != NULL)
{ tabs = allTrim(buffer); if ((len = strlen(buffer)) = 0) continue; if ((j = inArray(prompts, buffer, i)) = 0) j = i; else j-; level[tabs + l] =j + l; menuList = (int **)realloc(menuList, ++m * sizeof(int *)); menuListfm - 1] = (int *)malloc(3 * sizeof(int)); menuList[m - 1 ][0] = level[tabs]; menuListfm - 1][1] = level[tabs + 1]; menuList[m - 1][2] = 0; if (]' = i) addWord(&prompts, buffer, ++i);
} numMenu = m; or (j = 0; j < numMenu; j++)
{ for(m = 0; m < numMenu; m++) if (menuList(j ] [ 1 ] — menuListfm] [0]) break; if (m != numMenu) /* Leaf Node */ continue; nc = 0; for (m = 0; m < numMenu; m++) if (menuListfm] [0] = menuList[j][0]) nc++; if (nc != 1)
{ menuList[j][2] = 99; continue;
} len = strlen(prompts[menuList[j][l] - 1]); if (prompts[menuList[j][l] - l][len - 1] = '?') menuList[j][2] = 99; else
{ for (m = 0; m < numMenu; m++) if (menuListfm] [1] = menuList[j][0]) menuList[m][2] = menuList[j][l]; menuList[j][2] = 100; }
} return i;
}
void fιlllndex()
{ int i,j, k; indexList = (int **)malloc(numColumn * sizeof(int *)); for (i = 0; i < numColumn; i++) { indexList[i] = (int *)malloc(nmnIndex * sizeof(int)); for (j = 0; j < numlndex; j++) indexList[i][j] - 0;
} for (i = 0; i < numlndex; i++) updateThesaurus(prompts[i], i + 1); updateFrmForms() ;
} updateThesaurus( char *str, int pmpt)
{ char tmpstr[256]; char *sarray[50]; int i, j, k, wrds; int iflag = 0, dflag = 0; strcpy(tmpstr, str); wrds = readValues(tmpstr, sarray); stemArray(sarray, wrds); for (i = 0; i < wrds; i++)
{ for (j = 0; j < numColumn; j++)
{ if (!strcmp(columnTerms[j], sarray[i]))
{ iflag = 1; dflag = 0; for (k = 0; indexList[j][k] && k < numlndex; k++) if (indexList[j][k] = pmpt) dflag = 1; if (k < numlndex && dflag — 0) indexList[j][k] = pmpt; break;
} }
Figure imgf000039_0001
Create Matrix here void createMatrix(char * filename) { int i,j, nwp = 0, k = 0; int minv; FILE * fp;
/* allocate memory for matrix */ matrix = (double **)malloc(numRow * sizeof(double *)); for (i = 0; i < numRow; -H-i) { matrix[i] = (double *)malloc(numColumn * sizeof(double)); for (j = 0; j < numColumn; j++) matrix[i][j] = 0;
}
/* allocate memory for rowcount and column count */ rowcount = (int *)malloc(numRow * sizeofrinf)); colcount = (int *)malloc(numColumn * sizeofrinf));
/* Go to start of document */ fp = fileOpen(filename,"r"); while (!feof(fp))
{
/* initialize rowcount array */ for (j j = 0; j < numRow; j++) rowcount[j] = 0; /* initialize columncount array */ for (j = 0; j < numColumn; j++) colcountfj] = 0; nwp = readPara(fp); if (feof(fp)) break; if (nwp = 0) continue;
/* add co-occurance of rowword & colword to the matrix */ for (j = 0; j < numRow; j++) for (k = 0; k < numColumn; k++) { minv = min(rowcount[j], colcount[k]); matrix[j][k] += minv;
} }
int readPara(FILE *fp )
{ int i, j, k, wcount = 0, m = 0; int nextpara, currpara, wordLen; char tmpword[50]; currpara = ftell(fp); wcount = wordsInPara(fp); if (feof(fp)) { if (wcount = 0) return 0;
} nextpara = ftell(fp); fseek(fp, currpara, 0); for (i = 0; i < wcount; ++i) { wordLen = fetchWord(fp, tmpword); if(inArray(stopWords,tmpword,numStopWord)) continue; stem Word(tmρ word) ;
/* count the occurance of each word from the row in para */ for (j = 0; j < numRow; j++) if (!strcmp(rowTerms[j], tmpword)) { rowcount[j]-H-; break;
} /* count the occurance of each word from the column in para */ for (j = 0; j < numColumn; j++) if (!sfrcmp(columnTerms[j], tmpword)) { colcount[j]++; break; }
} fseek(fp, nextpara, 0); return wcount; } int wordsInPara (FILE *fp)
{ int c, count = 0; int state; const int out = 0, in = 1 ; state = out; while ((c = getc(fp)) != EOF) { if (ϋsalpha(c)) { if (c = V || c = EOF) break; state = out;
} else if (state = out) { state = in; count++;
}
} return count;
}
Calculate Cosine Function void calcCosine()
{ int i, j, k, sum;
/* memory allocation for the cosine matrix */ cosine = (double **)malloc(numRow * sizeof(double *)); for (i = 0; i < numRow; ++i) { cosine[i] = (double *)malloc(((numRow) * sizeof(double))); for (j = 0; j < numRow; j++) cosine[i][j] = 0;
} /Normalization*/ for (i = 0; i < numRow; ++i)
{ sum = 0; for (k = 0; k < numColumn; ++k) sum += matrix[i][k] * matrix[i][k]; if (sum N O)
{ for (j = 0; j < numColumn; -H-j) matrix[i][j] =matrix[i][j] / sqrt(sum); } }
/*Cosines*/ for (i = 0; i < numRow; ++i)
{ for (k = i + 1 ; k < numRow; ++k)
{ cosine[i][k] = 0; for (j = 0; j < numColumn; -H-j) cosine[i][k] += matrix[i][j] * matrix[k][j];
}
}
}
eraseZeroes : removes the row with all zero column in the matrix int eraseZeroes() { intj, k; int cond;
/* Free and nullify the rowTerms and matrix row for all zeroes */ for (j = 0; j < numRow; -H-j) { cond = 1 ; for (k = 0; k < numColumn; ++k) { if(matrix[j][k] != 0) { cond = 0; break; } } if(cond = l) { rowTermsfj] = NULL; matrix[j] = NULL;
} }
/* Push NULL rows at the end of arrays */ for (j = 0; j < numRow; j++)
{ if (rowTerms[j] = NULL)
{ for (k = j + 1 ; k < numRow; k++) if(rowTerms[k] != NULL) break; if (k < numRow)
{ rowTerms [j] = rowTerms [k]; matrix[j] = matrix[k]; rowTerms[k] = NULL; matrix[k] = NULL;
} } }
/* count new numRow */ for 0' = 0; (rowTerms[j] != NULL) && j < numRow; j++); return j;
}
createThesaurus: Function to Create Thesaurus of rowTerms by taking the index words matching the top 5 cosine values. void createThesaurus()
{ int i, j, k, 1; int m, numword; double *tmpcos, prevcosine = 0; int *colnum; tmpcos = (double *)malloc(numRow * sizeof(double)); colnum = (int *)malloc(numRow * sizeof(int)); thesaurus = (int **)malloc(numRow * sizeof(int *)); for (i = 0; i < nirmRow; i++) { thesaurus[i] = (int *)malloc(numColumn * sizeof(int)); for 0 = 0; j < numColumn; j++) thesaurus[i][j] = 0;
} /* initialization of thesaurus */ for (i = 0; i < numRow; i++) { for ( j = 0; j < numRow; j++) { if(i >j) tmpcos[j] = cosine[j][i]; else if (i <j) tmpcos[j] - cosine[i][j]; else tmpcostj] = 0; colnum[j] =j;
} floatSort(colnum, tmpcos, numRow); numword = prevcosine = 0;
/* count top 'top Values' of cosine */ for (m = 0; m < numColumn; m++) { if (prevcosine != tmpcos[m]) numword++; prevcosine = tmpcos[m]; if (numword == top Values + 1) break;
} ~m; /* m = total num of syn */ for (j = k = 0; k <= m; k++) { if ((1 = inArray(columnTenns,rowTerms[colnum[k]], numColumn)) != 0) if(tmpcos[k] != 0) { thesaurus[i][j] = 1;
} }
}
floatSort : Sorts the array of cosine values and corresponding index of index words in reverse order. floatSort(int *colnum, double *tmpcos, int numRow)
{ int i . k; double f; for (i = numRow - 1 ; i > 0; i~) for O' = 0;j < i;j++) { if(tmpcos[j] < tmpcos[j + 1]) { f = tmpcosjj], k = colnum[j]; tmpcosO] = trnpcosfj + 1], colnun fj] = colnumjj + 1]; tmpcos[j + 1] = f, colnumjj + 1] = k;
}
} void saveData(char *filenm)
{ int i, j, k, 1; FILE *φ; fp = fileOpen(filenm, "w"); printArray(fp, "PROMPTS", prompts, NULL, numlndex, 0); // Write Prompts to the file
/df df df f df df ;jf df "VX7*f*ι +£» t/") τT"lf* Tl lf H* H Hi H5 Hi H H1 H5 H H5 /
// printArray(fp, "MENUTREE", NULL, menuList, numMenu, 2); fprintf(fp, "[%s]\n", "MENUTREE"); for (i = 0; i < numMenu; i++) fprintf(φ, "%d,%d,%d n", menuList[i][0], menuList[i][l],menuList[i][2]); φrintf(φ, "\n"); printArray(φ, "INDEX", columnTerms, indexList, numColumn, numlndex); // Write Index to the file printArray(φ, "THESAURUS", rowTerms, thesaurus, numRow, numColumn); // Write
Thesaurus to the file fclose(φ); printf("Data saved in %s\n",filenm);
} printArray(FILE *φ, char *head, char **cArray, int **iArray, int cNum, int lNum)
{ int ij; φrintf(φ, "[%s]\n", head); for (i = 0; i < cNum; i++)
{ φrintf(φ, "%s ", cArray[i]); for (j = 0; j < lNum && iArray[i][j] != 0; j++) φrintf(φ, "%d,", iArray[i][j]); φrintf(fp, "\n");
} φrintf(φ, "\n");
} int addFormKeys(char ***cArray, int count)
{ char ** wordList, *tmparray[20]; int i, j, k, words; int 1, tmpcount; wordList = NULL; words = 0; for(i = 0; i < numForms; i++) for (j = 0; j < formlist[i]->numFields; j++)
{ if(!strcmp("MChoice", formlist[i]->fields[j]->Type)) for(k = 0; k < formlist[i]->fields[j]->numChoice; k++)
{ tmpcount = createAτray(formlist[i]->fields|j]->Choice[k], tmparray); for(l = 0; 1 < tmpcount; 1++) addWord(&wordList, tmparray[l], ++words); }
} i = merge Array(cArray, wordList, count, words); sortArray((*cArray), i); return i;
}
updateFrnιForms()
{ int i, j, k, 1; int m, n, x, tmpcount; int pmpt; char *tmpstr, *tmparray[20]; for (i = 0; i < numPF; i++)
{ pmpt = inArray(prompts, Fprompts[i][l], numlndex); if (pmpt = 0)
{ printf("Unknown prompt encountered for form %s\n",Fprompts[i][0]); exit(l);
} forfj = 0; j < numForms; j++) if (!strcmp(Fprompts[i][0], formlist[j]->name)) break; if (j = numForms) continue; for(k = 0; k < formlist|j]->numFields; k++)
{ if(strcmp(formlistjj]->fields[k]->Type,"MChoice")) continue; for(l = 0; 1 < formlist[j]->fιelds[k]->numChoice; 1++)
{ tmpcount = createArray(formlistO]->fields[k]->Choice[l], tmparray); for(m = 0; m < tmpcount; m++)
{ n = inArray(columnTerms, tmparray[m], numColumn); n~; for (x = 0; indexList[n][x] && x < numlndex; x++) if (indexList[n][x] = pmpt) break; if (x < numlndex && indexList[n][x] == 0) indexList[n][x] = pmpt; } } }
arraylib.c: This program contains general purpose functions
#include <stdio.h> #include <string.h> #include "globalvar.h" #mclude "forms.h"
FILE * fileOpen(char *, char *); int fetchWord(FILE *f, char * wrd) { int i = 0, c; wrd[0] = 0; if (feof(f)) return 0; while(!isalpha(c = fgetc(f))) if (c == EOF) return 0; do { wrd[i++] = tolower(c);
} while(isalpha(c = fgetc(f))); wrd[i] = 0; return i; } int inArray(char ** array, char *word, int length)
{ int i; for (i = 0; i < length; i++) if (array[i] !=NULL && !strcmp(array[i], word)) return i + 1 ; return 0;
} int removeNulls(char **strarray, int numWords)
{ int i ; for (i = 0; i < numWords; i++)
{ if (strarray[i] = NULL)
{ for (j = i + 1 ; j < numWords; j++) if (strarraylj] != NULL)
{ strarray[i] = strarraylj]; strarraylj] = NULL; break;
} } }
/* get count of filtered words */ for Q = 0; (strarraylj] != NULL) && (j < numWords); j++); return j;
} int merge Array(char *** Array 1, char **Array2, int numArrayl, int numArray2) { int i; for (i = 0; i < numArray2; i++) if (! inArray((* Array 1), Array2[i], numArrayl)) addWord( Array 1, Array2[i], ++numArrayl); return numArrayl ; } int readValues(char *str, char **array)
{ int i ,j = 0, c; int state; const int out = 0, in = 1; state = out; for (i = 0; (c = str[i]) != 0; i++)
{ if (ϋsalnum(c)) /* alfa-numeric to read numbers also */
{ state = out; str[i] = 0; /* word is over end it with null */ } else
{ str[i] = tolower(c); if (state == out)
{ state = in; array[j++] = str + i; /* word started, store the ptr.*/
} }
} return j;
} void sortArray(char *allwords[], int numwords) { int i = 0; intj = 0; char *tmp; for (i = 0; i < numwords; ++i) for (j = i + 1 ; j < numwords; -H-j) if (strcmp(allwords[i], allwords[j]) > 0) { tmp = allwords[i]; allwords[i] = allwords[j]; allwords[j] = tmp;
} } loadStoρWords( char * filename) {
FILE * φ; char tmpWord[50]; int wordLen = 0; numStopWord = 0; φ = fileOpen(filename,"r"); stopWords = NULL; while((wordLen = fetchWord(φ, tmpWord)) != 0) addWord(&stop Words, tmpWord, ++numS top Word);
} FILE * fileOpen(char *filename, char *mode)
{
FILE * φ; if ((φ = fopen(filename, mode)) == NULL) { perror(filename); exit(l);
} return φ;
} addWord(char ***cArray, char * word, int c)
{
*cArray = (char **) realloc(*cArray, c * sizeof(char *));
(*cArray)[c - 1] = strdupfword);
} int removeZeros(int *intArray, int numlnt)
{ int i ; for (i = 0; i < numlnt; i++)
{ if (intArray[i] = 0)
{ for (j = i + 1 ; j < numlnt; j++) if(intArray[j] != 0)
{ int Array [i] = intArray[j]; intArray[j] = 0; break; } } }
/* get count of filtered integers */ for (j = 0; (intArray[j] != 0) && (j < numlnt); j++); return j;
}
Newly added ftinctions ( for further reducing the code ) int breakS tr(char * str, char **strarray)
{ char c, *tmpstr; int i,j = 0; int state; const int out = 0, in = 1;
/* Seperate the sentence into individual words */ tmpstr = strdup(str); state = out; for (i = 0; (c = tmpstr[i]) != 0; i++)
{ if (ϋsalpha(c))
{ state = out; tmpstr[i] = 0;
} else
{ tmpstr[i] = tolower(c); if (state = out)
{ state = in; strarraylj ++] = tmpstr + i;
} } } return j;
}
/* remove stop Words */ filterStopWords(char ** strarray, int numWords)
{ int i; for (i = 0; i < numWords; i++) if (inArray(stop Words, strarray [i], numStopWord)) strarray[i] = NULL;
}
/* remove duplicates */ filterDuplicates(char ** strarray, int numWords)
{ int i; for (i = 0; i < numWords; i++) if (strarray [i] != NULL && inArray(strarray, strarray [i], i)) strarray[i] = NULL;
} int loadFormsList( char *filename) { char buf[256]; FILE *φ; int len, i; φ = fιleOpen(filename, "r");
Fprompts = NULL; numPF = 0; while (fgets(buf,255,φ) != NULL)
{ len = strlen(buf); for (i = 0; i < len; i++) if (buf[i] == ':')
{ buf[i] = 0; break;
} if (i = len)
{ φrintf(stderr, "Error in Prompt lisfλn"); exit(0);
} allTrim(buf); allTrim(buf+ i + l);
Fprompts = (char ***)realloc(Fprompts, (+-rnunιPF)*sizeof(char **));
Fprompts[numPF-l] = (char **)malloc(2 * sizeof(char *));
Fprompts [numPF-l][0] = strdup(buf);
Fprompts[numPF-l][l] = strdup(buf + i + 1);
} fclose(φ); return numPF;
} int loadForms(char * filename)
{ int i, j, formcount = 0;
FILE *φ; char buf[80], **namelist = NULL; formlist = NULL; numForms = 0; φ = fileOpen(filename, "r"); while(fgets(buf,79,φ) != NULL)
{ if (buffO] == '[')
{ for(i = 0; buf[i]; i++) if buf[i] = '[' II buf[i] == ]) buf[i] allTrim(buf); addWord(&namelist, buf, ++formcount); } } for ( i = 0; i < formcount; i++)
{ formlist = (struct form **)realloc(formlist, (++numForms) * sizeof(struct form *)); formlist[numForms - 1] = (struct form*)malloc(sizeof(struct form)); loadForm(φ , formlist[numForms - 1], namelist[i]);
} fclose(φ); return numForms; } int allTrim (char * str)
{ int i , sf, tabs; for (i = tabs = 0; isspace(str[i]) && str[i]; i++) tabs += (str[i] = '\t')? 1: 0; for (j = sf= 0; str[i]; i++, j++) str[j] = iscntrl(str[i])? ' ': str[i]; for(str[j-] = 0; isspace(str[j]) && j > 0; str[j~] = 0); return tabs;
} int create Array (char * str, char ** array)
{ int count; count = breakS tr(str, array); return process Array(array, count, 1);
} int processArray(char ** array, int count, int sflag)
{ if (sflag) filters top Words(array, count); stemArray(array, count); filterDuplicates(array, count); return removeNulls(array, count); }
stemlib.c: This program contains functions related to stemming algorithim /* This is the Porter stemming algorithm, coded up in ANSI C by the author. It may be be regarded as cononical, in that it follows the algorithm presented in Porter, 1980, An algorithm for suffix stripping, Program, Vol. 14, no. 3, pp 130-137, only differing from it at the points maked -DEPARTURE- below.
See also htφ://www.tartarus.org/~martin/PorterStemmer
The algorithm as described in the paper could be exactly replicated by adjusting the points of DEPARTURE, but this is barely necessary, because (a) the points of DEPARTURE are definitely improvements, and (b) no encoding of the Porter stemmer I have seen is anything like as exact as this version, even with the points of DEPARTURE!
You can compile it on Unix with 'gcc -03 -o stem stem.c' after which 'stem' takes a list of inputs and sends the stemmed equivalent to stdout.
The algorithm as encoded here is particularly fast.
Release 1
*/
#include <string.h> /* for memmove */
#defme TRUE 1 #defme FALSE 0
/* The main part of the stemming algorithm starts here, b is a buffer holding a word to be stemmed. The letters are in b[k0], b[k0+l] ... ending at b[k]. hi fact kO = 0 in this demo program, k is readjusted downwards as the stemming progresses. Zero termination is not in fact used in the algorithm.
Note that only lower case sequences are stemmed. Forcing to lower case should be done before stem(...) is called.
*/ static char * b; /* buffer for word to be stemmed */ static int k,kO,j; /* j is a general offset into the string */
/* cons(i) is TRUE <=> b[i] is a consonant. */ int cons(int i) { switch (b[i]) { case 'a': case 'e': case 'i': case 'o': case 'u': return FALSE; case 'y': return (i=k0) ? TRUE : Icons(i-l); default: return TRUE;
} }
/* m() measures the number of consonant sequences between kO and j. if c is a consonant sequence and v a vowel sequence, and <„> indicates arbitrary presence,
<c><v> gives 0 <c>vc<v> gives 1 <c>vcvc<v> gives 2 <c>vcvcvc<v> gives 3
*/ int m() { int n = 0; int i = kO; while(TRUE)
{ if (i >j) return n; if (! cons(i)) break; i++;
} i++; while(TRUE) { while(TRUE) { if (i >j) return n; if (cons(i)) break; i++; } i++; n++; while(TRUE)
{ if (i >j) return n; if (! cons(i)) break;
1++;
} i++;
} }
/* vowelinstemO is TRUE <=> kO,...j contains a vowel */ int vowelinstemO
{ int i; for (i = kO; i <= j; i++) if (! cons(i)) return TRUE; return FALSE; }
/* doublec(j) is TRUE <=> j,(j-l) contain a double consonant. */ int doublec(intj)
{ if 0' < kO+1) return FALSE; if(bQ] != b[j-l]) return FALSE; return consfj); }
/* cvc(i) is TRUE <=> i-2,i-l,i has the form consonant - vowel - consonant and also if the second c is not w,x or y. this is used when trying to restore an e at the end of a short word. e.g. cav(e), lov(e), hop(e), crim(e), but snow, box, tray.
*/
int cvc(int i)
{ if (i < kO+2 || Icons© || cons(i-l) || !cons(i-2)) return FALSE; { int ch = b[i]; if (ch = V || ch = 'x' || ch = 'y') return FALSE;
} return TRUE;
}
/* ends(s) is TRUE <=> k0,...k ends with the string s. */ int ends(char * s) { int length = s[0]; if (s[length] != b[k]) return FALSE; /* tiny speed-up */ if (length > k-kO+1) return FALSE; if (memcmp(b+k-length+l,s+l, length) != 0) return FALSE; j =,k-length; return TRUE; }
/* setto(s) sets (j+l),...k to the characters in the string s, readjusting k. */ void setto(char * s) { int length = s[0]; memmove(b+j+l ,s+l ,length); k =j+length;
}
/* r(s) is used further down. */ void r(char * s) { if (m() > 0) setto(s); }
/* steplab() gets rid of plurals and -ed or -ing. e.g. caresses -> caress ponies -> poni ties -> ti caress -> caress cats -> cat feed -> feed agreed -> agree disabled -> disable matting -> mat mating -> mate meeting -> meet milling -> mill messing -> mess meetings -> meet
* 7 void steplab() { if(b[k] = 's') { if (ends("\04" "sses")) k -= 2; else if (ends("\03" "ies")) setto("\01" "i"); else if(b[k-l] != 's') k~;
} if (ends("\03" "eed")) { if (m() > 0) k~; } else if ((ends("\02" "ed") || ends("\03" "ing")) && vowelinstemO)
{ k =j; if (ends("\02" "at")) setto("\03" "ate"); else if (ends("\02" "bl")) setto("\03" "ble"); else if (ends("\02" "iz")) setto("\03" "ize"); else if(doublec(k))
{ k-; { int ch = b[k]; if (ch = T || ch = 's' || ch == *z') k++;
} } else if (m() = 1 && cvc(k)) setto("\01" "e");
} }
/* steplc() turns terminal y to i when there is another vowel in the stem. */ void steplcO { if (ends("\01" "y") && vowelinstemO) b[k] = 'i'; }
/* step2() maps double suffices to single ones, so -ization ( = -ize plus -ation) maps to -ize etc. note that the string before the suffix must give m() > 0. */ void step2() { switch (b[k-l])
{ case *a': if (ends("\07" "ational")) { r("\03" "ate"); break; } if (ends("\06" "tional")) { r("\04" "tion"); break; } break; case 'c': if (ends("\04" "enci")) { r("\04" "ence"); break; } if (ends("\04" "anci")) { r("\04" "ance"); break; } break; case 'e': if (ends("\04" "izer")) { r("\03" "ize"); break; } break; case '1': if (ends("\03" "bli")) { r("\03" "ble"); break; } /*-DEPARTURE-*/
/* To match the published algorithm, replace this line with case 1': if (ends("\04" "abli")) { r("\04" "able"); break; } */ if (ends("\04" "alii")) { r("\02" "al"); break; } if (ends("\05" "entli")) { r("\03" "ent"); break; } if (ends("\03" "eli")) { r("\01" "e"); break; } if (ends("\05" "ousli")) { r("\03" "ous"); break; } break; case V: if (ends("\07" "ization")) { r("\03" "ize"); break; } if (ends("\05" "ation")) { r("\03" "ate"); break; } if (ends("\04" "ator")) { r("\03" "ate"); break; } break; case 's': if (ends("\05" "alism")) { r("\02" "al"); break; } . if (ends("\07" "iveness")) { r("\03" "ive"); break; } if (ends("\07" "fulness")) { r("\03" "fill"); break; } if (ends("\07" "ousness")) { r("\03" "ous"); break; } break; case 't': if (ends("\05" "aliti")) { r("\02" "al"); break; } if (ends("\05" "iviti")) { r("\03" "ive"); break; } if (ends("\06" "biliti")) { r("\03" "ble"); break; } break; case 'g': if (ends("\04" "logi")) { r("\03" "log"); break; } /*-DEPARTURE-*/
/* To match the published algorithm, delete this line */
} }
/* step3() deals with -ic-, -full, -ness etc. similar strategy to step2. */
void step3() { switch (b[k])
{ case 'e': if (ends("\05" "icate")) { r("\02" "ic"); break; } if (ends("\05" "ative")) { r("\00" ""); break; } if (ends("\05" "alize")) { r("\02" "al"); break; } break; case 'i': if (ends("\05" "iciti")) { r("\02" "ic"); break; } break; case T: if(ends("\04" "ical")) { r("\02" "ic"); break; } if(ends("\03" "fid")) { r("\00" ""); break; } break; case 's': if (ends("\04" "ness")) { r("\00 '); break; } break; } }
/* step4() takes off -ant, -ence etc., in context <c>vcvc<v>. */ void step4()
{ switch (b[k-l])
{ case 'a': if (ends("\02" "al")) break; return; case 'c': if (ends("\04" "ance")) break; if (ends("\04" "ence")) break; return; case 'e': if (ends("\02" "er")) break; return; case 'i': if (ends("\02" "ic")) break; return; case T: if (ends("\04" "able")) break; if (ends("\04" "ible")) break; return; case 'n': if (ends("\03" "ant")) break; if (ends("\05" "ement")) break; if (ends("\04" "ment")) break; if (ends("\03" "ent")) break; return; case 'o': if (ends("\03" "ion") && (b[j] = 's' || b[j] = 't')) break; if (ends("\02" "ou")) break; return;
/* takes care of -ous */ case 's': if (ends("\03" "ism")) break; return; case Y: if (ends("\03" "ate")) break; if (ends("\03" "iti")) break; return; case 'u': if (ends("\03" "ous")) break; return; case V: if (ends("\03" "ive")) break; return; case 'z': if (ends("\03" "ize")) break; return; default: return;
} if(m() > l) k =j;
}
/* step5() removes a final -e if m() > 1, and changes -11 to -1 if m() > l. */ void step5() { j = k; if (b[k] = 'e')
{ int a = m(); if (a > 1 || a = 1 && !cvc(k-l)) k~;
} if (b[k] = T && doublec(k) && m() > 1) k-;
} /* In stem(p,i,j), p is a char pointer, and the string to be stemmed is from p[i] to p[j] inclusive. Typically i is zero and j is the offset to the last character of a string, (p[j+l] = '\0'). The stemmer adjusts the characters p[i] ... p[j] and returns the new end-point of the string, k. Stemming never increases word length, so i <= k <= j. To turn the stemmer into a module, declare 'stem' as extern, and delete the remainder of this file.
*/
int stem(char * p, int i, int j)
{ b = p; k = j; kO = i; /* copy the parameters into statics */ if (k <= kO+1) return k; /* -DEPARTURE-*/
/* With this line, strings of length 1 or 2 don't go through the stemming process, although no mention is made of this in the published algorithm. Remove the line to match the published algorithm. */ steplab(); steplc(); step2(); step3(); step4(); step5(); return k;
}
/* stemmer definition ends here */
stemArray(char **list, int arrayLen)
{ int i; for (i = 0; i < arrayLen; i++) if(list[i] !=NULL) stemWord(list[i]);
} stemWord( char * s)
{ s[stem(s,0, strlen(s) - 1) + 1] = 0;
}
dialog.c: This is main program of dialog module
dialog.c : The main function for the interactive dialog program, loads all the global arrays and variables before calling the interacitve function.
Arguments are:
1. The Configuration file for Thesaurus, contains Prompts, index, basic thesaurus etc. 2. The Learning Thesaurus. - used to store learnt words and to refer to them.
*********************************^H=*****************************************/
#include <stdio.h> #include <string.h> #include "aπaylib.h" int numColumn, numRow, numlndex, numMenu; int startPoint, eofFlag, topValues; char **rowTerms, **columnTerms, **prompts, **stop Words; float **matrix, **cosine, phoneThreshold, webThreshold; int **indexList, **menuList, **thesaurus; int numStopWord, numOrgRow; int numForms, numPF; struct form **formlist; char ***Fprompts, *formfile; int **scoring, numScore = 0; char *cfg, *lcfg, *fdoc, *xdoc, *sdoc; int minPromptCount = 1, timeout = 30; void frιteractive(char *); main(int argc, char *argv[])
{ int i = 0;
/*if (argc != 5)
{ printf("Usage Instructions: dialog config_file learn_file n"); printf("*** Exiting, goodbye.W); exit(l); }*/ if (argc != 2)
{ printf("Usage Instructions: d <ini-file>\n"); printf("*** Exiting, goodbye.W); exit(l);
} readini(argv[l]); formfile = fdoc; loadStopWords(sdoc); numPF = loadFormsList(xdoc); numForms = loadForms(fdoc); loadData(cfg, lcfg); Interactive(lcfg);
} /********************************** %:]::).******************************** loaddata : This function will read the configuration files and load the information into the relevant global arrays.
****^;******************************H: j);********************************/ loadData(char *filenm, char *file2)
{ charbuf[256],word[20]; inti,j,k, 1; int numext; FILE *φ, *f2;
^; rj; ^ ^ ^; φ η; ^; -f; *p φ ^ »p ^ -p -p ^; T^^T O lTl {TllTflTlOT Ti If1 ^i^^^ϊφ-p^^^i'fi'fi-j;^^:^;^^;^^; φ = fileOpen(filenm, "r");
/H- Hi H* Hi Hi Hi Hi Hi Φ H; Hi H- Hi Tllf* / f2 = fileOpen(file2
Figure imgf000062_0001
prompts = columnTerms = rowTerms = NULL; scoring = thesaurus = indexList = menuList = NULL;
/* read data in the aπays */ numMenu - loadMenuTree(φ, "[MENUTREE]"); numlndex = readArray(φ, "[PROMPTS]", &prompts, 1, NULL, 0, 0); numColumn = readArray(φ, "[INDEX]", &columnTerms, 1, &indexList, numlndex, 0); numOrgRow = readArray(φ, "[THESAURUS]", &rowTerms, 1, &thesaurus, numColumn, 0); numRow = readArray(f2, "[EXT-THESAURUS]", &rowTeπns, 1, &thesaurus, numColumn, numOrgRow); numScore = readArray(f2, "[SCORING]", NULL, 0, &scoring, numColumn + 1, 0); fclose(φ); fclose(£2); }
readArray : Reads the file and fills the rows and columns of the given arrays int readArray(FILE *φ, char *head, char ***ch_array, int ccount, int ***int_array, int icount, int sp)
{ charbuf[256]; int i, j, start = 0, wc = 0; int k, c; char **tmparray; /*To store the pointers to the words/numbers from the string*/ c = sp; if (icount != 0) tmparray = (char **)malloc((icount + 1) * sizeof(char *)); fseek(φ, 0, 0); /* Go to Top */ while (fgets(buf, 255, φ) != NULL) /* read lines till end of file */
{ allTrim(buf); j = strlen(buf); if (buffj- - l] = V) bufrj- - l] = 0; if (start)
{ if (strlen(buf) = 0) /* if blank line, stop reading */ break; if (icount = 0) /* i.e. no integer array */ addWord(ch_array, buf, ++c); else /* read first word string */
{ /* rest are columns of int array */ wc = readValues(buf, tmparray); c++;
(*int_array) = (int **)realloc(*int_array, c * sizeof(int *));
(*int_array)[c - 1] = (int *)malloc(icount * sizeof(int)); if (ccount != 0) addWord(ch_array, tmparray [0], c); else
(*int_array)[c - 1][0] = atoi(tmpan-ay[0]); for (k = 1 ; k < icount; k++) if(k < wc)
(*int_array)[c - l][k - ccount] = atoi(tmparray[k]); else
(*int_array)[c - l][k - ccount] = 0;
} } else if (!strcmp(head, buf)) start = 1 ;
} return c;
}
loadMenuTree : loads the menutree from file to menuList array int loadMenuTree (FILE *φ, char *head)
{ charbuf[256]; int i, j, start = 0, count = 0; fseek(φ, 0, 0); while (fgets(buf, 255, φ) != NULL)
{ j = strlen(buf); if (bufjj - l] = V) buf[j - l] = 0; if (start)
{ if (strlen(buf) == 0) break; menuList = (int **)realloc(menuList, (count + 1) * sizeof(int *)); menuList[count] = (int *)malloc(3 * sizeof(int)); sscanf(buf, "%d,%d,%dW, &menuList[count][0], &menuList[count] [ 1 ] ,&menuList[count] [2]); count++; } else if (!strcmp(head, buf)) start = 1 ;
} return count
}
readini(char * filenm)
{
FILE * φ; charbuf[80], key[80], value[80], comment[80]; int cnt; if ((φ=fopen(fιlenm,"r"))-=NULL)
{ perror(filerrm); exit(l);
} while (fgets(buf,79,φ)!=NULL)
{ sscanf(buf,"%s %s %s",key,value, comment); if (!strcmp(key, "sdoc")) sdoc=strdup(value); if (!strcmp(key, "fdoc")) fdoc=strdup(value); if (!strcmp(key, "xdoc")) xdoc=strdup(value); if (!strcmp(key, "cfg")) cfg=strdup(value); if (!strcmp(key, "lcfg")) lcfg=strdup(value); if (!strcmp(key, "minprompt")) minPromptCount=atoi(value); if (!strcmp(key, "timeout")) timeout=atoi(value) ; }
interactive. c: This program contains fimtions related to user interaction |.φ********:l. ***********************************************************
Interactive : function to accept a sentence from the user and then generate the response. thesaurusFlag = is 1 if there is atleast 1 thesaurus/learned word in query updateFlag = is set to 1 if the program needs to learn (i.e. main menu was selected during the prompt navigation) interPrompts - Intersection of prompts unionPrompts = Union of prompts interUnionPrompts = Intersection of Union numlnter = number of prompts in h terPrompts numlnterUnion = num of prompts in Intersection of Union numUnion = num of prompts in Union numUnknown = num of unknown words
#include <stdio.h> #include <signal.h> #include <string.h> #include <unistd.h> #include "globalvar.h" #include "arraylib.h" #include "forms.h"
#define max(a,b) (a > b)? a: b #define min(a,b) (a < b)? a: b #define swap(a,b) (a Λ= b, b Λ= a, a Λ= b) extern int numScore, **scoring; int updateFlag = 0, learnFlag, numQueryList = 0;
FILE *lf, *pf; char ** uWList=NULL, *queryTerms[50]; int uWNum; extern int minPromptCount, timeout; char query[256], **queryList = NULL; char *affrmWords[] = { "yes", "right", "correct"}; char *negWords[] = { "no", "neither"}; extern char * fdoc; int otheFlag = 0; int unknownWords[20], numQuery = 0, numUnknown; char **uWords; // Added this array to facilitate learning wven if lateral shift int nu UW; // Added this to facilitate learning wven if lateral shift void sayOther(); void Interactive(char *flnm)
{ int InterPrompts[20], unionPrompts[20], tl Prompts [20]; int interUnionPrompts[20], numftiterUnion, t2Prompts[20], numT2; int i,j, k, 1; int start, numUnion, numl ter, numTl; int n, selectedPrompt, thesaurusFlag = 0; char *interlog, *processlog, c; numUnknown = numUW = 0; for(i=0; i < 20; i++) unknownWords[i] = 0; uWords=NULL; if ((interiog = (char *)getenv("TLMEOUT")) != NULL) timeout = atoi(interlog); if ((interiog - (char *)getenv("MINPROMPT")) != NULL) minPromptCount = atoirinterlog); if ((interiog = (char *)getenv("INTERLOG")) == NULL) interiog = "test.html"; if ((processlog = (char *)getenv("PROCESSLOG")) = NULL) processlog = "process.html"; signal(SIGALRM, &sayOther); If = fileOpen(interlog,"w"); pf = fileOpen(processlog,"w"); φrintf(lf, "<HTML>\n<TITLE>%s</TITLE>W^BODY><FONT SIZE=5>W, interiog); fprintfi pf, "<HTML>WTITLE>%s</TITLE>\n<BODY><FONT SIZE=5>W, processlog); system("clear"); printf("Thank you for calling the New Herald. W); ρrintf("How may we help you?WW); φrintf(lf,"\nThanlc you for calling the New Herald.<BR>"); φrintf(lf,"How may we help you. <P>"); fgets(query, 255, stdin); /* accept the user input */ while (1)
{ addWord(&queryList, query, ++numQueryList); numQuery = thesaurusFlag = 0; if (strlen(query) = 0) break; φrintf(lf, "<I> %s</I> <P>", query); numQuery = createArray(query, queryTerms);
Figure imgf000067_0001
φrintf(pf, "Terms in Query: "); for (j = 0; j < numQuery; j++) φrintf(pf, " %s", queryTerms[j]); φrintf(pf, "<BR>");
/* initialize InterPrompts and unionPrompts array */ for (i = 0; i < 20; i++)
{ t2Prompts[i] = tlPromptsfi] = 0;
InterPrompts [i] = unionPrompts[i] = interUnionPrompts[i] = 0;
} start = 1; numhiterUmon = numT2 = numTl = numlnter = numUnion = 0;
/* Scan thru all the words to generate union/intersection of prompts*/ for (i = 0; i < numQuery; i++)
{
/* if not in index words check thesaurus */ if (!inArray(columnTerms, queryTeπns[i], numColumn))
{ learnFlag = numTl = numT2 = 0; scanThesaurus(queryTerms[i], tlPrompts, t2Prompts, &numTl, &numT2);
/* if unknown/learned word save it to array */ if (learnFlag)
{ unknownWordsfnumUnknown] = i, numUnknown++; addWord(&uWords, queryTerms [i], ++numUW); if (numTl = 0 && numT2 = 0) continue; else thesaurusFlag = 1 ;
} else thesaurusFlag = 1;
} else
{ numTl = fetchPrompts(queryTerms[i], tlPrompts); numT2 = fetchPrompts(queryTerms[i], t2Prompts); /***** ***************************** ************* φrintf(pf, "%s (index) :", queryTerms [i]); for (j = 0; j < numTl ; j++) φrintf(pf " %d", tlPrompts[j]); φrintf(pf, "<BR>"); fflush(pf); *********************************************** /
} if (start) /* if first word */
{ numlnter = PromptUnion(InterPrompts, t2Prompts, numlnter, numT2); numUnion = PromptUnion(unionPrompts, tlPrompts, numUnion, numTl); numlnterUnion = PromptUnion(interUnionPrompts, tlPrompts, numhiterUmon, numTl); start = 0;
} else
{ numlnter = PromptIntersection(InterPrompts, t2Prompts, numlnter, numT2); numUnion = PromptUnion(unionPrompts, tlPrompts, numUnion, numTl); numhiterUmon = PromptIntersection(interUnionPrompts, tlPrompts, numhiterUmon, numTl);
} } φrintf(pf, "Final Intersection Result: "); for (j = 0; j < numlnter; j++) φrintf(pf," %d", h terPrompts(j']); φrintf(pf, "<BR>"); φrintf(pf, "Final Intersection of Union Result: "); for (j = 0; j < numhiterUmon; j++) φrintf(pf, " %d", interUnionPromptsfj]); φrintf(pf, "<BR>"); φrintft pf, "Final Union Result: "); for (j = 0;j < numUnion; j++) φrintf(pf, " %d", umonPrompts[j]); φrintf(pf, "<BR>"); fflush(pf);
if (numlnter < minPromptCount && thesaurusFlag)
{ if (numlnterUnion < minPromptCount) numlnter = PromptUnion(InterPrompts, unionPrompts, numlnter, numUnion); else numlnter = PromptUnion(InterPrompts, interUnionPrompts, numlnter, numlnterUnion);
} φrintf(pf, "Final Selection : "); fflush(pf); for (j = 0; j < numlnter; j++) φrintf(pf, " %d", InterPromptslj]); φrintf f, "<BR>"); fflush(pf); numlnter = orderPrompts(InterPrompts, numlnter); numlnter = removeChild(InterPrompts, numlnter); // eliminate prompts > 3 for (j j = 3; j < numlnter; j++)
InterPrompts[j] = 0; numlnter = min(numlnter, 3); φrintf(pf, "Selection After Elimination of descendants: "); fflush(pf); for (j = 0; j < numlnter; j++) φrintftjpf, " %d", InterPrompts[j]); φrintf(pf, "<BR>"); fflush(pf); selectedPrompt = GetPrompt(InterPrompts, numlnter); if (selectedPrompt = 100) continue;
// if (updateFlag) learnThesauras(selectedPrompt, unknownWords, numUnknown, flnm); updateFlag = 0; for(j = 0; (j < numMenu) && (menuList[j][l] != selectedPrompt); j++); if(menuList|j][2] >= 99)
{ for (i = 0; i < numPF; i++)
{ if (!strcmp(Fprompts[i][l], prompts [selectedPrompt - 1]))
{ for(k = 0; k < numForms; k++) if (!strcmp(Fprompts[i][0],formlist[k]->name))
{ fillForm(formlist[k], queryList, numQueryList); processForm(formlist[k]); break;
} break;
}
} if (i = numPF)
{ system("clear"); printf(" nYour query has been understood. W); printf("Please wait to be transferred to the relevant department.Wn"); φrintf(lf,"<P>Your query has been understood.<LI>"); φrintfilf, "Please wait to be transferred to the relevant department.<HR>"); break;
}
} else
{ printf('V%sWn",prompts[menuList ][2] - 1]); φrintf(lf, "\n<P>%s<HR>",prompts[menuList(j][2] - 1]);
}
// modified for the loop printf("Do you have another query?Wn"); fgets(query,80,stdin); if (! chkNegtn(query))
{ for(i = 0; i < numQueryList; i++) free(queryList[i]); for(i = 0; i < numForms; i++) free(formlist[i]); free(formlist); free(queryList); queryList = NULL; numForms = loadForms(fdoc); numQueryList = 0;
//printf("Please tell us your query. W ); , //fgets(query,255,stdin); continue;
} system("clear");
Figure imgf000070_0001
break;
} φrintf(lf, "</HTML> n</BODY>W); φrintf f, "</HTML>W^/BODY>W); fclose(lf); fclose(pf);
} int scanThesaurus(char *word, int *tlPrompts, int *t2Prompts, int* nl, int * n2)
{ int i, j, k = 0, 1; int m, φ[20], sflg = l; for (i = 0; i < 20; i++) tlPrompts[i] = t2Prompts[i] = tp[i] = 0; for (1 = 0; 1 < numRow; 1++) if (!strcmp(word, rowTerms[l])) break; /* if the word is not present in thesaurus */ if (1 = numRow)
{ φrintf(pf, "%s (unknown) <BR>", word); learnFlag = 1 ; return 0;
} else
{ if (1 >= numOrgRow)
{ φrintf(pf, "%s (learned):<BR>", word); learnFlag = 1;
} else φrintf(pf, "%s (thesaurus):<BR>", word); for (j = 0; thesaurus [l][j] && j < numRow; j++)
{ m = fetchPrompts(columnTerms [thesaurus [l][j] - 1], tp); φrintf(pf, "<LI>%s (index) :", columnTerms[thesaurus[l][j] - 1]); for (k = 0; k < m; k++) φrintf f, " %d", φ[k]); φrintf(pf, "<BR>");
*nl = PromptUnion(tl Prompts, φ, *nl, m); if(sflg)
{
*n2 = PromptUnion(t2Prompts, φ, *n2, m); sflg = 0;
} else
{
*n2 = Promptlntersection(t2Prompts, φ, *n2, m);
}
} φrintf(pf, "Union Result: "); for (k = 0; k < *nl; k++) φrintf(pf, " %d", tlPrompts[k]); φrintf(pf, "<BR>"); fprintftjpf, "Intersection Result: "); for (k = 0; k < *n2; k++) φrintf(pf, " %d", t2Prompts[k]); φrintf(pf, "<BR>"); } return k;
}
PromptUnion : does a union of arrays pointed by pi and p2 and stores in pi . returns the total elements in result int PromptUnion(int *pl, int *p2, int nl, int n2)
{ inti,j; for (i = 0; i < n2; i++)
{ for(j = 0;j<nl;j++) if(pl 1=p2[i]) break; if(j = nl)
{ plD']=p2[i]; nl++;
}
} return nl;
}
Promptlntersection : does a intersection of arrays pointed by pi and p2 and stores in pi . returns the total elements in result int Promptlhtersection(int *pl, int *p2, int nl, int n2)
{ inti,j; for(i = 0;i<nl;i++)
{ for(j:=:0;j<n2;j++) if(pl[i]=p2D]) break; if (j=n2)/* not there*/
{ for(j = i;j<nl;j++) plD]=plϋ + l]; nl-; i-S
} } return nl; } ***φφ*****φφ**φ**Φ*Ψ*Φ*******φ*φφ**φφ;|.φ***φ;I:.l: :(.;!..-!.**#***********:].* fetchPrompts : Will fetch all the prompts for 'word' into Arraylist pointed by tlPrompts;
****φ****;I::(; *****************************************************/ int fetchPrompts(char *word, int *tl Prompts)
{ int i,j, k, 1; for (i = 0; i < 20; i++) tlPromρts[i] = 0; if ((i = inArray(columnTerms, word, numColumn)) = 0) return 0; i-S for (j = 0; (tlPromptstj] = indexList[i][j]) && (j < numlndex); j++); return j;
}
GetPrompt: Returns the final prompt selected by user int GetPrompt(int *Parray, int pent)
{ int i,j, k, l; int mmflag = 0, af = 0; char ans[80]; while (1)
{ system("clear"); printf("W); φrintf(lf, "<P>");
// Removed the comments to reintroduce last prompt if (pent = 1 && isLeaf(Parray[0]) && numUnknown > 0) af= l; // if ((pent > 1) || (pent = 1 && af = 1))
{
// sortPrompts(Parray, pent); orderPromptsfParray, pent); for (i = 0; i < pent; i++)
{ printf("%sWn", prompts[Parray[i] - 1]); φrintf(lf, "<LI>%s", prompts[Parray[i] - 1]);
} if(!mmflag)
{ otheFlag = 0; alarm(timeout);
} fgets(ans, 80, stdin); /* accept the user input */ alarm(O); φrintfl f, "<PxI>%s</I><P>", ans); fflush(lf); if (otheFlag = 1 && chkAfrm(ans)) j = 0; else
{ if (chkNegtn(ans) && otheFlag != 1) j = 0; else
{ addWord(&queryList, ans, ++numQueryList); j = chkAns(ans, Parray, pent);
} otheFlag = 0;
} if(j — -99)
{ updateFlag = 1 ; return 100;
} if (j < 0)
{ pent = removeZeros(Parray,pcnt); continue;
} mmflag = 0;
} else j = pcnt; ifO = 0)
{ pent = getNodesfj, Parray); mmflag = updateFlag = 1;
} else
{ if (isLeaf(Parray[j - 1]))
{ return Parray[j - 1];
} else pent = getNodes(Parray[j - 1], Parray);
} af= l; }
/********************************************************************* isLeaf: Returns 1 if 'node' is a leaf in the menutree, else 0
******************* **************************************************/ int isLeaffint node)
{ int i; for (i = 0; i < numMenu; i++) if (menuList[i][l] — node) break; if (i = numMenu) return 0; return menuList[i][2];
} int gefNodesrint pnode, int *parray)
{ int i, j; for (i = 0, j = 0; i < numMenu; i++) if (menuList[i][0] = pnode)
{ parrayϋ] = menuList[i][l];
} ρarray[j] = 0; return j;
}
/***************************************************************************** leamThesaurus : re-writes the thesaurus with releamed pattern and newly learned word. ***************************************************************************** / leamThesaums(int pmpt, int unknownWords [], int numUnknown, char *flnm)
{ int i, j, k, 1;
FILE *φ; int *tmpList, tmpCount;
/* create and initialize a imp Array */ tmpList = (int *)calloc(numColumn, sizeof(int)); for (i = tmpCount = 0; i < numColumn; i++) tmpList[i] = 0; /* scan thru the query words and gather a list of unique keywords in tmp array*/ tmpCount = getKeyWords(queryTerms, numQuery, tmpList); /* Locate the row for select prompt, if not create new row */ for (k = 0; k < numScore && scoring[k][0] != pmpt; k++); if (k >= numScore)
{ scoring = (int **)realloc(scoring, (k + 1) * sizeof(int *)); scoring[k] = (int *) malloc((numColumn + 1) * sizeofrint)); for (j = 0; j <= numColumn; j++) scoring[k][j] = 0; numScore++; } scoring[k][0] =pmpt; for (j = 0; j < tmpCount; j++) scoring[k] [tmpList[j]]++;
for (i = tmpCount = 0; i < numColumn; i++) tmpList[i] = 0; for (j = i = 0; j < numColumn; j++)
{ for (k = 0; k < numlndex && indexList[j][k] != 0; k++) if (indexList[j][k] = pmpt). break; if (k < numlndex && indexListD][k] != 0)
{ tmpList[i] = j + 1; i++; } } tmpCount = i; φ = fιleOpen(flnm, "w"); fprintf(pf, "<BR><B>Leamed words</B><BR>"); φrintf(φ, "[%s]W, "EXT-THESAURUS"); for (i = numOrgRow; i < numRow; i++)
{ φrintf(φ, "%s: ", rowTerms[i]); if (updateFlag && inArray(uWords, rowTerms [i], numUW))
{ φrintftjpf, "%s (relearned)<BR>original: ", queryTerms[unknownWords[i]]); for (k = 0; k < numColumn; k++)
{ if(thesaurus[i][k] != 0) φrintf(pf, " %d", thesaurus[i][k]); if (thesaurus [i][k] — 0) break;
} φrintf(pf, "<BR>"); k = PromptUnion(thesaurus[i], tmpList, k, tmpCount); φrintftjpf, "new :"); for (j = 0; j < k; j++) φrintf(pf, " %d", thesaums[i]Q]); φrintf(pf, "<BR><BR>");
} for (j = 0; j < numColumn; j++)
{ if (thesaurus [i][j] = 0) break; φrintfffp, "%d,", thesaurus[i][j]);
} φrintf(φ, "W);
} for (i = 0; updateFlag && i < numUW; i++)
{ if (inArray(rowTerms, uWords[i], numRow)) continue; φrintf(φ, "%s: ", uWords[i]); φrintf(pf, "%s(new-leamed) :", uWords[i]); addWord(&rowTerms, uWords[i], ++numRow); thesaurus = (int **)realloc(thesaurus, numRow * sizeof(int *)); thesaurus [numRow - 1] = (int *)malloc(numColumn * sizeof(int)); for (j = 0; j < numColumn; j++) thesauras[numRow -l][j] = 0; for (j = 0; j < tmpCount; j++)
{ thesaurus[numRow - l][j] = tmpList[j]; φrintf(φ, "%d,", tmpListO]); fprintf(pf, " %d", tmpListfj]);
} φrintf(φ, "W); φrintf(pf, "<BR><BR>"); } φrintf(φ, "W);
/* write the scoring in the file */ φrintf(φ, "[%s]W, "SCORING"); for (i = 0; i < numScore; i++)
{ φrintf(φ, "%d,", scoring[i][0]); for(j = 1 ; j <= numColumn; j++) φrintf(φ, "%d,", scoring[i][j]); φrintf(φ, "W);
} φrintf(φ, "\n"); fclose(φ);
} ************************************************************************* removeChild: removes descendents of all the elements from the list ************************************************************************* int removeChild(int * array, int tot)
{ int i,j, k, cnt = 0; int *tmparray, m = 99; tmparray = (int *)calloc(numIndex, sizeof(int));
/* Remove any prompts that are responses rather than choices */ for (i = 0; i < tot; i++)
{ for(j = 0; j < numMenu; j++) if (menuList[j][l] = array[i] && menuList[j][2] = 100) array [i] = 0;
}
/* Remove any prompts that are root node and have a child which is not a leaf rather than choices.
*/ for (i = 0; i <tot; i++)
{ if (array[i] = 0) /* already removed so go to next */ continue;
/* if (isLeaf(array[i])) continue; */ m = array [i]; while(l)
{ for(j = 0; j < numMenu; j++) if (menuList[j][l] = rn) break; if(menuListfj][0] = 0) break; m = menuList[j][0];
} if ( m != array[i])
{ for O' = 0; j < tot; j++) { if(array[j]=rn) arrayrj] = 0; }
} for (i = 0; i < tot; i++)
{ if (array[i] = 0) /* already removed so go to next */ continue; for (j = 0; j < numlndex; j++) /* initialize tmparray */ tmparray[j] = 0; cnt = getChildren(array[i], tmparray); /* get children & grand-children of i */ for (j = 0; j < tot; j++) /* scan thru the array to check for child */ if (j != i) /* ignore self from checking */ for (k = 0; k < cnt; k++) if (array[j] = tmparray[k])
{ array [j] = 0; /* if j is child of i, make it 0 */ break; } } /* Shift All non-zeroes upwards */ for (i - 0; i < tot; i++)
{ if (array[i] = 0)
{ for(j = i+l;j<tot;j++) if(array[j] O) break; if 0 < tot)
{ array[i] = airayfj]; array[j] = 0;
} } } /* count no of elements */ for(j = 0;j<tot;j++)
{ if(array[j] = 0) break;
} return j;
} ******************************************************************** getChildren: fetches all the descendents of pmpt into array ******************************************************************** / int getChildren(int pmpt, int *array)
{ int ι, j, k, 1; int t, tl, t2; int *tmparrayl, *tmparray2; if (isLeaf(pmpt)) /* if node is leaf no children so return 0 */ return 0; tmparrayl = (int *)calloc(numIndex, sizeof(int)); /* child of child in every loop */ tmparray2 = (int *)calloc(numfrιdex, sizeof(int)); /* union of all scanned children */ t = tl = t2 = 0; for (i = 0; i < numMenu; i++)
{ if (menuList[i][0] = pmpt && menuList[i][2] != 100)
{ array[t] = menuList[i][l]; tl = getChildren(array[t], tmparrayl); t2 = PromptUnion(tmparray2, tmparrayl, t2, tl); t++;
}
} t = PromptUnion(array, tmparray2, t, t2); return t;
}
int chkAns (char * ans, int * Parray, int pent)
{ char locquery[256]; int i, j, tmp lent = 0, tmp2cnt = 0; char *resWords[50], start = Υ'; int numWords, tmpArraylβO], tmpArray2[20]; int uwFlag = 0, rowOrColWord = 0; strcpy(locquery,ans); numWords = breakStr(ans, resWords); if ( strcmp(resWords[0],"other") = 0 && strcmp(resWords[l],"oρtions") = 0)
{ return 0;
} numWords = processArray(res Words, numWords, 1); for (i = 0; i < 20; i++) tmp Array l[i] = tmpArray2[i] = 0; φrintf(pf,"<li>hιitialized Temp ArrayW); fflush(ρf); for (i = 0; i < numWords; i++)
{ if (!inArray(columnTerms, resWords[i], numColumn))
{ if (!inArray(rowTerms,resWords[i],numColumn))
{ if (!inArray(uWList, resWords[i], uWNum))
{ addWord(&uWList, resWords[i], ++uWNum); fflush(lf);
} else
{ φrintf(pf,"<li>Unknown Word: %s\n",resWords[i]); fflush(pf); uwFlag = 1; /* unKnown word encountered twice */
} } else rowOrColWord++; continue;
} else rowOrColWord++; trnplcnt = fetchPrompts(resWords[i], tmpArrayl); if (start = 'Y')
{ tmp2cnt = PromptUnion(tmpArray2, tmpArrayl, tmp2cnt, trnplcnt); start='N';
} else tmp2cnt = PromptIntersection(tmpArray2, tmpArrayl, tmp2cnt, trnplcnt); tmp2cnt = PromptIntersection(tmpArray2, Parray, tmp2cnt, pent);
} if (tmp2cnt != 1)
{ if (tmp2cnt = 0 && pent = 1 && numWords =: 1) // i.e. only one prompt & not selected
{ strcpy(ans, locquery); if (chkAfrm(ans)) return 1 ;
} if (tmp2cnt > 1) // i.e. multiple prompt selection then do score
{ strcpy(ans, locquery); return checkscore(ans, Parray, pent);
if (uwFlag) if (AskforOp()) return -99; else return -1; else if(rowOrColWord)
{ strcpy(query,locquery); return -99;
}
} for (i = 0; Parray[i]; i++) if (Parray[i] = tmpArray2[0]) return i + 1;
} int AskforOp()
{ int i, j ;. char *resWords[50]; int numWords ; system(" clear"); printf("Your request was not understood. W); printf("Would you prefer to speak to an operator or try again with a new request?W); φrintfl f, "<P>Your request was not understood.<LI>"); φrintf(lf, "Would you prefer to speak to an operator or try again with a new request?W); fflush(lf); fgets(query, 255, stdin); /* accept the user input */ addWord(&queryList, query, ++numQueryList); φrintfl f, "<P><I> %s</I>", query); numWords = breakStr(query, resWords); if ( irιArray(resWords,"operator",numWords))
Figure imgf000082_0001
printf("\n\nPlease wait for the operator ...\n"); φrintf(lf,"<P>Please wait for the operator ..."); fflush(lf); exit(0);
} if( inArray(resWords,"try",numWords) && inArray(resWords,"again",numWords))
{ system("clear"); printf("Please tell us your new requestW); φrintf(lf, "<P>Please tell us your new requestW); fflush(lf); fgets(query, 255, stdin); /* accept the user input */ addWord(&queryList, query, ++numQueryList);
} return 1;
} void sayOther()
{ printf("\nWould you like to hear other options? n"); φrintfi f, "<LI>Would you like to hear other options?<P>"); otheFlag = 1;
} int checkscore(char *ans, int *Parray, int pent)
{ char * resWords[50], *pmptWords[50]; int i, j, *score, *scorel; int numWords, nump Words, maxscore; score = (int *)malloc(pcnt * sizeof(inf)); scorel = (int *)malloc(pcnt * sizeof(int)); for (i = 0; i < pent; i++) score[i] = scorel [i] = 0; numWords = breakStr(ans, resWords); for (i = 0; i < pent; i++)
{ nump Words = breakStr(prompts[Parray[i]-l], pmptWords); for (j = 0; j < numWords; j++) if (inArray(pmptWords,resWords[j], nump Words)) score[i]++;
} for (i = maxscore = 0; i < pent; i++) maxscore = (maxscore < score[i])?score[i]:maxscore; for (i = j = 0; i < pent; i++) j += (score[i] = maxscore)?l:0; if ( j = 1) /* single prompt selection */
{ for (i = 0; i < pent; i++) if (score[i] = maxscore) return i + 1;
} else
{ for (i = 0; i < pent; i++) { nump Words = brealcStr(prompts [Parray [i] - 1], pmptWords); scorel [i] = getscorel (res Words, numWords, pmptWords, nump Words);
} maxscore = 0; for (i = 0; i < pent; i++) maxscore = (scorel [i] > maxscore)?scorel[i]:maxscore; for (i = j = 0; i < pent; i++) j += (scorel [i] = maxscore)? 1:0; if ( j = 1) /* single prompt selection */
{ for (i = 0; i < pent; i++) if (score l[i] — maxscore) return i + 1;
} else
{ for (i = 0; i < pent; i++) if(score[i] != maxscore)
Parray[i] = 0; return -1;
} int chkAfrm( char * str)
{ int i,j, numWords; char * resWords[50]; numWords = breakStr(str, res Words); for (i = 0; i < numWords; i ++) if (inArray(affrmWords, resWords[i], 3)) return 1; return 0;
} int chkNegtn( char * str)
{ int i,j, numWords; char * resWords[50]; numWords = breakStr(str, res Words); for (i = 0; i < numWords; i ++) if (inArray(negWords, resWordsfi], 2)) return 1 ; return 0; } int getscorel (char **Wordl, int numl, char **Word2, int num2)
{ int i,j, scr = 0; int Ismatch = 0; for(i = 0; i < numl; i++)
{ for(j = Ismatch; j < num2; j++) if (!strcmp(Wordl [i],Word2[j]))
{ scr++; break;
} if (j < num2)
Ismatch =j + 1; } return scr;
} int orderPrompts(int *InterPromρts,int numh ter)
I int i,j, k, 1; int *tmpArray[2]; /* 0 - score ; 1 - level; 3 - menu order */ int *tmpList, tmpCount; tmpArrayfO] = (int *)malloc(numfrιter * sizeof(int)); tmpArrayfl] = (int *)malloc(numInter * sizeof(int)); tmpList = (int *)malloc(numColumn * sizeof(int)); for (i = 0; i < numColumn; i++) tmpList[i] - 0; // get the list of keywords from queryTerms tmpCount = getKeyWords(queryTerms, numQuery, tmpList); for (i = 0; i < numlnter; i++)
{
/* get the maxscore for the prompt */ tmpArray[0][i] = 0; for (j = 0; (j < numScore) && (scoring[j][0] != frιterPrompts[i]); j++);
/* if any previous scoring present */ if ((j < numScore) && (scoring[j][0] = hrterPrompts[i]))
{
// get the max score for ( k = 0; k < tmpCount; k++) tmp Array [0][i] = max(tmpArray[0][i] , scoring[j][tmpList[k]]); } tmpArray[l][i] = getLevel(InterPrompts[i]); }
// sort the array in order of score, level and menu-order for ( i = 0; i < (numlnter - 1); i++)
{ for (j = i + 1 ; j < numlnter; j++) if (!gThan(tmp Array [0][i], tmpArray[l][i], InterPrompts [i], tmρArray[0][j], tmpArray[l][j], InterPrompts[j]))
{ swap(tmpArray[0][i], tmpArray[0][j]); swap(tmpArray[l][i], tmρArray[l][j]); swap (InterPrompts [i] , InterPrompts [j ] ) ; } } return numlnter; } int getKeyWords(char **queryTerms, int numQuery, int *tmpList)
{ int i, j, k, 1; int count = 0; for (j = 0; j < numQuery; j++)
{
/* Check if the word is keyword */ if ((k = inArray(columnTerms, queryTerms[j], numColumn)) != 0)
{
/* add in temp list only if not present */ for (i = 0; i < count && tmpList[i] != k ; i++); if (i >= count) tmpList[count++] = k; continue; }
/* check if the word is Thesaurus/Learned Word */ if ((k = inArray(rowTerms, queryTermsQ], numRow)) != 0)
{
/* pick-up all keywords for that word */ for (i = 0; thesaurus[k - l][i] != 0; i++)
{ for (1 = 0; 1 < count && tmρList[l] != thesaurus[k - l][i] ; 1++); if (1 >= count) tmpList[count++] = thesaurus[k - l][i];
} } } return count; } int getLevel(int pmpt)
{ int i, k, 1; for (i = 0; i < numMenu && menuList[i][l] != pmpt; i++); k = menuList[i][0]; for (1 = 0; k > 0;1++)
{ for (i = 0; i < numMenu && menuList[i][l] != k; i++); k = menuList[i][0];
} return 1;
} int gThan(int a, int b, int c, int p, int q, int r)
{ if (a > p) return 1 ; // Desc order here if (a < p) return 0; // Desc order here if (b > q) return 0; // Asc order here if (b < q) return 1 ; // Asc order here if (c > r) return 0; // Asc order here return 1 ; // Asc order here
}
formlib.c: This program contains functions for forms processing #include <stdio.h> #include <string.h> rrinclude "arraylib.h" struct input { char *Type; char *APrompt; char *RPrompt; char *Name; char *Nalue; char **Choice; int numChoice;
}; struct form { char * name; struct input **fields; int numFields;
}; char * split(char * , char ); int loadForm(FILE *f, struct form *frm, char *name)
{ intj, start-0; char buf[512]; char fname[20]; sprintf(fname, " [%s] ",name) ; fseek(f,SEEK_SET,0); while(fgets(buf,512,f) != NULL) { j = strlen(buf); if (buffj - 1] = V) bufTj - 1] = 0; if (start)
{ if (strlen(buf) = 0) /* if blank line, stop reading */ break; frm->numFields++; frm->ftelds = (struct input **)realloc(frm->fϊelds, (frm->numFields) * sizeof(stract input *)); frm->fields[frm->numFields-l] = (stract input *)malloc(sizeof(struct input)); loadhιput(frm->fields [frm->numFields- 1 ] , buf) ;
} else if (!strcmp(fhame, buf)) { start = 1; frm->name = strdup(name); frm->numFields=0 ; frm->fιelds=NULL; } } return start;
} loadInput(struct input *inp, char * str)
{ char ***list, *tmpstrl, *tmpstr2; int i, j, len; inp->Type = inp->APrompt = inp->RPrompt = inp->Name = inp->Value = NULL; list = (char ***)malloc(2 * sizeof(char **)); list[0] = (char **)malloc(2 * sizeoffchar *)); list[l] = (char **)malloc(2 * sizeof(char *)); list[0][0] = str; for(i=0;(list[i+l][0] - split(list[i][0],':'))!ANULL;i++)
{ list[i][l] = split(list[i][0],'='); list = (char ***)realloc(list,(i+3)*sizeof(char**)); list[i+2] = (char **)malloc(2 * sizeof(char *));
} list[i][l] = split(list[i][0],'='); len = i + 1; for(i=0; i <len;i++)
{ if ( ! strcmp("Type",list[i] [0])) mystrcp(&inp->Type,list[i] [ 1 ]) ; if (! strcmpC APrompt",list[i] [0])) mystrcp(&inp->APrompt,list[i][l]); if (!strcmp("RPrompt",list[i][0])) mystrcp(&inp->RPrompt,list[i][l]); if (! strcmp("Name",list[i] [0])) mystrcp(&inp->Name,list[i] [ 1 ]); if(!strcmp("Nalue",list[i][0])) mystrcp(&inp->Value,list[i][l]); if(!strcmp("Choice",list[i][0]))
{ .mystrcp(&tmpstrl, list[i][l]); tmpstr2 = tmpstrl ; inp->Choice = NULL; inp->numChoice=0 ;
, forG=0;tmpstrl[j];j++)
{ if (tmpstrl 0]=*,')
{ tmpstrl [j]=0; inp->Choice = (char **)realloc(inp->Choice,(inp- >numChoice+l)*sizeof(char *)); inp->Choice[inp->numChoice++] = strdup(tmpstr2); allTrim(inp->Choice[inp->numChoice- 1 ]); tmpstr2=tmpstrl+j+l ;
}
} inp->Choice = (char **)realloc(inp->Choice,(inp-
>numChoice+l)*sizeof(char *)); inp->Choice[inp->numChoice++] = strdup(tmpstr2); allTrim(inρ->Choice[inp->numChoice- 1 ]); } } } mystrcp(char **strl, char *str2) { int ien, i, j; len = strlen(str2); if(str2[0]="" && str2[len-l]=="") // i.e. quoted string; for (i = str2[~len] = 0; (str2[i] = str2[i + 1]); i++); *strl = (strlen(str2)=0)?NULL:strduρ(str2); } char * split(char * str, char dim)
{ . int i; for (i = 0; str[i]; i++) if (str[i] = dim)
{ str[i] = 0; return str + i + 1;
} return NULL;
} acceptForm(struct form *frm)
{ int i; char ans[256]; struct input cnfin; cnfm.Type = "MChoice"; cnfhi.APrompt = strdup('Ts this information correct?"); cnfm.numChoice = 4; cnfin. Choice = (char **)malloc(2 * sizeof(char *)); cnfm.Choice[0] = strdup("no"); cnfm.Choice[l] = strdup("yes"); cnfin.Choice[2] = strdup("right"); cnfm.Choice[3] = strdup("correct"); cnfm.Value = NULL; system("clear"); printfC'W); for(i = 0; i<frm->numFields; i++)
{ if (! strcmρ(frm->fields[i]->Type, "Say")) sayText(frm->fields[i]); if(frm->fιelds[i]->Value != NULL) continue; if(!strcmp(frm->fϊelds[i]->Type,"AcceptResponse")) getText(frm->fields[i]); if (!strcmρ(frm->fields[i]->Type, "MChoice")) getChoice(frm-->fιelds[i]);
} while (1)
{ system( "clear");
Figure imgf000091_0001
for(i = 0; i<frm->numFields; i++)
{ if (!strcmp(frm->fields[i]->Type, "AcceptResponse")) sayText(ffm->fields [i]) ; if (!strcmp(frm->fιelds[i]->Type, "MChoice")) sayText(frm->fields[i]);
Figure imgf000091_0002
printf("\n"); getChoice(&cnfm) ; if (strcmp(cnfinNalue, "no ")) return 1; system("clear");
Figure imgf000091_0003
for(i = 0; i<frm->numFields; i++)
{ if (! strcmp(frm->fields[i]->Type, "AcceptResponse")) getText(frm->fields [i]) ; if (! strcmp(frm->fields[i]->Type, "MChoice")) getChoice(frm->fields [i] ) ;
} }
} getText(struct input * inp)
{ char buf[256]; printf('V%s\nW^,inρ->APrompt); fgets(buf,255,stdin); allTrim(buf); inp-> Value = strdup(buf);
} sayText(struct input * inp)
{ if(inp->RPrompt l- ΝULL) printf("%s",inρ->RPromρt); if(inp->Value != ΝULL) printf("%s",inp->Value); if (inp->RPrompt != NULL || inp->Value != NULL) printf(".W); } fillForm(struct form * firm, char ** Array, int arrCount)
{ int i, j, wrdCount = 0, tmpCount = 0; char **wordList = NULL; char *tmparray[50]; for(i = 0; i < arrCount; i++)
{ tmpCount = breakStr(Array[i], tmparray); wrdCount = mergeArray(&wordList,tmparray, wrdCount, tmpCount);
} wrdCount = process Array(wordList, wrdCount, 1); for(i = 0; i < frm->numFields; i++) if(!strcmp(frm->fields[i]->Type, "MChoice")) selectValue(frm->fields[i], wordList, wrdCount); } int select Value(struct input * inp, char **array, int arrCount)
{ int i, j, *score; char *tmparray[20] ; int max, maxcount, tmpCount; score = (int *) malloc(inp->numChoice * sizeofrint)); for (i = 0; i < inp->numChoice; i++)
{ score[i] = 0; tmpCount = breakStr(inp->Choice[i], tmparray); if (tmpCount > 1) // Basically to avoid filtering of 'yes', 'no' etc filterStopWords(tmρarray, tmpCount); tmpCount = processArray(tmparray, tmpCount, 0); for(j = 0; j < tmpCount; j++) if (inArray(array, tmparray[j], arrCount)) score[i]++;
} for(i = max = 0; i < inp->numChoice; i++) if (scorefi] > max) max = scorefi]; for(i = maxcount = 0; i < inp->numChoice; i++) if (score[i] = max) maxcount++; if (maxcount != 1) return 0; for(i = 0; i < inp->numChoice; i++) if (score[i] — max)
{ inp-> Value = strdup(inp->Choice[i]); break;
} return 1 ;
} processForm (struct form *frm)
{ int i, j; char *formType = NULL, *formAction = NULL; for(i = 0; i<frm->numFields; i++)
{ if (frm->fιelds[i]->Value = NULL) continue; if (! strcmp(frm->fields[i]->Type,''FormType'')) formType = strdup(frm->fϊelds[i]-> Value); if (! sfrcmp(frm->fields[i]->Type,"FormAction")) formAction = strdup(frm->fields[i]-> Value); }
// If not defined the form type use 'AcceptFrom' as default, if (formType = NULL) formType = strdup("AcceptForm"); if (! strcmp(formType," AcceptForm")) j = acceptForm(frm); if (! strcmp(formType,"ResponseForm")) j = responseForm(frm); if 0' != 0 && formAction != NULL) performAction(frm, formAction); } responseForm(struct form *frm)
{ int i; system("clear"); printf("W); for (i = 0; i < frm->numFields; i++)
{ if (sfrcmp("Say",frm->fιelds[i]->Tyρe)) continue; sayText(frm->fields [i]) ;
} printfC'W);
} getChoice(struct input * inp)
{ char buf[256], *tmparray[50]; int tmpCount; while (1) { printfC '\n%s\n\n" , inp-> APrompt) ; fgets(buf,255 ,stdin); tmpCount = breakStrfbuf, tmparray); if (tmpCount > 1) // Basically to avoid filtering of 'yes', 'no' etc filterStoρWords(tmparray, tmpCount); tmpCount = processArray(tmparray, tmpCount, 0); if (selectValue(inp, tmparray, tmpCount)) return; }
} performAction(struct form *frm, char *action)
{ struct form f; char * cmd = NULL; char buf [256]; int i, j, lenl, len2;
FILE *pd; sprintf(buf, "%s «EODW, action); cmd = strdup(buf); for (i = 0; i < frm->numFields; i++)
{ if (frm->fields[i]->Name = NULL) continue; sprintf(buf,"%s=%c%s%cW,frm->fields[i]->Name,'"',frm->fields[i]->Value,*"'); lenl = strlen(buf); len2 = strlen(cmd); cmd = (char *) realloc(cmd, (lenl + len2 + 1) * sizeof(char)); strcat(cmd, buf);
} sprintf(buf,"EODW); lenl = strlenfbuf); len2 = strlen(cmd); cmd = (char *) realloc(cmd, (lenl + len2 + 1) * sizeof(char)); strcat(cmd, buf); if ((pd = popen(cmd, "r")) = NULL)
{ φrintf(stderr, "Error in command executionW); exit(l);
} f.name = NULL; f.numFields = 0; f.fields = NULL; while ((fgets(buf, 255, pd)!= NULL))
{ j = strlen(buf); if (buffj - 1] = V) bufTj - 1] = 0; if (strlen(buf) = 0) /* if blank line, stop reading */ continue; f.numFields++; f.fields = (stract input **)realloc(f.fields, (f.nurnFields) * sizeof(struct input *)); f.fields[f.numFields-l] = (stract input *)malloc(sizeof(struct input)); loadlhput(f. fields [f.nurnFields- 1 ] , buf) ;
} pclose(pd); processForm(&f) ; }
HEADER FILES (C) globalvar.h: Header file for global variables extern FILE *webDoc, *phoneDoc; extern int numColumn, numRow, numlndex, numMenu; extern int startPoint, eofFlag, topValues; extern char **rowTerms, **columnTerms, **prompts, **stop ords; extern double **matrix, **cosine; float phoneThreshold, webThreshold; extern int **indexList, **menuList, **thesaurus; extern int numStopWord, numOrgRow; void stemArray(char **list, int arrayLen); extern int numForms, numPF; int stemWord(char *); extern char ***Fprompts; extern int numForms, numPF; extern stract form **formlist;
process.h: Header file declaring functions in process.c
* Process.h: *
int processFile(char * filename, char ***c Array, float threshold); void loadStopWords( char * filename) ;
// int allTrim( char *str); void filllndexO; void updateThesaurus( char *str, int pmpt); void createMatrix(char * filename);
// int readPara(FILE *φ );
// int wordsInPara (FILE *φ); void calcCosine(); int eraseZeroes(); void createThesauras();
// void floatSort(int *colnum, float *tmpcos, int numRow); void saveData(char *filenm);
arraylib.h: Header file declaring functions in arraylib.c
* ArrayLib.h * int fetchWord(FILE *f, char * wrd); int inArray(char ** array, char *word, int length); int removeNulls(char ** strarray, int numWords); int mergeArray(char ***Arrayl, char **Array2, int numArrayl, int numArray2); int readValues(char *str, char ** array); void sortArray(char *allwords[], int numwords); int loadPrompts(char *filename); void loadS top Words(char *);
FILE * fileOpen( char *filename, char *mode); void addWord(char *** c Array, char * word, int c); int breaks tr(char * str, char ** strarray);. void filterStopWords(char ** strarray, int numWords); void filterDuplicates(char ** strarray, int numWords); int loadFormsList( char *filename); int loadForms(char * filename); int allTrim( char *str); int createArray(char *, char **); int processArray( char **, int, int);
forms.h: Header file declaring functions in formlib.c
#include <stdio.h> extern struct input { char *Type; char *APrompt; char *RPrompt; char *Name; char *Value; char ** Choice; int numChoice; } a; extern struct form { char * name; stract input ** fields; int numFields; } b; char * split(char * , char ); int loadForm(FILE *, struct form *, char *); void loadfrrput(struct input *, char * ); void mystrcp(char **, char *); void dumphιput(FILE *, struct input *); void dumpForm(FILE *, stract form *); void acceptForm(stract form *); void getText(struct input * ); void fillForm(struct form * frm, char ** Array, int arrCount);
MAKE FILE makefile: Makefile for compiling the source code. all: t d demoran t: main.o process. o arrayhb.o stemhb.o formhb.o cc -g main.o process.o arrayhb.o stemhb.o formhb.o -o t -lm d: dialog.o interactive.o arrayhb.o stemhb.o formhb.o cc -g dialog.o interactive.o arrayhb.o stemhb.o formhb.o -o d demoran: demorun.c cc demorun.c -o demoran main.o: main.c process.h arraylib.h forms.h cc -c -g main.c process. o: process.c globalvar.h forms.h cc -c -g process.c arrayhb.o: arraylib.c globalvar.h cc -c -g arraylib.c dialog.o: dialog.c arraylib.h cc -c -g dialog.c interactive.o: interactive.c globalvar.h cc -c -g interactive.c stemhb.o: stemlib.c cc -c -g stemlib.c formhb.o: formlib.c cc -c -g formlib.c clean: rm -f *.o t d core demoran bkup: clean tar cvzf ../stem date "+%d%m"\tgz . PARAMETER FILES t.ini: This file contains parameters required for program 't' pdoc p # phonedoc wdoc w # webdoc sdoc s # stopwords fdoc f # forms xdoc x # link of forms & prompts- cfg z.cfg # config file pt 0.02 # phoneThreshold wt 0.0006 # webThreshold tv 5 # top Values for cosine d.ini: This file contains parameters required for program 'd' cfg t.cfg # config file lcfg l.cfg # learn file sdoc s # stopwords fdoc f # forms xdoc x # x minprompt 2 # minimum no of prompts timeout 30 # timeout sees for other options
DATA FILES p: Document 'p'
Are you calling about subscriptions?
Would you like to order a subscription?
Would you like to pay your subscription fees?
Would you like to give a gift subscription?
Would you like to change your address or change any other information?
Do you have any billing enquiries or concerns?
Would you like information about your account balance or your payments? Would you like to speak to a customer care representative?
Would you like to temporarily suspend your delivery? Is there a problem with your paper or delivery?
Did you miss today's paper?
Did you miss yesterday's newspaper and would you like credit for yesterday?
Did you receive a wet paper? Would you like information about the New Herald website?
Would you like to obtain your New Herald website password?
The website address is www.newherald.com. Would you like any other information about the website? Are you calling about advertisements?
Would you like to advertise in the New Herald? Is it a classified ad? Is it a full-page, half-page, or quarter-page ad? Would you like to place an ad? Is it a classified ad?
Is it a full-page, half-page, or quarter-page ad? Are you calling about something else?
Would you like to write to the New Herald?
Would you like to submit an article to the op-ed page?
Please email your article to oped@newherald.com. Would you like to send a letter to the editor?
Please email your letter to letters@newherald.com. Would you like to work for the New Herald?
Would you like to write for the New Herald?
Would you like to work for the editorial division or for the administrative division?
w: Document W
Now, it's easier than ever to manage your Herald. Welcome to The New Herald Subscription & Customer Care Web site. You expect all the news that's fit to print in each issue of The New Herald. And you can expect responsive, round-the-clock on-line customer care that allows you to review and update your delivery and billing information, stop delivery of your newspaper when you're away, discover special promotions and notify us of any questions or comments you have. And if you're not a subscriber, browse our Web site and consider subscribing to home delivery. Please enjoy your visit.
With convenient home delivery, you will be sure to receive all the wit, the wisdom, the news, the . views offered in every issue of The New Herald. And, through this special offer, you will get 50^ off the regular rate for the first eight weeks. To subscribe enter your ZIP code below and submit.
ZIP Code:
Expect the World Around the Clock
We are pleased to offer our subscribers instant, 24-hour on-line customer care to meet your service needs. Now, it's easier than ever to order home delivery, review your bill, or change your service — and to find out about special customer benefits and promotions.
Take Our Survey
Help us provide you with the highest quality customer service. This short survey asks for vital information about you and your service needs. The New Herald may perform statistical analysis of reader interests to identify ways to improve our services and products to better meet the needs of our subscribers. Personal information about you as an individual subscriber will not be provided to any third party. Our privacy policy is posted online to disclose our guidelines for the use of customer information.
You can handle most of your subscription service requests online, including:
* Suspending your delivery while you're away * Reporting missed deliveries
* Checking the status of your account
* Checking your billing history
* Changing your delivery or billing address
* Changing your method of payment To subscribe
Customer care:
Account Summary
Update Account
Activity History
Billing History
Paper not received
Suspend delivery
Complaints
Order Home Delivery at 50% Off (US Customers Only)
With convenient home delivery, you can start each day with all the news, the views, the wit and the wisdom you expect from The New Herald. And, through this special offer, you can save 50% on the first eight weeks when you order today. It's a smart, easy way to keep up with The Herald.
This offer expires December 31, 2001 and is valid in areas served by The New Herald' delivery service. Subscribers who have had Herald home delivery within the past 90 days are not eligible for this introductory offer. To subscribe enter your ZLP code below and submit.
GIFT SUBSCRIPTION OFFER
There's no present like The Herald. And, when you order a gift subscription of 12-week home delivery of The New Herald, you'll save 50% on the regular rate. Hurry. This offer expires December 31, 2001. To order, enter the ZIP code of the gift recipient below and submit.
Order Home Delivery at 50% Off (US Customers Only)
With convenient home delivery, you can start each day with all the news, the views, the wit and the wisdom you expect from The New Herald. And, through this special offer, you can save 50% on the first eight weeks when you order today. It's a smart, easy way to keep up with The Herald.
This offer expires December 31, 2001 and is valid in areas served by The New Herald' delivery service. Subscribers who have had Herald home delivery within the past 90 days are not eligible for this introductory offer. To subscribe enter your ZLP code below and submit.
ZIP Code:
GIFT SUBSCRIPTION OFFER
There's no present like The Herald. And, when you order a gift subscription of 12-week home delivery of The New Herald, you'll save 50% on the regular rate. Hurry. This offer expires December 31, 2001. To order, enter the ZIP code of the gift recipient below and submit.
ZIP Code:
LARGE TYPE WEEKLY
Developed especially for people with low vision, The New Herald Large Type Weekly offers a select package of the week's news printed in 16-point type— about twice the size of the regular type size. With its updated, color-enhanced design, The Large Type Weekly is a striking—and clearly readable way to enjoy The New Herald. A mail subscription of The New Herald Large Type Weekly makes a great gift for yourself or someone you care for.
To order, select a country/region below and submit.
Order Home Delivery at 50% Off (US Customers Only)
With convenient home delivery, you can start each day with all the news, the views, the wit and the wisdom you expect from The New Herald. And, through this special offer, you can save 50% on the first eight weeks when you order today. It's a smart, easy way to keep up with The Herald.
This offer expires December 31, 2001 and is valid in areas served by The New Herald' delivery service. Subscribers who have had Herald home delivery within the past 90 days are not eligible for this introductory offer. To subscribe enter your ZIP code below and submit.
ZIP Code:
GIFT SUBSCRIPTION OFFER
There's no present like The Herald. And, when you order a gift subscription of 12-week home delivery of The New Herald, you'll save 50% on the regular rate. Hurry. This offer expires December 31, 2001. To order, enter the ZIP code of the gift recipient below and submit.
ZIP Code:
LARGE TYPE WEEKLY Developed especially for people with low vision, The New Herald Large Type Weekly offers a select package of the week's news printed in 16-point type-about twice the size of the regular type size. With its updated, color-enhanced design, The Large Type Weekly is a striking— and clearly readable way to enjoy The New Herald. A mail subscription of The New Herald Large Type Weekly makes a great gift for yourself or someone you care for.
To order, select a country/region below and submit.
Country:
The New Herald Book Review
Get a head start on the latest book reviews, the acclaimed New Herald Best Sellers lists and everything new and noteworthy in the literary world. When you order a mail subscription to The New Herald Sunday Book Review, you'll receive it days in advance of the Sunday New Herald.
To order, select a country/region below and submit.
Country:
To Subscribe - Foreign Mail Subscriptions
Stay informed with all the news in the United States and throughout the world, including sharp analyses, reports and reviews from the world of business, sports and the arts. Discerning readers across the country and around the globe depend on The Herald for inside revelations, outside opinions, all sides of the story. Now you can too — with the convenience of home delivery by mail. Order now.
To change your address, method of billing or any of the account information featured below, please enter the updated information in the appropriate box. Once you have completed all information requested, please click Submit at the bottom of the page. (Please note: It is necessary for all bold fields to be filled out to process your updated information.)
Your billing and payment history provides an at-a-glance summary of your account and makes it simple to check on your balance, last payment and new charges. Recent invoices are listed below for your review. Questions may be submitted to our customer care billing representatives by going to the Complaints page. Please be sure to indicate Billing Inquiry as the nature of your complaint.
Did you miss a paper? The New Herald is committed to making sure you get every issue you've ordered. If you did not receive your paper or any of its sections, simply select one of the following redelivery options so that we may deliver one to you.
Please note: Only same day redelivery is available on-line; you must submit this information on the same day on which your paper or section was to be delivered. For credits on past issues, please phone our customer care representatives at 1(800) 555-9876. I would like to have today's paper delivered tomorrow. Please credit my account for today's missed paper.
Did you miss a paper? The New Herald is committed to making sure you get every issue you've ordered. If you did not receive your paper or any of its sections, simply select one of the following redelivery options so that we may deliver one to you.
Please note: Only same day redelivery is available on-line; you must submit this information on the same day on which your paper or section was to be delivered. For credits on past issues, please phone our customer care representatives at 1(800) 555-9876.
PAPER NOT RECEIVED
I did not receive today's paper.
ACCOUNT NUMBER: 060095544
Reason:
Select One: I would like to have today's paper delivered tomorrow.
Please credit my account for today's missed paper.
SECTIONS NOT RECEIVED
I received today's paper with the section(s) checked below missing
Sections not received: ARTS & LEISURE BUSINESS
DINING IN/OUT MAIN NEWS SEC
METROPOLITAN SPORTS
Select One: I would like to have today's paper delivered tomorrow.
Please credit my account for today's missed paper.
As a newspaper home delivery subscriber, you may suspend your service for any amount of time. When you suspend your home delivery service, you may elect to take part in our vacation donation program (see description below). Please indicate your suspension and restart dates below:
ACCOUNT NUMBER: 060095544
SUSPEND/RESUME
Suspend: Resume:
Vacation Donation Program
During your next vacation, sit back, relax — and at the same time enrich your community. Through The New Herald Newspaper in Education program, you can donate your subscription to students for the time period in which you will be out of town. For each copy you donate, at least two students will receive their own copy of The New Herald. To donate your vacation copies, please indicate below.
Choose One: Donate the vacation period papers to local schools through the Newspapers in Education program. Credit my account for the period of my vacation. SUSPEND/RESUME 2
Suspend:
Resume:
Choose One: Donate the vacation period papers to local schools through the Newspapers in Education program. Credit my account for the period of my vacation. SUSPEND/RESUME 3
Suspend:
Resume:
Choose One: Donate the vacation period papers to local schools through the Newspapers in ,. Education program. Credit my account for the period of my vacation.
To best provide you with responsive, accessible customer service, we encourage your comments and suggestions. Please let us know about any dissatisfaction you may have with your delivery or billing service. Customers who have not received a paper can order another paper or receive credit for today by clicking here.
For all other subscription concerns, please use the form below to send us an email indicating the nature of your complaint and explaining how we may help you. A customer care representative will respond to your request within 24 hours to the email address provided on this form.
s: Document 's' a also an am and any as at be but by can could do for
go got have he her here his how i if in into it its m my of on or our say she that the their there therefore they there their this these those through to until we what when where which while who with would you your about across are around did during each ever every had must no now only other so than too was within everything is like want please s cannot then d
11 me paper going having ve been being some speak know f: Document 'f
[FORM1]
Type="FormType".Nalue=;"AcceptForm"
Type=" AcceptResponse" :Name="AcctNo":APrompt="P lease tell us your account number. ":Value="":RPrompt- ' Your account number is "
Type- ' AcceptResponse" :Name="date":APrompt=" When would you like to start suspending the paper?":Value="":RPrompt="The delivery will stop on "
Type="MChoice":Name="Duration":APrompt=" Would you like to suspend the paper for one month, two months, or three months? ":Choice=" one month,two months,three months" :Value="":RPrompt="The delivery will be suspended for "
Type- 'FormAction" : Value- ' ./susp_deli"
[FORM2]
Type="FormType":Value="AcceptForm"
Type- cceptResponse" :Name="Name'':APrompt- 'Please tell us your name.": Value- ' ":RPrompt=" Your name is "
Type- cceptResponse" :Name=" Address" :APrompt=" What city do you live in?":Value="":RPrompt="You live in "
Type="MChoice":Name="SubType":APrompt- 'Would you like the newspaper daily or just the
Sunday paper?" :Value="":Choice- 'a daily newspaper,the Sunday newspaper" :RPrompt=" You have opted for "
Type- 'MChoice" :Name="SubPrd":APrompt- ' Would you like a half-yearly or annual subscription?":Value="":Choice="a half-yearly subscription,an annual subscription" :RPrompt- ' You have chosen "
Type="FormAction" : Value=" ./add_acct"
[FORM3]
Type="FormType":Value=:"AcceptForm"
Type- cceptResponse" :Name="AcctNo":APrompt- 'What is your account number?":Value="":RPrompt="Your account number is "
Type="FormAction" : Value=" ./acct jlnfo"
[FORM4]
Type="FormType":Value-"AcceptForm"
Type="AcceptResponse":Name=:"AcctNo":APrompt="What is your account number? ":Value="":RPrompt=" Your account number is " Type- 'FormAction" : Value- '. /get jpymt"
[FORM5]
Type="FormType":Value="AcceptForm"
Type=" AcceptResponse" :Name="Name":APrompt=" Whom would you like to gift the subscription to?":Value="":RPrompt="You are gifting this subscription to "
Type- ' AcceptResponse" :Name- ' Address" :APrompt="In which city does the person live?":Value="":RPrompt="The person lives in "
Type="MChoice":Name="SubType":APrompt="Would you like to give a daily newspaper or just the Sunday paper?":Value="":Choice="a daily newspaper,the Sunday newspaper" :RPrompt- 'You have opted for " Type="MChoice":Name="SubPrd":APromρt=" Would you like a half-yearly or annual subscription?":Value="":Choice="a half-yearly subscription,an annual subscription" :RPrompt=" You have chosen " Type="FormAction":Value="./add_acct"
[FORM6]
Type=:"FormType":Value="AcceptForm"
Type- ' AcceptResponse" :Name- 'AcctNo":APrompt- ' What is your account number?":Value="":RPrompt- 'Your account number is "
Type="MChoice":Name- 'preference" :APrompt=:" Would you like the newspaper or would you prefer credit for it?":Value="":Choice— 'the newspaper, credit" ÷RPrompt- ' You prefer "
Type="FormAction": Value- ' ./prefer"
[FORM7]
Type="FormType":Value="AcceptForm"
Type=" AcceptResponse" :Name:="AcctNo":APrompt=" What is your account number?" :Value="":RPrompt="Your account number is "
Type- 'Hidden" :Name="preference" : Value- 'credit"
Type- 'ForrnAction":Value- './prefer"
[FORM8]
Type="FormType":Value="AcceptForm"
Type- 'AcceptResponse" :Name="AcctNo"; APrompt=" What is your account number?" :Value="":RPrompt=" Your account number is "
Type="FormAction":Value="./chg_acct"
x: Document 'x'
FORM1 :Would you like to temporarily suspend your delivery?
FORM2: Would you like to order a subscription?
FORM3 :Would you like information about your account balance or your payments?
FORM4:Would you like to pay your subscription fees?
FORM5 -.Would you like to give a gift subscription?
FORM6:Did you miss today's paper?
FORM6:Did you receive a wet paper?
FORM7:Did you miss yesterday's newspaper and would you like credit for yesterday?
FORM8: Would you like to change your address or change any other information? a: Datafile 'a' contains data about subscription l|l|2|01-01-2002|365|315|01-01-2002|50|||Frege|Jena
2|2|2|01-02-2002|52|32|01-02-2002|20|||Russell|Cambridge
3|2|2|01-02-2002|52|32|01-02-2002|20|||Wittgenstein|Vienna
4|l|2|01-04-2002|364|314|01-04-2002|50|||Austin|Oxford
5|l|2|01-05-2002|365|264|01-05-2002|100|||Grice|Berkeley
6|l|l|01-06-2002|180|49|01-06-2002|130|||Paril h|New York CONFIGURATION FILES tcfg: Thesaurus configuration file. This is generated by program
[PROMPTS]
Are you calling about subscriptions?
Would you like to order a subscription?
Would you like to pay your subscription fees?
Would you like to give a gift subscription?
Would you like to change your address or change any other information?
Do you have any billing enquiries or concerns?
Would you like information about your account balance or your payments?
Would you like to speak to a customer care representative?
Would you like to temporarily suspend your delivery?
Is there a problem with your paper or delivery?
Did you miss today's paper?
Did you miss yesterday's newspaper and would you like credit for yesterday?
Did you receive a wet paper?
Would you like information about the New Herald website?
Would you like to obtain your New Herald website password?
The website address is www.newherald.com. Would you like any other information about the website?
Are you calling about advertisements?
Would you like to advertise in the New Herald?
Is it a classified ad?
Is it a full-page, half-page, or quarter-page ad?
Would you like to place an ad?
Are you calling about something else?
Would you like to write to the New Herald?
Would you like to submit an article to the op-ed page?
Please email your article to oped@newherald.com.
Would you like to send a letter to the editor?
Please email your letter to letters@newherald.com.
Would you like to work for the New Herald?
Would you like to write for the New Herald?
Would you like to work for the editorial division or for the administrative division?
[MENUTREE]
0,1,0
1,2,99
1,3,99
1,4,99
1,5,99
1,6,0
6,7,99
6,8,99
1,9,99
0,10,0
10,11,99
10,12,99
10,13,99
0,14,0
14,15,99
14,16,99
0,17,0
17,18,0
18,19,99
18,20,99
17,21,0
21,19,99
21,20,99
0,22,0
22,23,0
23,24,25
24,25,100
23,26,27
26,27,100
22,28,0
28,29,99
28,30,99
[INDEX] account 7, ad 19,20,21, address 5,16, administr 30, advertis 17,18, annual 2,4, articl 24,25, balanc 7, bill 6, call 1,17,22, care 8, chang 5, classifi 19, com 16,25,27, concern 6, credit 12,11,13, custom 8, daili 2,4, deliveri 9,10, divis 30, ed 24, editor 26, editori 30, els 22, email 25,27, enquiri 6, fee 3, full 20, gift 4, give 4, half 20,2,4, inform 5,7,14,16, letter 26,27, miss 11,12, month 9, newspap 12,2,4,11,13, nytim 16,25,27, obtain 15, on 9, op 24,25, order 2, pai 3, password 15, payment 7, place 21, problem 10, quarter 20, receiv 13, repres 8, send 26, someth 22, submit 24, subscript 1,2,3,4, sundai 2,4, suspend 9, temporarili 9, three 9, todai 11, two 9, websit 14,15,16, wet 13, work 28,30, write 23,29, www 16, yearli 2,4, yesterdai 12,
[THESAURUS] access 58,41,48,19, acclaim 54,48,53,41, account 16,36,39,34, address 12,9,15,50,25, advanc 54,48,53,41, allow 11,17,9,32, amount 55,36,19, analys 19,41,32,52, analysi 32,17,49, anoth 58,41,48,19, appropri 12,3,9,32, ask 32,17,49, back 59,48,36,53, balanc 44,49,11,9, benefit 9,12,17,19, better 32,17,49, bill 12,3,44, bold 12,3,9,32, bottom 12,3,9,32, box 12,3,9,32, brows 11,17,9,32, care 49,17,8,32, chang 9,3,44,19, charg 8,44,49,11,9, commun 59,48,36,53, complet 12,3,9,32, concern 50,25,49,11,3, consid 11,17,9,32, credit 1,36,34,39,58, custom 11,49,32, deliveri 41,52, depend 19,41,32,52, descript 55,36,19, discern 19,41,32,52, disclos 32,17,49, discov 11,17,9,32, dissatisfact 58,41,48,19, elect 55,36,19, email 15,50,49,3,11,17, encourag 58,41,48,19, enrich 59,48,36,53, explain 15,50,25,49,11,3, featur 12,3,9,32, field 12,3,9,32, fill 12,3,9,32, find 9,12,17,19, fit 11,17,9,32, foreign 53,29,59,54, gift 53,41,52,19, glanc 8,44,49,11,9, globe 19,41,32,52, guidelin 32,17,49, handl 53,29,59,54, head 54,48,53,41, highest 32,17,49, identifi 32,17,49, improv 32,17,49, individu 32,17,49, inform 17,49,11, inquiri 8,44,49,11,9, insid 19,41,32,52, instant 9,12,17,19, interest 32,17,49, invoic 8,44,49,11,9, last 8,44,49,11,9, latest 54,48,53,41, least 59,48,36,53, leisur 48,59,54,34,58, let 58,41,48,19, literari 54,48,53,41, manag 11,17,9,32, miss 58,16,39,1,48, most 53,29,59,54, necessari 12,3,9,32, newspap 16,55,39,1, next 59,48,36,53, noteworthi 54,48,53,41, notifi 11,17,9,32, on 36,16,34,1,58, one 12,3,9,32, opinion 19,41,32,52, order 19,52,29, outsid 19,41,32,52, own 59,48,36,53, part 55,36,19, parti 32,17,49, payment 8,9,12,49,11, perform 32,17,49, person 32,17,49, pleas 9,12,17,19, polici 32,17,49, post 32,17,49, privaci 32,17,49, process 12,3,9,32, product 32,17,49, qualiti 32,17,49, receiv 34,59, recent 8,44,49,11,9, relax 59,48,36,53, repres 11,17,8,15,50,32, respond 15,50,25,49,11,3, revel 19,41,32,52, round 11,17,9,32, see 55,36,19, seller 54,48,53,41, send 15,25,49,11,3, sharp 19,41,32,52, short 32,17,49, side 19,41,32,52, simpl 8,44,49,11,9, sit 59,48,36,53, stai 19,41,32,52, state 19,41,32,52, statist 32,17,49, statu 1,16,8,36, stop 11,17,9,32, stori 19,41,32,52, submit 19,41,49,11,17, subscript 29,11, suggest 58,41,48,19, sundai 48,53,41,59, suspend 36,39,16,19, suspens 55,36,19, third 32,17,49, throughout 19,41,32,52, todai 34,16,48,41, town 59,48,36,53, two 48,36,53, unit 19,41,32,52, visit 11,17,9,32, vital 32,17,49, welcom 11,17,9,32, l.cfg: Thesaurus leam file, newly learned meanings are stored in this file
[EXT-THESAURUS]
[SCORING]
2,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,0,0,0,0,0,0,0,0,0,0,
0,8,0,0,0,0,0,0,0,0,0,0,0,0,0,
13,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0
,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,
SHELL SCRIPTS FOR DATA MANIPULATION acctJLnfo: Script to extract account information from 'a' into a Response form
#!/bin/sh acctno= cut -d'=' -f 2 | sed sΛ"//g
#echo $acctno cnt="grep -c "A$acctno|" a if [ $cnt -eq 0 ] then echo 'Type- 'FormType" : Value="ResponseForm'" echo 'Type- 'Say" :RPrompt- 'Sorry, the account number you provided does not exist" :Value='"" exit 0 fi line= grep "A$acctno|" echo 'Type— 'FormType" Nalue="ResponseForm'" name=Λecho $line | cut -d'f -f i echo 'Type- 'Say" :RPrompt- 'Your last name is "Name- "$name"" city=Λecho $line | cut -d'f -f IT echo 'Type="Say":RPrompt-"You live in ":Nalue-'"$city"" sub_type=Λecho $line | cut -d'f -f 2λ if [ $sub_type -eq 1 ] then sub_type="a daily newspaper" else sub_type="the Sunday newspaper" fi echo 'Type="Say":RPromρt=" You have subscribed for ":Nalue- "$sub_type"" sub_prd=Λecho $line | cut -d'f -f 3" sdate= echo $line | cut -d'f -f 4' if [ $sub_prd -eq 1 ] then sub_prd="six months" else sub_prd="one year" fl echo 'Type="Say":RPrompt="The subscription starts on '$sdate' for a period of ":Value='"$sub_prd"" fee= echo $line | cut -d'f -f 5Λ echo ype="Say":RPrompt="The subscription fee is $":Value='"$fee"" ba echo $line | cut -d'f -f 6 echo 'Type="Say":RPromρt="Your balance is $":Value='"$bal"" pdate= echo $line | cut -d'f -f T pym echo $line | cut -d'f -f 8Λ echo 'Type="Say":RPromρt="Your last payment was $'$pymt' on ":Value='"$ρdate"" sudate^echo $line | cut -d'f -f 9' if[ "X$sudate" != "X" ] then suprd-'echo $line | cut -d'f -f 10' case $suprd in
1) suprd- 'one month";;
2) suprd- 'two months";;
3) suprd-'three months";; esac echo ype="Say":RPrompt="Your account is suspended from '$sudate' for ":Value='"$suprd"" fi ,
add_acct: Script to add new account into 'a'
#!/bin/sh
# arrange all the values of input into a single line cp /dev/null /tmp/param cut -d'=' -f2 | sed "sΛ"//g s/ ΛWWW /g" I while read aa do echo -n $aa' ' » /tmp/param done echo "" »/tmp/param
# now transfer them into env variables. read NAME CITY SUB_TYPE SUB_PRD < /tmp/param if [ "$SUB_TYPE" = "a daily newspaper" ] then
SUB_TYPE=1
FEE=182 else
SUB_TYPE=2
FEE=26 fi if [ "$SUB_PRD" = "a half-yearly subscription" ] then
SUB _PRD=1 else
SUB_PRD=2
FEE^ expr SFEE V^ fi cnt-1 while true do if [ ,pgrep -c \"A$cnt|\" a " -ne 0 ] then cnt=,expr $cnt + 1 ' continue fi echo $cnt'f$SUB_TYPET$SUB_PRD'|ndate +%d-%m- %Y '|$FEE|$FEE||0|||$NAME|$CITY" » a echo 'Type- 'FormType" : Value— 'AcceptForm'" echo 'Type- 'Say":RPrompt— 'Your subscription request has been entered" .Nalue— "" echo 'Type="Say":Νame=="acct_no":RPrompt="Your account number is "Nalue- "$cnt"" echo 'Type="Say":RPrompt="Your fee for the subscription is $":Nalue='"$FEE"" echo 'Type- ' AcceptResponse" :Νame- 'payment" :APrompt- ' Your minimum initial payment is $25. How much would you like to pay now?":Nalue="":RPrompt="You have chosen to pay $'" echo Type=:"FormAction":Nalue="./updt_pymt'" break done #rm /tmp/param
Figure imgf000117_0001
acctno=Λcut -d— ' -f 2 | sed s/\"//g"
#echo $acctno cnt^'grep -c "Λ$acctno|" a' if [ $cnt -eq 0 ] then echo 'Type="FormType" : Value- 'ResponseForm"' echo 'Type="Say":RPrompt="Soιτy, the account number you provided does not exist":Value='"" exit O fi line=,grep "Λ$acctno|" a' echo 'Type="FormType" : Value- ' AcceptForm'" echo ype="Hidden" :Νame="acctno" : Value='$acctno"" # Response info name=,echo $line | cut -d'f -f i echo 'Tyρe="Say":RPromρt="Your last name is ":Value="'$name"" city='echo $line | cut -d'f -f 12 echo 'Type-"Say":RPrompt="You live in ":Vaιue='"$city"" sub_type=,echo $line | cut -d'f -f 2" if [ $sub_type -eq 1 ] then sub_type="a daily newspaper" else sub_type="the Sunday newspaper" fi echo 'Type- 'Say":RPrompt- 'You have subscribed for "Nalue- "$sub_type"" sub_prd=,echo $line | cut -d'f -f 3' sdate= echo $line | cut -d'f -f 4" if [ $sub_prd -eq 1 ] then sub_prd- 'six months" else sub_prd-"one year" fi echo 'Type- 'Say" ÷RPrompt- ^The subscription starts on '$sdate' for a period of ":Value='"$sub_prd"" fee='echo $line | cut -d'f -f 5' echo ype="Say":RPrompt="The subscription fee is $":Value='"$fee"" bal= echo $line | cut -d'f -f 6Λ echo 'Type="Say":RPromρt="Your balance is $":Value='"$bal"" pdate=,echo $line | cut -d'f -f T pymt=,echo $line | cut -d'f -f 8" echo 'Type="Say":RPrompt-"Your last payment was $'$pymt' on ":Value='"$pdate"" sudate^echo $line | cut -d'f -f 9" if [ "X$sudate" != "X" ] then suprd= echo $line | cut -d'f -f W case $suprd in
1) suprd— 'one month";;
2) suprd- 'two months";;
3) suprd— 'three months";; esac echo 'Type="Say":RPrompt- 'Your account is suspended from '$sudate' for ":Value=*"$suprd"" fi # echo 'Type- ' AcceptResponse" :Νame="Νame":APrompt- ' What name would you like to use?":Value="":RPrompt="The name you would like to use is '" echo 'Type- ' AcceptResponse" :Name- ' Address" :APromρt="What city would you like the newspaper sent to?":Value="":RPrompt- 'The city you would like the newspaper sent to is '" echo 'Type- 'MChoice" :Name="SubType":APrompt- ' Would you like the newspaper daily or just the Sunday paper?":Value="":Choice="a daily newspaper,fhe Sunday newspaper" :RPrompt=" You have opted for '" echo 'Type="MChoice":N-rme="SubPrd":APrompt- 'Would you like a half-yearly or amiual subscription?":Value="":Choice="a half-yearly subscription,an annual subscription" :RPrompt- ' You have chosen '" echo lType="FormAction" : Value- './updt_acct'"
_ g_et__p_ym_t: Script to generate a form to accept payment for a particular account
acctno= cut -d'=' -f 2 | sed sΛ'V/g'
#echo $acctno cnt=,grep -c "Λ$acctnof a" if [ $cnt -eq 0 ] then echo 'Type- 'FormType" : Value- 'ResponseForm"' echo 'Type="Say":RPrompt- 'Sorry, the account number you provided does not exist":Value=""' exit O fi line^ grep "Λ$acctno|" a fee-Λecho $line | cut -d'f -f 5" bal= echo $line j cut -d'j' -f 6Λ pdate="echo $line | cut -d'f -f 7' pymt='echo $line | cut -d'f -f 8' if [ $bal -le 0 ] then echo 'Type- 'FormType" -.Value- 'ResponseForm'" else echo 'Type- 'FormType" :Nalue=" AcceptForm'" fi echo 'Type="Say":RPrompt="The subscription fee is $":Value='"$fee""
Figure imgf000119_0001
echo 'Type- 'Hidden" :Νame- 'acctno" :Value='"$acctno"" echo 'Type- cceptResponse" :N-rme="payment'':APrompt- 'How much would you like to pay now?":Nalue="":RPrompt- 'You have paid $"' echo 'Type- 'FormAction" Nalue- ' ./updt_pymt'" fi updtjpymt: Script to update the data file 'a' using form information
#! bin/sh cp /dev/null /tmp/paraml cut -d'=' -f 2 | sed "sΛ"//g s/ ΛWWW /g" I while read aa do echo -n $aa' ' » /tmp/paraml done echo "" »/tmp/paraml read acctno payment < /tmp/paraml touch /tmp/tmpa echo "no" > /tmp/found cat a I while read line do cacno="echo $line | cut -d'f -f 1" if [ $cacno -eq $acctno ] then echo "yes" > /tmp/found echo -n $cacno'f » /tmp/tmpa echo -n 'echo $line | cut -d'f -f 2"' » /tmp/tmpa echo -n "echo $line | cut -d'f -f 3"' » /tmp/tmpa echo -n "echo $line j cut -d'f -f 4"'f » /tmp/tmpa echo -n "echo $line j cut -d'f -f 5"'f » /tmp/tmpa bal="echo $line | cut τd'f -f 6' bal^expr $bal - $payment, echo -n $bal'f » /tmp/tmpa echo -n "date +%d-%m-%Y"'f » /tmp/tmpa echo -n $payment'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 9"' » /tmp/tmpa echo -n "echo $line | cut -d'f -f 10" 'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f H"'f » /tmp/tmpa echo "echo $line | cut -d'f -f 12" » /tmp/tmpa else echo $line » /tmp/tmpa fi done mv /tmp/tmpa a read ans < /tmp/found if [ "$ans" = "yes" ] then echo 'Type="FormType" : Value- 'ResponseForm"' echo 'Type- 'Say" :RPrompt="Thank you for the subscription" -.Value- "" else echo 'Type- 'FormType" -Nalue- 'ResponseForm"' echo 'Type- 'Say" :RPrompt="Sorry, the account number you provided does not exist" :Nalue='"" fi rm /tmp/paraml /tmp/found
susp deli: Script to suspend delivery for a particular account
#!/bin sh cp /dev/null /tmp/paraml cut -d'-' -f2 | sed "s/\"//g s/ Λ\\\\\\ /g" I while read aa do echo -n $aa' ' » /tmp/paraml done echo "" »/tmp/paraml read acctno sdate period < /tmp/paraml if [ "$period" = "one month" ] then period=l fi if [ "Speriod" = "two month" ] then period=2 fi if [ "$period" = "three months" ] then
Figure imgf000121_0001
echo "no" > /tmp/found touch /tmp/tmpa cat a I while read line do cacno="echo $line | cut -d'f -f 1" if [ $cacno -eq $acctno ] then echo "yes" > /tmp/found echo -n $cacno'f » /tmp/tmpa echo -n "echo $line cut -d'f -f 2"' f » /tmp/tmpa echo -n "echo $line cut -d'f -f 3"' f » /tmp/tmpa echo -n "echo $line cut d'f -f 4"' f » /tmp/tmpa echo -n "echo $line cut d'f -f 5" f » /tmp/tmpa echo -n "echo $line cut d'f -f6"' f » /tmp/tmpa echo -n "echo Sline cut df -f 7" f » /tmp/tmpa echo -n "echo $line cut d'f -f 8" f » /tmp/tmpa echo -n $sdate'f » /tmp/tmpa echo -n $ρeriod'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 11"'|' » /tmp/tmpa echo "echo $line | cut -d'f -f 12" » /tmp/tmpa else echo $line » /tmp/tmpa fi done mv /tmp/tmpa a read ans < /tmp/found if [ "$ans" = "yes" ] then echo 'Type="FormType":Value- 'ResponseForm'" echo 'Type- 'Say":RPrompt- 'Thank you. The information has been updated" : Value- "" else echo 'Type="FormType":Value="ResponseForm'" echo 'Type- 'Say":RPrompt- 'Sorry, the account number you provided does not exist" Nalue='"" fi rm /tmp/paraml /tmp/found
_ u_p_d_t__acct: Script to update data file 'a' with changed information
# arrange all the values of input into a single line cp /dev/null /tmp/param cut -d'=' -f2 | sed "sΛ"//g s/ ΛWWW /g" I while read aa do echo -n $aa' ' » /tmp/param done echo "" »/tmp/param cp /dev/null /tmp/tmpa read acctno name city sub_type sub_prd < /tmp/param cat a I while read line do cacno="echo $line | cut -d'f -f 1" if [ $cacno -eq $acctno ] then echo -n $cacno'f » /tmp/tmpa if [ "$sub_type" = "a daily newspaper" ] then sub_type=l newfee=182 else sub_type=2 newfee=26 fi echo -n $sub_type'f » /tmp/tmpa if [ "$sub_prd" = "a half-yearly subscription" ] then sub_prd=l else sub_ρrd=2 newfee="expr $newfee \* 2" fi echo -n $subjprd'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 4"'f » /tmp/tmpa echo -n $newfee'f » /tmp/tmpa oldfee=="echo $line | cut -d'f -f 5" oldbal="echo $line j cut -df -f 6" newbal="expr $newfee - $oldfee + $oldbal" echo $newfee' '$newbal > /tmp/newbal if [ $newbal -gt O ] then echo -n $newbal'f » /tmp/tmpa else echo -n 'Of » /tmp/tmpa fi
#echo -n "date +%d-%m-%Y"'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 7"'f » /tmp/tmpa echo -n "echo $line j cut -df -f 8"f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 9"'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 10" 'f » /tmp/tmpa echo -n $name'f » /tmp/tmpa echo $city » /tmp/tmpa else echo $line » /tmp/tmpa fi done mv /tmp/tmpa a echo 'Type- 'FormType" : Value- 'ResponseForm"' read newfee newbal < /tmp/newbal echo 'Type- 'Say" :RPrompt- 'Your fee for the subscription is $": Value- "$newfee"" if [ $newbal -lt O ] then newbal="expr $newbal \* -1" echo 'Type- 'Say":RPrompt- cheque of $'$newbal' will be sent to you to compensate for excess balance'" else echo 'Type="Say":RPromρt-" Your balance is $":Value='"$newbal"" fi echo 'Type="Say":RPrompt="Thank you":Value='"" rm /tmp/param /tmp/newbal prefer: Script to generate form for damaged / missing newspaper complaint
#!/bin/sh cp /dev/null /tmp/paraml cut -d*-' -f2 | sed "sΛ"//g s/ Λ\\\\\\ /g" I while read aa do echo -n $aa' ' » /tmp/paraml done echo "" »/tmp/paraml read acctno preference < /tmp/paraml cnt="grep -c "Λ$acctno|" a" if [ $cnt -eq 0 ] then echo 'Type— 'FormType" Nalue- 'ResponseForm'" echo 'Type="Say":RPrompt="Sorry, the account number you provided does not exist" Nalue-"'" exit 0 fi if [ "$preference" = "the newspaper" ] then echo 'Type— 'FonnType" Nalue- 'ResponseForm'" echo 'Type- 'Say" :RPrompt- 'You will be sent today'V's newspaper" Nalue-'"" echo 'Type="Say":RPrompt-"Thank you" Nalue-'"" exit O fi touch /tmp/tmpa cat a I while read line do cacno="echo $line | cut -d'f -f 1" if [ $cacno -eq $acctno ] then echo "yes" > /tmp/found echo -n $cacno'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 2"'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 3"'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 4"'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 5"'f » /tmp/tmpa bal="echo $line | cut -d'f -f 6" bal="expr $bal - 1" echo -n "$bal|" » /tmp/tmpa echo -n "echo $line | cut -d'f -f 7"'f » /tmp/tmpa echo -n "echo $line | cut -d'f -f 8"'f » /tmp/tmpa echo -n $sdate'f » /tmp/tmpa echo $period » /tmp/tmpa else echo $line » /tmp/tmpa fi done mv /tmp/tmpa a echo 'Type="FormType" :Nalue="ResponseForm"' echo 'Type- 'Say" :RPrompt- 'Your account has been credited" Value- "" echo 'Type="Say":RPrompt="Thank you" Nalue-'"" rm /tmp/paraml /tmp/found

Claims

WE CLAIM:
1. A method performed in a system having multiple navigable nodes interconnected in a hierarchical arrangement comprising: at a first node, receiving an input from a user of the system, the input containing at least one word identifiable with at least one keyword from among multiple keywords, identifying at least one node, other than the first node, that is not directly connected to the first node but is associated with the at least one keyword, and jumping to the at least one node.
2. The method of claim 1 further comprising: providing a verbal description associated with the at least one node to the user.
3. The method of claim 1 further comprising: searching a thesaurus correlating keywords with synonyms.
4. The method of claim 3 wherein the searching further comprises: identifying the at least one word as synonymous with the at least one keyword.
5. The method of claim 1 further comprising: detennining that the at least one word is neither a keyword nor a synonym of any keyword; and learning a meaning for the word so that the word will be treated as a learned synonym for at least one particular keyword of the multiple keywords.
6. The method of claim 5 further comprising: adding the word to a thesaurus so that, when the word is input by a subsequent user, the word will be treated as synonymous with the at least one particular keyword.
7. A method performed in connection with an arrangement of nodes representable as a hierarchical graph containing vertices and edges connecting at least two of the vertices, the method comprising: receiving an input from a user as a response to a verbal description associated with a first vertex; analyzing the input to identify a meaningful term that can be associated with at least one keyword; selecting a vertex in the graph structure that is not connected by an edge to the first vertex, based upon an association between the meaningful term and the at least one keyword and a correlation between the at least one keyword and the vertex; and jumping to the vertex.
8. A method performed in connection with an arrangement of nodes representable as a hierarchical graph comprising: correlating keywords with nodes in which the keywords appear to create an inverted index so that the keywords each appear only once and all nodes containing each of the keywords are indexed to those keywords; maintaining a thesaurus of synonyms for at least some of the keywords; receiving an input from a user contaimng a meaningful word; searching the inverted index to determine whether the meaningful word is a keyword and, if the meaningful word is a keyword, jumping to a node identified in the inverted index as correlated to that keyword, otherwise, searching the thesaurus to determine if the meaningful word is a synonym for at least one particular keyword and, if the meaningful word is the synonym, using the synonym to identify the at least one particular keyword, and jumping to at least one node correlated to the at least one particular keyword.
9. The method of claim 8 further comprising: creating the thesaurus by analyzing at least two files and determining synonymy among application meaningful words contained therein based upon a frequency of co-occurrence among the application meaningful words.
10. A system comprising : a hierarchically arranged series of nodes; an inverted index correlating keywords with the nodes; a thesaurus correlating at least some keywords with synonyms for those keywords; a processor executable learning procedure configured to, upon receipt of a term that is identified as neither a synonym nor a keyword based upon a search of both the inverted index and the thesaurus,
(a) identify the term as at last one particular synonym for at least one particular keyword and
(b) correlate the term with the at least one particular keyword, so that when a subsequent user provides the term the system will operate as if the term was synonymous with the at least one particular keyword.
11. The system of claim 10 further comprising: a set of verbal descriptions for at least some of the nodes.
12. The system of claim 10 wherein at least one of the nodes is a service node.
13. The system of claim 10 further comprising an interactive voice response system and wherein the hierarchically arranged series of nodes is part of the interactive voice response system. .
14. The system of claim 10 wherein the hierarchically arranged series of nodes is part of a file system browser application.
15. The system of claim 10 wherein the hierarchically arranged series of nodes is part of a navigation system for television listings.
16. The system of claim 10 wherein the hierarchically arranged series of nodes is part of one of a document navigation or a document retrieval system.
17. The system of claim 10 wherein the hierarchically arranged series of nodes is part of a geographic information system.
18. A transaction processing system, having a hierarchical arrangement of nodes and configured to interact with a user so that the user can navigate among the nodes in the hierarchy, the system comprising: an inverted index correlating keywords with at least some of the nodes in the hierarchical arrangement so that when the user interacts with the system and provides an input in response to a verbal description from one node in the hierarchy and the response includes a meaningful word correlatable with a keyword, the system will identify at least one node that is correlated to the meaningful word by the inverted index and jump to that at least one node without first traversing any other node.
19. The system of claim 18 further comprising: a thesaurus correlating at least some of the keywords with synonyms for the at least some keywords.
20. The system of claim 18 further comprising: at least one stored learned word correlated to a keyword.
21. A method performed by a program executed by a processor to navigate among a hierarchically arranged group of nodes, each of the nodes having an associated verbal description, the method comprising: eliminating stop words and duplicates from the verbal descriptions to create a list of keywords; creating a list of thesaurus words; creating a first matrix comprising a correlation of at least some thesaurus words with at least some keywords; creating a second matrix by calculating cosine values from a co-occurrence analysis of the entries in the first matrix; determining a synonymy among the at least some thesaurus words and the at least some keywords; and creating a thesaurus configured as an inverted index based upon the synonomy.
22. The method of claim 21 further comprising: tracking frequency of use of the nodes.
23. The method of claim 22 further comprising: ranking the nodes based upon a result of the tracking.
24. The method of claim 21 further comprising: pruning a node from the group of nodes based upon a frequency of usage criterion.
25. The method of claim 21 further comprising: adding a synonym entry into the thesauras based upon a result of an unknow word analysis.
26. The method of claim 21 wherein the thesaurus further comprises at least some learned entries, the method further comprising: deleting a learned entry based upon satisfaction of a frequency of use criterion.
PCT/US2003/034134 2002-11-19 2003-10-27 Navigation in hierarchical structured transaction processing system WO2004046967A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
AU2003286718A AU2003286718A1 (en) 2002-11-19 2003-10-27 Navigation in hierarchical structured transaction processing system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US10/299,359 US7231379B2 (en) 2002-11-19 2002-11-19 Navigation in a hierarchical structured transaction processing system
US10/299,359 2002-11-19

Publications (1)

Publication Number Publication Date
WO2004046967A1 true WO2004046967A1 (en) 2004-06-03

Family

ID=32297678

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/US2003/034134 WO2004046967A1 (en) 2002-11-19 2003-10-27 Navigation in hierarchical structured transaction processing system

Country Status (3)

Country Link
US (4) US7231379B2 (en)
AU (1) AU2003286718A1 (en)
WO (1) WO2004046967A1 (en)

Families Citing this family (126)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8645137B2 (en) 2000-03-16 2014-02-04 Apple Inc. Fast, language-independent method for user authentication by voice
US7783475B2 (en) * 2003-01-31 2010-08-24 Comverse, Inc. Menu-based, speech actuated system with speak-ahead capability
TWI290687B (en) * 2003-09-19 2007-12-01 Hon Hai Prec Ind Co Ltd System and method for search information based on classifications of synonymous words
US7716211B2 (en) * 2004-02-10 2010-05-11 Microsoft Corporation System and method for facilitating full text searching utilizing inverted keyword indices
US7743064B2 (en) * 2004-04-29 2010-06-22 Harris Corporation Media asset management system for managing video segments from fixed-area security cameras and associated methods
EP1591756B1 (en) * 2004-04-30 2008-03-19 Harman/Becker Automotive Systems GmbH Car multimedia system and method for activating a function of such a system
GB0411377D0 (en) * 2004-05-21 2004-06-23 Univ Belfast Dialogue manager
US7606793B2 (en) 2004-09-27 2009-10-20 Microsoft Corporation System and method for scoping searches using index keys
US7827181B2 (en) 2004-09-30 2010-11-02 Microsoft Corporation Click distance determination
US7761448B2 (en) 2004-09-30 2010-07-20 Microsoft Corporation System and method for ranking search results using click distance
US7739277B2 (en) 2004-09-30 2010-06-15 Microsoft Corporation System and method for incorporating anchor text into ranking search results
US7716198B2 (en) * 2004-12-21 2010-05-11 Microsoft Corporation Ranking search results using feature extraction
US7792811B2 (en) * 2005-02-16 2010-09-07 Transaxtions Llc Intelligent search with guiding info
US20060200460A1 (en) * 2005-03-03 2006-09-07 Microsoft Corporation System and method for ranking search results using file types
US7792833B2 (en) 2005-03-03 2010-09-07 Microsoft Corporation Ranking search results using language types
US8677377B2 (en) 2005-09-08 2014-03-18 Apple Inc. Method and apparatus for building an intelligent automated assistant
US20070121873A1 (en) * 2005-11-18 2007-05-31 Medlin Jennifer P Methods, systems, and products for managing communications
US7773731B2 (en) 2005-12-14 2010-08-10 At&T Intellectual Property I, L. P. Methods, systems, and products for dynamically-changing IVR architectures
US7577664B2 (en) 2005-12-16 2009-08-18 At&T Intellectual Property I, L.P. Methods, systems, and products for searching interactive menu prompting system architectures
SG186528A1 (en) * 2006-02-01 2013-01-30 Hr3D Pty Ltd Au Human-like response emulator
US7961856B2 (en) * 2006-03-17 2011-06-14 At&T Intellectual Property I, L. P. Methods, systems, and products for processing responses in prompting systems
US8050392B2 (en) * 2006-03-17 2011-11-01 At&T Intellectual Property I, L.P. Methods systems, and products for processing responses in prompting systems
JP4551961B2 (en) * 2006-03-31 2010-09-29 パイオニア株式会社 VOICE INPUT SUPPORT DEVICE, ITS METHOD, ITS PROGRAM, RECORDING MEDIUM RECORDING THE PROGRAM, AND NAVIGATION DEVICE
US9318108B2 (en) 2010-01-18 2016-04-19 Apple Inc. Intelligent automated assistant
JP5011947B2 (en) * 2006-10-19 2012-08-29 オムロン株式会社 FMEA sheet creation method and FMEA sheet automatic creation apparatus
US7890521B1 (en) 2007-02-07 2011-02-15 Google Inc. Document-based synonym generation
US8037086B1 (en) * 2007-07-10 2011-10-11 Google Inc. Identifying common co-occurring elements in lists
US8539378B2 (en) * 2007-07-26 2013-09-17 International Business Machines Corporation Method, computer program and data processing system for navigating in a flow diagram
US8280783B1 (en) * 2007-09-27 2012-10-02 Amazon Technologies, Inc. Method and system for providing multi-level text cloud navigation
US8171029B2 (en) * 2007-10-05 2012-05-01 Fujitsu Limited Automatic generation of ontologies using word affinities
US8332439B2 (en) * 2007-10-05 2012-12-11 Fujitsu Limited Automatically generating a hierarchy of terms
US20090106221A1 (en) * 2007-10-18 2009-04-23 Microsoft Corporation Ranking and Providing Search Results Based In Part On A Number Of Click-Through Features
US7840569B2 (en) 2007-10-18 2010-11-23 Microsoft Corporation Enterprise relevancy ranking using a neural network
US9348912B2 (en) 2007-10-18 2016-05-24 Microsoft Technology Licensing, Llc Document length as a static relevance feature for ranking search results
US7877389B2 (en) * 2007-12-14 2011-01-25 Yahoo, Inc. Segmentation of search topics in query logs
US8150850B2 (en) * 2008-01-07 2012-04-03 Akiban Technologies, Inc. Multiple dimensioned database architecture
US10733223B2 (en) * 2008-01-08 2020-08-04 International Business Machines Corporation Term-driven records file plan and thesaurus design
US8996376B2 (en) 2008-04-05 2015-03-31 Apple Inc. Intelligent text-to-speech conversion
US8812493B2 (en) 2008-04-11 2014-08-19 Microsoft Corporation Search results ranking using editing distance and document information
US10496753B2 (en) * 2010-01-18 2019-12-03 Apple Inc. Automatically adapting user interfaces for hands-free interaction
US20100042409A1 (en) * 2008-08-13 2010-02-18 Harold Hutchinson Automated voice system and method
US8145648B2 (en) * 2008-09-03 2012-03-27 Samsung Electronics Co., Ltd. Semantic metadata creation for videos
US10241644B2 (en) 2011-06-03 2019-03-26 Apple Inc. Actionable reminder entries
US10241752B2 (en) 2011-09-30 2019-03-26 Apple Inc. Interface for a virtual digital assistant
US9600833B1 (en) * 2009-06-08 2017-03-21 Google Inc. Duplicate keyword selection
US9286345B2 (en) * 2009-06-12 2016-03-15 International Business Machines Corporation Query tree navigation
US9431006B2 (en) 2009-07-02 2016-08-30 Apple Inc. Methods and apparatuses for automatic speech recognition
US8713078B2 (en) 2009-08-13 2014-04-29 Samsung Electronics Co., Ltd. Method for building taxonomy of topics and categorizing videos
US10679605B2 (en) 2010-01-18 2020-06-09 Apple Inc. Hands-free list-reading by intelligent automated assistant
US10553209B2 (en) 2010-01-18 2020-02-04 Apple Inc. Systems and methods for hands-free notification summaries
US10705794B2 (en) 2010-01-18 2020-07-07 Apple Inc. Automatically adapting user interfaces for hands-free interaction
US8386239B2 (en) 2010-01-25 2013-02-26 Holovisions LLC Multi-stage text morphing
US8682667B2 (en) 2010-02-25 2014-03-25 Apple Inc. User profiling for selecting user specific voice input processing information
US8161073B2 (en) 2010-05-05 2012-04-17 Holovisions, LLC Context-driven search
US8738635B2 (en) 2010-06-01 2014-05-27 Microsoft Corporation Detection of junk in search result ranking
US9576570B2 (en) * 2010-07-30 2017-02-21 Sri International Method and apparatus for adding new vocabulary to interactive translation and dialogue systems
KR101035305B1 (en) * 2011-02-28 2011-05-19 삼성탈레스 주식회사 The large aperture mirror system having the automatic focus adjusting athermalization mechanism that is less sensitive to the temperature change using standard laser
KR101109511B1 (en) * 2011-02-28 2012-01-31 삼성탈레스 주식회사 The large aperture mirror system having the automatic alignment mechanism that is less sensitive to the temperature change using standard laser
US9262612B2 (en) 2011-03-21 2016-02-16 Apple Inc. Device access using voice authentication
US8782614B2 (en) 2011-04-08 2014-07-15 Ca, Inc. Visualization of JVM and cross-JVM call stacks
US8935237B2 (en) 2011-09-09 2015-01-13 Facebook, Inc. Presenting search results in hierarchical form
US10289267B2 (en) 2011-09-09 2019-05-14 Facebook, Inc. Platform for third-party supplied calls-to-action
US8958532B2 (en) * 2011-11-29 2015-02-17 International Business Machines Corporation Navigating an interactive voice response system
US9495462B2 (en) 2012-01-27 2016-11-15 Microsoft Technology Licensing, Llc Re-ranking search results
US9280610B2 (en) 2012-05-14 2016-03-08 Apple Inc. Crowd sourcing information to fulfill user requests
US9201876B1 (en) * 2012-05-29 2015-12-01 Google Inc. Contextual weighting of words in a word grouping
US9721563B2 (en) 2012-06-08 2017-08-01 Apple Inc. Name recognition system
US9547647B2 (en) 2012-09-19 2017-01-17 Apple Inc. Voice-based media searching
US9318128B1 (en) * 2013-01-08 2016-04-19 Google Inc. Methods and systems for determining instructions for applications that are recognizable by a voice interface
GB2517122A (en) * 2013-04-30 2015-02-18 Giovanni Tummarello Method and system for navigating complex data sets
WO2014197334A2 (en) 2013-06-07 2014-12-11 Apple Inc. System and method for user-specified pronunciation of words for speech synthesis and recognition
US9582608B2 (en) 2013-06-07 2017-02-28 Apple Inc. Unified ranking with entropy-weighted information for phrase-based semantic auto-completion
WO2014197335A1 (en) 2013-06-08 2014-12-11 Apple Inc. Interpreting and acting upon commands that involve sharing information with remote devices
US10176167B2 (en) 2013-06-09 2019-01-08 Apple Inc. System and method for inferring user intent from speech inputs
CN110442699A (en) 2013-06-09 2019-11-12 苹果公司 Operate method, computer-readable medium, electronic equipment and the system of digital assistants
US20160343000A1 (en) * 2014-01-24 2016-11-24 Telefonaktiebolaget Lm Ericsson (Publ) Method and Service Center for Assisting a Customer to Navigate a Service
US9633004B2 (en) 2014-05-30 2017-04-25 Apple Inc. Better resolution when referencing to concepts
US9430463B2 (en) 2014-05-30 2016-08-30 Apple Inc. Exemplar-based natural language processing
US9338493B2 (en) 2014-06-30 2016-05-10 Apple Inc. Intelligent automated assistant for TV user interactions
US9668121B2 (en) 2014-09-30 2017-05-30 Apple Inc. Social reminders
US10567477B2 (en) 2015-03-08 2020-02-18 Apple Inc. Virtual assistant continuity
US10262061B2 (en) * 2015-05-19 2019-04-16 Oracle International Corporation Hierarchical data classification using frequency analysis
US9578173B2 (en) 2015-06-05 2017-02-21 Apple Inc. Virtual assistant aided communication with 3rd party service in a communication session
US11025565B2 (en) 2015-06-07 2021-06-01 Apple Inc. Personalized prediction of responses for instant messaging
CN104933032A (en) * 2015-06-29 2015-09-23 电子科技大学 Method for extracting keywords of blog based on complex network
US10747498B2 (en) 2015-09-08 2020-08-18 Apple Inc. Zero latency digital assistant
US10671428B2 (en) 2015-09-08 2020-06-02 Apple Inc. Distributed personal assistant
US10366158B2 (en) 2015-09-29 2019-07-30 Apple Inc. Efficient word encoding for recurrent neural network language models
US11010550B2 (en) 2015-09-29 2021-05-18 Apple Inc. Unified language modeling framework for word prediction, auto-completion and auto-correction
US11587559B2 (en) 2015-09-30 2023-02-21 Apple Inc. Intelligent device identification
US10691473B2 (en) 2015-11-06 2020-06-23 Apple Inc. Intelligent automated assistant in a messaging environment
US10049668B2 (en) 2015-12-02 2018-08-14 Apple Inc. Applying neural network language models to weighted finite state transducers for automatic speech recognition
US10223066B2 (en) 2015-12-23 2019-03-05 Apple Inc. Proactive assistance based on dialog communication between devices
US10446143B2 (en) 2016-03-14 2019-10-15 Apple Inc. Identification of voice inputs providing credentials
US9934775B2 (en) 2016-05-26 2018-04-03 Apple Inc. Unit-selection text-to-speech synthesis based on predicted concatenation parameters
US9972304B2 (en) 2016-06-03 2018-05-15 Apple Inc. Privacy preserving distributed evaluation framework for embedded personalized systems
US10249300B2 (en) 2016-06-06 2019-04-02 Apple Inc. Intelligent list reading
US10049663B2 (en) 2016-06-08 2018-08-14 Apple, Inc. Intelligent automated assistant for media exploration
DK179309B1 (en) 2016-06-09 2018-04-23 Apple Inc Intelligent automated assistant in a home environment
US10509862B2 (en) 2016-06-10 2019-12-17 Apple Inc. Dynamic phrase expansion of language input
US10192552B2 (en) 2016-06-10 2019-01-29 Apple Inc. Digital assistant providing whispered speech
US10586535B2 (en) 2016-06-10 2020-03-10 Apple Inc. Intelligent digital assistant in a multi-tasking environment
US10067938B2 (en) 2016-06-10 2018-09-04 Apple Inc. Multilingual word prediction
US10490187B2 (en) 2016-06-10 2019-11-26 Apple Inc. Digital assistant providing automated status report
DK179343B1 (en) 2016-06-11 2018-05-14 Apple Inc Intelligent task discovery
DK179415B1 (en) 2016-06-11 2018-06-14 Apple Inc Intelligent device arbitration and control
DK179049B1 (en) 2016-06-11 2017-09-18 Apple Inc Data driven natural language event detection and classification
DK201670540A1 (en) 2016-06-11 2018-01-08 Apple Inc Application integration with a digital assistant
JP6729232B2 (en) * 2016-09-20 2020-07-22 富士通株式会社 Message distribution program, message distribution device, and message distribution method
US10043516B2 (en) 2016-09-23 2018-08-07 Apple Inc. Intelligent automated assistant
US11281993B2 (en) 2016-12-05 2022-03-22 Apple Inc. Model and ensemble compression for metric learning
US10593346B2 (en) 2016-12-22 2020-03-17 Apple Inc. Rank-reduced token representation for automatic speech recognition
DK201770383A1 (en) 2017-05-09 2018-12-14 Apple Inc. User interface for correcting recognition errors
DK201770439A1 (en) 2017-05-11 2018-12-13 Apple Inc. Offline personal assistant
DK179745B1 (en) 2017-05-12 2019-05-01 Apple Inc. SYNCHRONIZATION AND TASK DELEGATION OF A DIGITAL ASSISTANT
DK179496B1 (en) 2017-05-12 2019-01-15 Apple Inc. USER-SPECIFIC Acoustic Models
DK201770429A1 (en) 2017-05-12 2018-12-14 Apple Inc. Low-latency intelligent automated assistant
DK201770432A1 (en) 2017-05-15 2018-12-21 Apple Inc. Hierarchical belief states for digital assistants
DK201770431A1 (en) 2017-05-15 2018-12-20 Apple Inc. Optimizing dialogue policy decisions for digital assistants using implicit feedback
DK179549B1 (en) 2017-05-16 2019-02-12 Apple Inc. Far-field extension for digital assistant services
JP7103763B2 (en) * 2017-07-20 2022-07-20 株式会社日立製作所 Information processing system and information processing method
US11468050B2 (en) * 2017-11-30 2022-10-11 International Business Machines Corporation Learning user synonyms from sequenced query sessions
US10922374B1 (en) * 2019-10-24 2021-02-16 Capital One Services, Llc Techniques to determine relationships of items in web-based content
US20210349887A1 (en) * 2020-05-07 2021-11-11 Boomi, Inc. System and method for automatically suggesting remote query parameters based for customized data integration process
US20220156299A1 (en) * 2020-11-13 2022-05-19 International Business Machines Corporation Discovering objects in an ontology database
US11526558B2 (en) * 2020-11-30 2022-12-13 Microsoft Technology Licensing, Llc System and method of providing accessibility to visualization tools

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6405188B1 (en) * 1998-07-31 2002-06-11 Genuity Inc. Information retrieval system
US6675159B1 (en) * 2000-07-27 2004-01-06 Science Applic Int Corp Concept-based search and retrieval system

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5812134A (en) * 1996-03-28 1998-09-22 Critical Thought, Inc. User interface navigational system & method for interactive representation of information contained within a database
US6038560A (en) * 1997-05-21 2000-03-14 Oracle Corporation Concept knowledge base search and retrieval system
US6807537B1 (en) * 1997-12-04 2004-10-19 Microsoft Corporation Mixtures of Bayesian networks
US6859212B2 (en) * 1998-12-08 2005-02-22 Yodlee.Com, Inc. Interactive transaction center interface
US6654731B1 (en) * 1999-03-01 2003-11-25 Oracle Corporation Automated integration of terminological information into a knowledge base
US6510406B1 (en) * 1999-03-23 2003-01-21 Mathsoft, Inc. Inverse inference engine for high performance web search
US6678677B2 (en) * 2000-12-19 2004-01-13 Xerox Corporation Apparatus and method for information retrieval using self-appending semantic lattice

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6405188B1 (en) * 1998-07-31 2002-06-11 Genuity Inc. Information retrieval system
US6675159B1 (en) * 2000-07-27 2004-01-06 Science Applic Int Corp Concept-based search and retrieval system

Also Published As

Publication number Publication date
US7231379B2 (en) 2007-06-12
AU2003286718A1 (en) 2004-06-15
US20040181392A1 (en) 2004-09-16
US7370056B2 (en) 2008-05-06
US7260567B2 (en) 2007-08-21
US20040098381A1 (en) 2004-05-20
US20040169679A1 (en) 2004-09-02
US7257574B2 (en) 2007-08-14
US20050060304A1 (en) 2005-03-17

Similar Documents

Publication Publication Date Title
WO2004046967A1 (en) Navigation in hierarchical structured transaction processing system
US10896184B2 (en) Method and system for capturing and exploiting user intent in a conversational interaction based information retrieval system
US8122061B1 (en) Systems and methods for information management using socially constructed graphs
US8583673B2 (en) Progressive filtering of search results
US8019752B2 (en) System and method for information retrieval from object collections with complex interrelationships
KR101793222B1 (en) Updating a search index used to facilitate application searches
US9165074B2 (en) Systems and methods for performing geo-search and retrieval of electronic point-of-interest records using a big index
US8229949B2 (en) Apparatus, method and program product for presenting next search keyword
US10585927B1 (en) Determining a set of steps responsive to a how-to query
US20090157664A1 (en) System for extracting itineraries from plain text documents and its application in online trip planning
US7693805B2 (en) Automatic identification of distance based event classification errors in a network by comparing to a second classification using event logs
US20150006528A1 (en) Hierarchical data structure of documents
KR20070007031A (en) Systems and methods for search query processing using trend analysis
CN102243645A (en) Hierarchical content classification into deep taxonomies
CN111104488B (en) Method, device and storage medium for integrating retrieval and similarity analysis
KR20090084853A (en) Mechanism for automatic matching of host to guest content via categorization
Alnogaithan et al. Tourism recommendation system based on user reviews
Limpens Multi-points of view semantic enrichment of folksonomies
Lee et al. Let's buy books: Finding ebooks using voice search
CN111291248A (en) Searching method and system based on intelligent agent knowledge base
Barbagallo et al. Semi-automated methods for the annotation and design of a semantic network designed for sentiment analysis of social web content
Adeyanju et al. Learning to author text with textual CBR
Georgieva-Trifonova et al. Graph-Based Representation of Customer Reviews for Online Stores
CN114328582A (en) Query method, device, equipment and storage medium
CN113987145A (en) Method, system, equipment and storage medium for accurately reasoning user attribute entity

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): AE AG AL AM AT AU AZ BA BB BG BR BY BZ CA CH CN CO CR CU CZ DE DK DM DZ EC EE ES FI GB GD GE GH GM HR HU ID IL IN IS JP KE KG KP KR KZ LC LK LR LS LT LU LV MA MD MG MK MN MW MX MZ NI NO NZ OM PG PH PL PT RO RU SC SD SE SG SK SL SY TJ TM TN TR TT TZ UA UG UZ VC VN YU ZA ZM ZW

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): GH GM KE LS MW MZ SD SL SZ TZ UG ZM ZW AM AZ BY KG KZ MD RU TJ TM AT BE BG CH CY CZ DE DK EE ES FI FR GB GR HU IE IT LU MC NL PT RO SE SI SK TR BF BJ CF CG CI CM GA GN GQ GW ML MR NE SN TD TG

121 Ep: the epo has been informed by wipo that ep was designated in this application
122 Ep: pct application non-entry in european phase
NENP Non-entry into the national phase

Ref country code: JP

WWW Wipo information: withdrawn in national office

Country of ref document: JP