ters. The clustering task takes into account log attributes that describe the situation (date, time, location, etc.) in which the user interacts with the system. The resulting clusters represent the contexts of the user. Discovered contexts can then be explicitly labeled (e.g., Holiday context, Office context). 10.3.1.2 Contextualization Service The contextualization service enables users to express relationships between ele- ments of their profiles and contexts. These relationships can be viewed as mappings between user preferences and contexts in which these preferences are relevant. For instance, the domain of interest of a user can be centered on Java program- ming at work (i.e., in the context work) and on board games at home (i.e., in the context home). Preferences related to each domain will largely differ depending on the context. Moreover, some attributes have values that depend on the context. The address is such an attribute. The user can specify an address in Versailles in the context work and an address in Paris in the context home. The contextualization mappings can be constructed manually or automatically. In the former approach, users are asked to specify explicitly which profile parts depend on a particular context. It is obvious that manual construction is not scal- able. The latter approach overcomes this limitation. Indeed, mappings are automati- cally discovered by analyzing the user behavior contained in application server log files. An overview of an automatic contextualization service is given in Figure 10.7. The results partitioning step consists in identifying which results the user liked and which he disliked. For example, if a user spent a large amount of time in look- ing at a given result, this result is considered as relevant for him. This step generates User history H Set of contexts C Processing Clustering Figure 10.6 The context discovery service. Service Delivery Platforms User profile Profile predicates Partitioned importance evaluation Candidate results mappings User behavior 