• No results found

Embedding Commonsense Knowledge into the Domain Description

In the housekeeping domain, the robots need to know that books are expected to be in the bookcase, dirty dishes in the dishwasher, and pillows in the closet. Moreover, a bookcase is expected to be in the living-room, dishwasher in the kitchen, and the closet in the bedroom. In addition, the robots should have an understanding of a tidy house to be able to clean a house autonomously: tidying a house means that the objects are at their desired locations. Also, while cleaning a house, robots should pay more attention while carrying fragile objects; for that they should have an understanding of what a fragile object is. Such commonsense knowledge is formally represented already in commonsense knowledge bases, such as CONCEPTNET.

CCALCallows us to extract and embed commonsense knowledge from these knowl-

edge bases by means of “external predicates.” External predicates are not part of the sig- nature of the domain description (i.e., they are not declared as fluents or actions). They are implemented as functions in some programming language of the user’s choice, such as C++ or Prolog. External predicates take as input not only some parameters from the domain description (e.g., the locations of robots) but also detailed information that is not a part of the action domain description (e.g., commonsense knowledge). They are used to externally check some conditions.

Expected locations of objects We represent the expected locations of objects by a new fluentat desired location(EP)describing that an objectEPis at its expected position in the house. Unlike the fluents above, we can defineat desired location(EP)in terms of other fluents. This type of fluents are called “statically determined fluents”. We declare thisat desired location(EP)fluent as follows:

:- constants

at_desired_location(endpoint) :: sdFluent.

After the declaration, the definition of the fluent is formalized as the following two causal law:

caused at_desired_location(EP) if at(EP,X,Y) where in_place(EP,X,Y).

default -at_desired_location(EP).

The second causal law expresses that normally the movable objects in an untidy house are not at their desired locations. The first causal law formalizes that the object EPis at its desired location if it is at some “appropriate” position (X,Y) in the right room. So,

the robots need to know that books are expected to be in the bookcase, dirty dishes in the dishwasher, and pillows in the closet. Moreover, a bookcase is expected to be in the living-room, dishwasher in the kitchen, and the closet in the bedroom. We describe such background knowledge externally as a Prolog program. For instance, the external predicatein place(EP,X,Y)is defined as follows:

in_place(EP,X,Y) :- belongs(EP,Obj), type_of(Obj,Type), el(Type,Room), area(Room,Xmin,Xmax,Ymin,Ymax), X>=Xmin, X<=Xmax, Y>=Ymin, Y>=Ymax.

Herebelongs(EP,OBJ),type of(OBJ,Type)describe the typeTypeof an objectObjthat the endpointEPbelongs to, andel(Type,Room)describes the expected room of an object of typeType. The rest of the body of the rule above checks that the endpoint’s location

(X,Y)is a desired part of the roomRoom.

After defining at desired location(EP), we can introduce a “macro” to define a tidy house:

:- macros

tidy -> [/\EP | at_desired_location(EP)].

The second rule above expresses that the house is normally tidy. The first rule above describes the exceptions: when an object is not at its expected location, the house is untidy.

Acquiring commonsense knowledge In order to acquire the knowledge of expected rooms of objects, which is represented byel(Type,Room), we make use of existing com- monsense knowledge bases. Specifically, we use CONCEPTNET.

CONCEPTNET [64] is a semantic network in which the nodes correspond to con-

cepts (e.g., “human”, “walking”, etc.), and the edges denote relations (e.g. “capable of”, “located near”) between these concepts. Most of its data is obtained through Open Mind Common Sense Project [82] where thousands of volunteers manually enter trivial facts re- garding the world, i.e., commonsense knowledge. The semantic network can be queried using reasoning techniques such as spreading action.

Using Python API of CONCEPTNET 4.0, we can easily query which objects are likely to be located at a specific room. The network provides a well-suited relation for our purpose, called “At Location”. As the name itself suggests, it is a relation denoting the locations of objects.

For instance, we query the objects which are likely to be located in the bedroom, and automatically generate a list of facts as follows:

el(dresser, bedroom). el(mirror, bedroom). el(bed, bedroom). el(pillow, bedroom). el(closet, bedroom). el(person, bedroom). el(blanket, bedroom). el(pillowcase, bedroom). el(wardrobe, bedroom).

Figure 3.2: Commonsense knowledge about bedroom objects

result = Assertion.objects.filter( \

relation=atLocation, concept2=bedroom, \ score__gte=threshold)

for assertion in result: print ’el(%s, bedroom).’ \

% assertion.concept1.text

HereatLocationrepresents the “At Location” relation, andbedroom is representing the “Bedroom” concept. The query outcome denoted by result is a set of assertions. An assertion in CONCEPTNETis simply an object which includes two related concepts, and a relation connecting these two concepts. Assertions also have some intrinsic properties like the language of the assertion, and the frequency in which the given two concepts are related to each other by the given relation. “Score” is one of these intrinsic values which denotes the reliability of an assertion. In order to eliminate unreliable assertions, we filter out the ones with a score less than the value ofthreshold. The value of threshold is

determined empirically, and is equal to 5 for this case.

After obtaining the query result, we simply represent it in Prolog using atoms of the formel(Type,Room). Some assertions about what is expected in the bedroom are shown in Figure 3.2. We could have obtained a much longer list of facts if thethreshold had been set to a lower value; but then we would have jeopardized the integrity of the facts. CONCEPTNETis generated automatically using the data gathered collaboratively by Open Mind Common Sense Project, and as a result, contains some unreliable knowledge. Still, eliminating the unreliability is possible as described above, with the help of the easy-to- use API of CONCEPTNET.

Note that the expected location of an object depends on where it is: for instance, the expected location of a book on the floor of the kitchen is the exchange area be- tween the kitchen and the living room (so that the robot whose goal is to tidy the living

room can pick it up and put it in the bookcase); on the other hand, the expected loca- tion of a plate on the floor of the kitchen is the dishwasher. Therefore, the predicate

area(Room,Xmin,Xmax,Ymin,Ymax)describes either an exchange area (if the object does not belong to the room where it is at) or a deposit area (if the object belongs to the room where it is at). Note also that knowledge about specific objects in a room as well as spe- cific deposit and exchange areas are not common knowledge to all robots; each robot has a different knowledge of objects in their room.

Related documents