Controlled natural language interfaces (extended abstract): the best of three worlds

This paper will discuss the problem of designing user-friendly interfaces for computer applications. In particular, we will describe an interface that is based on mapping formal into natural languages in a controlled and structured way.The basic approaches for designing interfaces range from formal or natural language to menu driven ones. Formal language interfaces such as query or programming languages are typically powerful in terms of their manipulative capabilities, safe in terms of their side effects, and optimized in terms of their execution. However, they often are not especially user-friendly with respect to the formal detail they require users to specify or feedback such as error messages or interactive help when mistakes are made. The necessary semantics for execution are embedded in compilers and not accessible to the user in an understandable way.Designers of natural language interfaces are generally concerned with anticipating how humans communicate within certain applications: what vocabulary and syntactic constructs need to be handled and what the range of variations or synonyms must be. Natural language query systems are a case in point. They are created to allow users to submit their data base requests in more or less natural language, absorbing the burden of mapping different variations of the natural language expressions into a formal or computer interpretable form, thereby also resolving ambiguities. Even though natural language processing has progressed in the last decade, available natural language interfaces still are disappointing with respect to both their natural language coverage on the one hand and their formal capabilities on the other. Moreover, the customizing process for specific applications is necessarily tedious and requires linguistic expertise.Menu driven systems guide users through prepared screens to their desired state of affairs. They replace the burden of typing and having to formulate problems by predefined menus with choices that have to be followed. While such an approach clearly defines the capabilities of the system and prevents common mistakes, the implementations of such systems tend to lack in flexibility of maneuvering back and forth between states, of skipping screens and undoing decisions without losing the process up to that point. The result is that users have to cope with too many screens that have to be visited to achieve their goals, particularly once they are familiar with the domain.Our work, represented by the INTERPRET system, is an attempt to combine the best of all three worlds by taking advantage of the power of the formal languages, the ease and friendliness of natural language and the convenience and error security of menu driven systems. To that end, we “interpret” a well established formal interface for the user in natural language. This means that rather than anticipating what or and how users might express their goal in natural language, we try to semantically describe an existing formal interface using natural language as the target. The formal interface is thereby enriched through natural language modes: for those users who want to take advantage of the formal interface we provide feedback in form of paraphrases of the formal commands and warnings and error messages of possible problems in their commands (PERFORM); for those users that rather use natural language, we provide a controlled mechanism in natural language to construct their commands in a flexible selection process (CONFORM), where the type of language presented here is almost identical to the language used in the feedback mechanism.For our prototype we chose SQL, a database query language for relational databases. In designing the feedback or interpretation mechanism (PERFORM), our goal was to preserve as much of the SQL structure as necessary to reflect the internal logic to the user, and at the same time represent as natural English paraphrases as possible. Consider the following SQL query: SELECT DEPT, AVG(COMM), MAX(COMM), MIN(COMM) FROM STAFF, ORG WHERE DEPT = DEPTNO AND SAL > 25000 GROUP BY DEPT which is translated by PERFORM into: Display - for each department - the average, largest, and smallest commission for employees with a salary of more than 25000 dollars.In order to produce such a paraphrase, PERFORM has a semantic model of the SQL language which is database or application independent. For example, it knows the relationship between the term “DEPT” in the “SELECT”-clause and its occurrence in the “GROUP”-clause. Based on that relationship, PERFORM inserts “for each” and suppresses the entire translation of “GROUP”-clause, since it is not modified any further. In addition to such application independent knowledge, it also has to model relationships between terms such as “DEPT” and “DEPTNO”. In order to recognize the “WHERE”-clause as a join phrase which is also suppressed in this case, and to realize the semantics of “SAL”, resulting in the insertion of “dollars” PERFORM has to gather database specific information. This is accomplished in an interactive knowledge acquisition or customizing process (CUSTOMIZER) which asks users on the average three questions about each term in their database, including a natural language phrase. With this information we build a lexicon that contains syntactic and semantic records for each item in a database.The same information is also used by CONFORM which allows users to construct their queries with selections from the screen in natural language where a skeleton of the entire query with windows for selections appears on the screen. Users can scroll within windows and go back and forth between those windows to create and edit their query without having to scroll through many different menus. After selecting a general topic which in database terms corresponds to one or more relations, the following query skeleton appears on the screen: Find the department id number last name manager salaryfor employees with the following restrictions:with a commission equal to first name ending in job description containing phone number greater than zip code smaller thanThe window on line 1 moves horizontally after each selection, the windows of line 3 are repeated after each completed selection below the restriction. The user makes selections at every point before submitting the query which will get translated into SQL by the CONFORM system. Since our natural language scope is rather restrictive, the syntax that INTERPRET recognizes is easily described to and learned by users.Our technical approach to all three aspects (paraphrase, error message, and controlled natural language input) is based on a syntactic analysis of the input which then gets semantically evaluated with an attribute grammar, resulting in the appropriate output. The semantic information required is mainly of referential and datatyping nature and has to be made available to different parts of the syntactic structure of the input string. The attribute grammar formalism has been very useful for these specific tasks and furthermore offers a consistent and transparent way to incrementally increase the semantic coverage. The PERFORM and CUSTOMIZER modules of INTERPRET are implemented for SQL, its CONFORM counterpart, i.e. the natural language front end is in the implementation stage.The techniques and philosophy of interpreting formal interfaces through natural language seem also promising for the programming environment in general. The challenge in the programming context is to gain a conceptual understanding of the contents of code that would permit, for example, the generation of more insightful error messages and automatic documentation on the PERFORM side and a controlled natural language environment for the programming task itself on the CONFORM side.