Modeling user's commands using ontologies - limsi

0 downloads 0 Views 205KB Size Report
"take blue”), but writing and maintaining rules is also un- practical for real and/or web .... we will note “element” an element of the ontology either a concept or a relation. .... The symbol used for predicates are directly extracted from the user's ...
Modeling user’s commands using ontologies Laurent Mazuel and Nicolas Sabouret Laboratoire d’informatique de Paris 6 - LIP6, France {laurent.mazuel, nicolas.sabouret}@lip6.fr

Abstract

Current surface analysis approaches often rely on firstorder or second-order logical models of the sentence [11, 5]. This keeps enough information for use by the semantic interpretation level, while still avoiding a strong syntactic analysis. However, the logical rules used within these systems must be defined a priori using an ad-hoc programming language with specific predicates and axioms [11, 10]. This often leads to hardly understandable (and thus hardly maintainable) logical models. On the contrary, the use of ontologies in dialogue systems allows writing generic systems, in sense of application domain independent [6, 8]. Our claim is that it is possible to take advantage of the ontology content and structure to build a logical model of the user’s command. This will allow us to avoid complex logical formalism. In this paper, we describe the surface syntactic analyser we use in our system. It builds a logical model of the user’s sentence, depending on the concepts and relations defined within the agent’s ontology. We assume Sadek’s semantic connectivity hypothesis [10]: each significant word (or term) of the command is defined within the agent’s ontology. Hence, each term in a command corresponds to a concept or a relation in the ontology. We then rely on the relations in the ontology to build the logical model of the user’s command. Predicates correspond to relations and individuals correspond to concepts. The following section describes briefly the general architecture of our NL command interpretation system. Section 3 presents both the algorithm that builds the logical model of the command and the semantic interpretation that uses it.

In this paper, we tackle Natural Language (NL) command interpretation for artificial agents. Our architecture relies on a logical modeling of the user’s command to enhance the semantic interpretation. This allows us to catch the relations between terms in the user sentence. We present our approach based on a surface syntactic analysis. We first define our surface analysis algorithm, based on the recognition of the ontology relation in a command to build its logical model. Lastly, we briefly show how our model can be used for semantic interpretation of the command.

1

Introduction

The NL modality is very important for the definition of conversational agents [2, 10]. In the framework of web agent, it is important to have real time answers to user commands, with a maximum of semantic in the interpretation made by the agent. Thus, systems need to use an algorithm to build the model of the user command with enough expressivity for a good semantic interpretation, but with light treatment for a good feedback and execution time. Moreover, in classical NL command interpretation systems, the use of a syntactic analyser based upon strong language grammatical rules encounters several efficiency problems [5, 4]. Not only do users often make use of keywords instead of well-formed sentences (e.g. “drop object ” or "take blue”), but writing and maintaining rules is also unpractical for real and/or web applications [9]. On the other hand, the use of a “bag of words” approach, even if it allows the system to build quickly a model, leads to ambiguous command models that cannot be interpreted at the semantic level. For instance, “go from London to Boston” and “go from Boston to London” have the same “bag of words” representation. To overcome this issue, most current approaches [3, 2] make use of surface syntactic analysis. This reduces implementation cost, increases the capacity of the system to adapt to new domains and avoids problems raised by the two extremes approaches listed above.

2

Architecture of our NL command system

Our architecture relies on the classical model of “independent module” architecture [1]. We present in this section an overview of our architecture (see figure 1) together with a brief description of each module.1 Logical analysis and semantic interpretation modules will be described in section 3. 1 This

1

architecture is presented more precisely in [4]

- I want to go to Boston today. - You can: - Go with the flight AF1345 at 8h47 - Go with the flight AA6543 at 10h34

In this example, the agent has two capabilities with the “Boston” and “today” constraints at the current time.

Figure 1. Global architecture

2.1

NLP Classical Tools

The morphological and lexical modules are based on OpenNLP2 . We use the default Maximum-Entropy tokenizer, Part Of Speech tagger and Maximum-Entropy chunker, trained on English data from the Wall Street Journal and the Brown corpus. We also exploit the WordNet lemmatizer provided by OpenNLP. It allows the system to detect compound words (e.g. “dark red”, “extra large”). The last part of our toolchain is an English generator. This generator takes an XML node (from our agent) and translates it into an English sentence. This does not produce grammatically correct answer, but it gives enough information to the user to ease context comprehension.

2.2

Competence list & Dialogue Manager

Our system relies on a bottom-up approach. Such approaches are very popular within dialogue systems [7, 2]. They rely on a competences list defined to find out the best possible interpretation of the command. A competences list contains a set of formal commands (or events) which represents each possible action at the current time. The semantic analysis part in the bottom-up approach consists into aligning terms of the user’s command with one or several formal commands. Our alignment algorithm is presented in section 3.3. As a result of this alignment, each event is provided with a score that represents its proximity (i.e. semantic similarity) to the user’s command. The computation of this score will not be presented here (interesting readers can find it in [4]): we will rather focus on the surface syntactic analysis which immediately precedes the semantic interpretation. After the semantic interpretation, the Dialogue Manager (DM) uses the alignment score to determinate a dialogue strategy. It uses two thresholds to separate perfectly understood commands from partially understood commands and not understood commands. For example, in case of ambiguous commands, the Dialogue Manager can propose the set of all possible commands in the current state: 2 http://opennlp.sourceforge.net/

3

Logical analysis

We describe in this section how to construct a logical model of the sentence using the ontology. We first present briefly our ontology formalism. We then describe the construction of the logical model. In the following section, we note St the set of string and we note P(E) the power set of E.

3.1

Ontology model

In our model, an ontology is a pair O = hC, Ri with a set C of concepts and a set R of binary relations. Each relation r ∈ R is attached a set of pairs Er ⊂ P(C 2 ). Hence, we note hc1 , r, c2 i ∈ R when two concepts c1 and c2 are connected by a relation r in the ontology. For ease of reading, we will note “element” an element of the ontology either a concept or a relation. Note that our ontology is not limited to the usual relations of hierarchy (isa) or meronymy (partof ), but also with the specific relations from the agent local domain, such as isLargerT han or lef tOf . Moreover, our ontology describes statically the domain of the application and does not reflect the description of the world at the current time. For example, the relation lef tOf is not between two objects of the world (this representation implies that the ontology must be dynamic) but between instance of the class verticalP osition (hcolumn1, lef tOf, column2i ∈ R, etc.).

3.2

Predicate construction

Our aim is to define a logical model which catches the functional structure of the sentence. In others words, we want to construct a set of predicates representing relations between concepts (from the ontology O) that appears in the command. For example, in “the big object next to the book”, the user makes use of a relation “next-to” between “big object” and “book”. To this purpose, we first consider the Sadek’s hypothesis [10] that claims that in an ontology build for dialogue system, each term in a correct command must be defined in the ontology. Hence, basically a command can be viewed

tagm, or the set of terms of the immediately following syntagm. A very interesting property of this heuristic is that it also takes into account superlative and comparative forms: 1. If a superlative form appears, it is a descriptive adjective of an object. The terms connected are thus in the same syntagm (e.g. “the biggest square”, “the darkest big object”, etc.). Figure 2. A tree representation of “drop on the lowest line, left of the largest red cube”

as an ordered set of ontology element.3 We consider that if a term does not have a matching element in the ontology then it is a stop-word with no information. Note that a preposition can only be understood (i.e. not a stop-word) if it was previously defined in the ontology. For example, “below” can be defined between concepts of the class horizontalP osition. If “below” is not defined in the ontology, there is no way to differentiate a command like “drop on the line X” and “drop below the line X”. To initiate the analysis, each element is considered regarding its type in the ontology. If the element is a relation, we consider that this term must be modelled as a predicate. Then, we have to find the predicate arguments among the other terms of the command. These arguments can, in turn, be predicates. This allows us to represent our logical model as a set of trees: nodes are predicates and leaves are concept-arguments. For example, in the sentence “drop on the lowest line, left of the largest cube”, “drop”, “line”, “red” and “cube” are leaves, “lowest” is a predicate node with parameter “line”. Using a tree representation, we obtain the result presented in figure 2. One difficulty in this algorithm is to determine which term is an argument of which relation. Ideally, we should have to rely upon the semantic analysis of the sentence and on the relations definitions in the ontology to identify instances corresponding to arguments, while the backtrack capability help us to verify all the permutation of possibles constructions. However, we currently use a heuristic function in our implementation so as to reduce computation time. This heuristic relies upon the study of an interaction corpus with our agent that outlined the following property: The arguments of a relation are either the set of terms that follow the relation in the current syn3 In practical, to be more robust, we consider morphological and synonymic approximation. For example “bigger” will match the concept “bigger-than”, etc.

2. If a comparative form appears, the object of the comparison is separated from the relation by the use of a conjunction (“than”, etc.). Thus, this object is in the next syntagm (e.g. “higher than the cube”, “left to the current position”, etc.). We do not claim that this heuristic covers all possible forms, but it was never caught out in our limited corpus4 . Formally speaking, let S be the ordered set {c1 , c2 , ..., cn } composed of n chunks such that ∀i ∈ [1, n], ci = {si,1 , si,2 , ..., si,ki }, where si,j are the words from the user sentence5 (the user sentence is thus Suser = ). {s1,1 , s1,2 ...., s1,k1 , s2,1 , ..., s2,k2 , ..., sn,1 , ..., sn,kn } Our semantic analysis method relies on the hypothesis of semantic connectivity [10]: every concept that appears within a relevant command must be defined in the ontology. Hence, ∀si,j , we have either si,j ∈ C or si,j ∈ R.6 The function τ : S 7−→ Sa constructs the set of trees Sa by using the chunks S. Elements of Sa are the predicates (or arguments) of the logical form (predicate for a node, argument for a leaf). The function τ is defined recursively by: τ (S) =  ! k1 n [ [    τ ({ {s s }) } ∪ τ ( ci })  1,1 1,i    i=2 i=2       n  [ {s1,1 (τ ({c2 }))} ∪ τ ( ci )   i=3       k1  [     {s } ∪ τ ({ s1,i , c2 , ..., cn })  1,1

if (k1 > 1) ∧ (s1,1 ∈ R) if (k1 = 1) ∧ (s1,1 ∈ R) otherwise

i=2

with τ (∅) = τ ({∅}) = ∅. In others words, the tree Sa is obtained by transforming each relation in the command in a node whose children are the remaining elements in the chunk (when k1 > 1) or elements from the next chunk 4 This corpus was build with 16 different non-native english speakers interacting with one block-world based agent [4]. 5 We assume that stop-words have been removed by the lexical analyser. 6 This hypothesis is too large in real applications. This will discuss this point in the last section.

(when k1 = 1). The concepts are systematically transformed into leafs. Let us consider the following example which bring to figure 2: “drop on the lowest line, left of the largest red cube”. This sentence is chunked as: [VP Drop:VB] [PP on:IN] [NP the:DT lowest:JJS line:NN] [?? ,:,] [NP left:NN] [PP of:IN] [NP the:DT largest:JJS red:JJ cube:NN] After removing stop-words, we obtain: S=

extracted from the user’s command to the ontology. This mechanism does not need any specific logical formalism to define syntactic analysis rules. We briefly illustrated how it can ease the semantic interpretation of the command. Since most current dialogue systems are based on ontologies, we think that our approach can be adapted to various systems implementation. The preliminary evaluation, currently in progress, shows very interesting results. Moreover, we want to validate our logical model on others agents and ontologies. We intend to demonstrate that our approach is generic enough to be applied to a wide class of agents and domains.

{{drop}, {lowest, line}, {lef tof }, {largest, red, cube}} The logical model obtained by our algorithm is then: τ (S) = {drop, lowest(line), lef tof (largest(red, cube))}

3.3

Semantic interpretation

The surface syntactic analysis described above allows us to: 1) build a set of trees (i.e. predicates/arguments) that model the command; 2) make a complete anchorage of these trees onto the ontology. These two properties constitute the foundation of our semantic analysis (that will not be presented in detail here). Indeed we anchor the agent’s code onto the ontology. This process is made semi-automatically during the agent developing phase. Hence, the events of the current competence list are already anchored onto the ontology (each event, containing different terms from the code, has a different anchorage). The aim is then to find the “nearest” event of the user command among the set of generated events. We thus have to compare several set of terms anchored onto the same ontology. We have defined a formula to compute the “cost” of each possible alignment [4]. The cheaper an alignment, the more interesting (and possibly correct interpretation) is the couple event/command tested. The logical form of the user sentence is also used during the semantic interpretation to compute the transitive closure of each relation. For example, if the user talks about an object “near the book”, our semantic interpretation gives the set of positions for “near the book” regarding the position of the book at the current time. This requires the ontology to infer all possible instances related to “near” and the agent environment to compute the real position of the book.

4

Conclusion

In this paper, we proposed an algorithm to build a logical model of a user sentence using the ontology structure to infer predicates and arguments in the framework of conversational agents. The symbol used for predicates are directly

References [1] J. Allen, D. Byron, M. Dzikovska, G. Ferguson, L. Galescu, and A. Stent. An architecture for a generic dialogue shell. NLENG: Natural Language Engineering, 6, 2000. [2] K. Eliasson. Case-Based Techniques Used for Dialogue Understanding and Planning in a Human-Robot Dialogue System. In Proc. of IJCAI07, pages 1600–1605, 2007. [3] J. Hobbs, D. Appelt, J. Bear, D. Israel, M. Kameyama, M. Stickel, and M. Tyson. FASTUS: A Cascaded FiniteState Transducer for Extracting Information from NaturalLanguage Text. Finite-State Language Processing, pages 383–406, 1997. [4] L. Mazuel and N. Sabouret. Generic command interpretation algorithms for conversational agents. In Proc. Intelligent Agent Technology (IAT’06), pages 146–153. IEEE Computer Society, 2006. [5] D. Milward. Distributing representation for robust interpretation of dialogue utterances. In ACL, pages 133–141, 2000. [6] D. Milward and M. Beveridge. Ontology-based dialogue systems. In Proc. 3rd Workshop on Knowledge and reasoning in practical dialogue systems (IJCAI03), pages 9–18, August 2003. [7] E. Paraiso, J. A. Barthès, and C. A. Tacla. A speech architecture for personal assistants in a knowledge management context. In Proc. European Conference on AI (ECAI), pages 971–972, 2004. [8] R. Porzel, I. Gurevych, and C. Muller. Ontology-based contextual coherence scoring. In Proc. of the Fourth SIGdial Workshop on Discourse and Dialogue, Sapporo, Japan, July 2003. [9] G. Sabah. Compréhension des langues et interaction. Cognition et Traitement de l’Information. Hermes-Lavoisier, 2006. [10] D. Sadek, P. Bretier, and E. Panaget. Artimis: Natural dialogue meets rational agency. In IJCAI (2), pages 1030–1035, 1997. [11] S. Shapiro. Sneps: a logic for natural language understanding and commonsense reasoning. Natural language processing and knowledge representation: language for knowledge and knowledge for language, pages 175–195, 2000.