<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Improving Ingredient Substitution using Formal Concept Analysis and Adaptation of Ingredient Quantities with Mixed Linear Optimization</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Emmanuelle Gaillard</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jean Lieber</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Emmanuel Nauer</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>54602 Villers-les-Nancy</institution>
          ,
          <country country="FR">France</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Universite de Lorraine</institution>
          ,
          <addr-line>LORIA</addr-line>
        </aff>
      </contrib-group>
      <fpage>209</fpage>
      <lpage>220</lpage>
      <abstract>
        <p>This paper presents the participation of the Taaable team to the 2015 Computer Cooking Contest. The Taaable system addresses the mixology and the sandwich challenges. For the mixology challenge, the 2014 Taaable system was extended in two ways. First, a formal concept analysis approach is used to improve the ingredient substitution, which must take into account a limited set of available foods. Second, the adaptation of the ingredient quantities has also been improved in order to be more realistic with a real cooking setting. The adaptation of the ingredient quantities is based on a mixed linear optimization. The team also applied Taaable to the sandwich challenge.</p>
      </abstract>
      <kwd-group>
        <kwd>case-based reasoning</kwd>
        <kwd>formal concept analysis</kwd>
        <kwd>adaptation of ingredient quantities</kwd>
        <kwd>mixed linear optimization</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <sec id="sec-1-1">
        <title>This paper presents the participation of the Taaable team to the mixology and</title>
        <p>to the sandwich challenges of the 2015 Computer Cooking Contest (CCC). The</p>
      </sec>
      <sec id="sec-1-2">
        <title>Taaable system is based on many methods and techniques in the area of knowl</title>
        <p>edge representation, knowledge management and natural language processing [1].</p>
      </sec>
      <sec id="sec-1-3">
        <title>Currently, it is built over Tuuurbine (http://tuuurbine.loria.fr), a generic</title>
        <p>case-based reasoning (CBR) system over RDFS [2] which allows reasoning over
knowledge stored in a RDF store, as the one provided by the contest.</p>
      </sec>
      <sec id="sec-1-4">
        <title>For this edition of the CCC, Taaable has been extended in order to improve</title>
        <p>the ingredient substitution procedure which must manage unavailable foods. An
approach based on formal concept analysis (FCA) allows improving ingredient
substitutions. Moreover, the adaptation of the ingredient quantities has also
been improved in order to be more realistic with a real cooking setting. The
adaptation of the ingredient quantities is based on mixed linear optimization.</p>
      </sec>
      <sec id="sec-1-5">
        <title>This adaptation takes into account the preference unit given in the source recipe and proposes quantities which are usual. For example, when the ingredient is a lemon, its quantity will take the form of a human easy understandable value (i.e. a quarter, a half, etc. instead of 54 g, which corresponds to a half lemon).</title>
        <p>Copyright © 2015 for this paper by its authors. Copying permitted for private and
academic purposes. In Proceedings of the ICCBR 2015 Workshops. Frankfurt, Germany.
0:02
Citrus
Fruit</p>
        <p>Juice
0:10
OrangeJuice</p>
        <p>FruitJuice
0:14 0:14
Apple Pineapple
Juice Juice
0:11
LemonJuice</p>
        <p>Liquid</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>2 The TAAABLE system</title>
      <sec id="sec-2-1">
        <title>The challenges, proposed by the CCC since its rst edition consists in proposing,</title>
        <p>according to a set of initial recipes, one or more recipes matching a user query
composed of a set of wanted ingredients and a set of unwanted ingredients. The</p>
      </sec>
      <sec id="sec-2-2">
        <title>Taaable system addresses this issue through an instantiation of the generic</title>
      </sec>
      <sec id="sec-2-3">
        <title>CBR Tuuurbine system [3], which implements a generic CBR mechanism in which adaptation consists in retrieving similar cases and in replacing some features of these cases in order to adapt them as a solution to a query.</title>
        <sec id="sec-2-3-1">
          <title>2.1 TUUURBINE founding principles</title>
          <p>Tuuurbine is a generic CBR system over RDFS . The domain knowledge
is represented by an RDFS base DK consisting of a set of triples of the form
hC subClassOf Di where C and D are classes which belong to a same
hierarchy (e.g, the food hierachy). Fig. 1 represents the domain knowledge for the
running examples by a hierarchy whose edges C x! D represent the triples
hC subClassOf Di. The retrieval knowledge is encoded by a cost function:
cost(hC subClassOf Di) = x for an edge C x! D. This cost can be
understood intuitively as the measure of \the generalization e ort" from C to D. How
this cost is computed is detailed in [1].</p>
          <p>A Tuuurbine case case is described by a set of triples of the form
hU RIcase prop vali, where U RIcase is the URI of case, val is either a resource
representing a class of the ontology or a value and prop is an RDF property
linking case to a hierarchy class or to the value. For simpli cation, in this paper, we
represent a case by a conjunction of expressions only of the form prop : val. For
example, the \Rainbow" recipe is represented by the following index R, which
means that \Rainbow" is a cocktail recipe made from vodka, orange juice,
grenadine and curacao (ing stands for ingredient ).</p>
          <p>
            R = dishType : CocktailDish
^ ing : Vodka ^ ing : OrangeJuice ^ ing : Grenadine ^ ing : Curacao
(
            <xref ref-type="bibr" rid="ref1">1</xref>
            )
          </p>
        </sec>
      </sec>
      <sec id="sec-2-4">
        <title>For instance, the rst conjunct of this expression means that the triple</title>
        <p>hU RIR dishType CocktailDishi belongs to the knowledge base.</p>
        <sec id="sec-2-4-1">
          <title>2.2 TUUURBINE query</title>
        </sec>
      </sec>
      <sec id="sec-2-5">
        <title>A Tuuurbine query is a conjunction of expressions of the form sign prop : val</title>
        <p>where sign 2 f ; +; !; g, val is a resource representing a class of the ontology
and prop is an RDF property belonging to the set of properties used to represent
cases. For example,</p>
        <p>
          Q = +dishType : CocktailDish
^ ing : Vodka ^ ing : Grenadine ^ !ing : Whiskey
(
          <xref ref-type="bibr" rid="ref2">2</xref>
          )
is a query to search \a cocktail with vodka and grenadine syrup but without
whiskey".
        </p>
      </sec>
      <sec id="sec-2-6">
        <title>The signs (empty sign) and + are \positive signs": they pre x features</title>
        <p>that the requested case must have. + indicates that this feature must also occur
in the source case whereas indicates that the source case may not have this
feature, thus the adaptation phase has to make it appear in the nal case.</p>
      </sec>
      <sec id="sec-2-7">
        <title>The signs ! and are \negative signs": they pre x features that the requested case must not have. indicates that this feature must not occur in the source case whereas ! indicates that the source case may have this feature, and, if so, that the adaptation phase has to remove it.</title>
        <sec id="sec-2-7-1">
          <title>2.3 TUUURBINE retrieval process</title>
        </sec>
      </sec>
      <sec id="sec-2-8">
        <title>The retrieval process consists in searching for cases that best match the query.</title>
      </sec>
      <sec id="sec-2-9">
        <title>If an exact match exists, the corresponding cases are returned. For the query Q</title>
        <p>
          given in (
          <xref ref-type="bibr" rid="ref2">2</xref>
          ), the \Rainbow" recipe is retrieved without adaptation. Otherwise,
the query is relaxed using a generalization function composed of one-step
generalizations, which transforms Q (with a minimal cost) until at least one recipe
of the case base matches (Q).
        </p>
        <p>A one step-generalization is denoted by = prop : A prop : B, where A
and B are classes belonging to the same hierarchy with A v B, and prop is a
property used in the case de nition. This one step-generalization can be applied
only if A is pre xed by or ! in Q. If A is pre xed by !, thus B is necessarily
the top class of the hierarchy. For example, the generalization of !ing : Rum is
ing : Food, meaning that if rum is not wanted, it has to be replaced by some
other food. Classes of the query pre xed by + and cannot be generalized.</p>
      </sec>
      <sec id="sec-2-10">
        <title>Each one-step generalization is associated with a cost denoted by cost(A</title>
      </sec>
      <sec id="sec-2-11">
        <title>B). The generalization of Q is a composition of one-step generalizations 1,</title>
        <p>
          . . . n: = n : : : 1, with cost( ) = Pin=1 cost( i). For example, for:
Q = +dishType : CocktailDish
^ ing : Vodka ^ ing : PineappleJuice ^ ing : Grenadine ^ !ing : Whiskey
PineappleJuice is relaxed to FruitJuice according to the domain
knowledge of Fig. 1. At this rst step of generalization, (Q) =
(
          <xref ref-type="bibr" rid="ref3">3</xref>
          )
dishType : CocktailDish^ing : Vodka^ing : FruitJuice^!ing : Whiskey, which
matches the recipe described in (
          <xref ref-type="bibr" rid="ref1">1</xref>
          ), indexed by OrangeJuice, a FruitJuice.
        </p>
        <sec id="sec-2-11-1">
          <title>2.4 TUUURBINE adaptation process</title>
        </sec>
      </sec>
      <sec id="sec-2-12">
        <title>When the initial query does not match existing cases, the cases retrieved after generalization have to be adapted. The adaptation consists of a specialization of the generalized query produced by the retrieval step. According to (Q), to R, and to DK, the ingredient OrangeJuice is replaced with the ingredient</title>
        <p>PineappleJuice in R because FruitJuice of (Q) subsumes both OrangeJuice
and PineappleJuice. Tuuurbine implements also an adaptation based on
rules where some ingredients are replaced with others in a given context [4].</p>
      </sec>
      <sec id="sec-2-13">
        <title>For example, in cocktail recipes, replacing OrangeJuice and StrawberrySyrup</title>
        <p>with PineappleJuice and Grenadine is an example of an adaptation rule. This
rule-based adaptation is directly integrated in the retrieval process by
searching cases indexed by the substituted ingredients for a query about the
replacing ingredients, for example by searching recipes containing OrangeJuice and
StrawberrySyrup for a query about PineappleJuice and Grenadine.</p>
        <sec id="sec-2-13-1">
          <title>2.5 TAAABLE as a TUUURBINE instantiation</title>
          <p>
            The Taaable knowledge base is WikiTaaable (http://wikitaaable.loria.
fr/), the knowledge base made available for this CCC edition. WikiTaaable is
composed of the four classical knowledge containers: (
            <xref ref-type="bibr" rid="ref1">1</xref>
            ) the domain knowledge
contains an ontology of the cooking domain which includes several hierarchies
(about food, dish types, etc.), (
            <xref ref-type="bibr" rid="ref2">2</xref>
            ) the case base contains recipes described by
their titles, the dish type they produce, the ingredients that are required, the
preparation steps, etc., (
            <xref ref-type="bibr" rid="ref3">3</xref>
            ) the adaptation knowledge takes the form of
adaptation rules as introduced previously, and (
            <xref ref-type="bibr" rid="ref4">4</xref>
            ) the retrieval knowledge, which is
stored as cost values on subclass-of relations and adaptation rules.
          </p>
        </sec>
      </sec>
      <sec id="sec-2-14">
        <title>In WikiTaaable, all the knowledge (cases, domain knowledge, costs, adap</title>
        <p>tation rules) is encoded in a triple store, because WikiTaaable uses Semantic</p>
      </sec>
      <sec id="sec-2-15">
        <title>Media Wiki, where semantic data is stored into a triple store. So, plugging Tuuurbine over the WikiTaaable triple store is quite easy because it requires only to con gure Tuuurbine by giving the case base root URI, the ontology root URI and the set of properties on which reasoning may be applied.</title>
        <p>3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Mixology challenge</title>
      <p>The mixology challenge consists in retrieving a cocktail that matches a user
query according to a set of available foods given by the CCC organizers (white
rum, whiskey, vodka, orange juice, pineapple juice, sparkling water, coca-cola,
beer grenadine syrup, lemon juice, mint leaves, lime, ice cube, brown sugar, salt,
and pepper). Tuuurbine queries can express this kind of request using the
and ! pre xes. Section 3.1 explains how the user query is transformed to take
into account only the available foods, before being submitted to Tuuurbine .
Two additionnal processes have been implemented to improve the Tuuurbine
adaptation result. The rst process searches, when some ingredients of the source
recipe are not available, the best way to replace them, or in some cases, to remove
them (see Section 3.2). The second process uses Revisor/CLC (see Section 3.4)
to adapt quantities. A new formalization of the quantity adaptation problem is
proposed to obtain more realistic quantity values, taking into account the type
of unit given in the source case (see Section 3.4).</p>
      <sec id="sec-3-1">
        <title>3.1 Query building</title>
        <sec id="sec-3-1-1">
          <title>For the mixology challenge, where an answer must only contain the available</title>
          <p>food, the query may be built by adding to the initial user query the minimal
set of classes of the food hierarchy that subsume the set of foods which are not
available, each class being negatively pre xed by !. For example, let us assume
that OrangeJuice and PineappleJuice are the only available fruit juices, that</p>
        </sec>
        <sec id="sec-3-1-2">
          <title>Vodka and Whiskey are the only available alcohols, that SugarCaneSyrup and</title>
        </sec>
        <sec id="sec-3-1-3">
          <title>Grenadine are the only available syrups, and that the user wants a cocktail recipe with Vodka but without SugarCaneSyrup. The initial user query will be</title>
          <p>Q = +dishType : CocktailDish ^ ing : Vodka ^ !ing : SugarCane. According to
Fig. 1, LemonJuice, AppleJuice, Curacao, and StrawberrySyrup will be added
to this initial query with a ! for expressing that the result cannot contain one of
these non available classes of food, which includes their descendant classes. The
extended query EQ submitted to Tuuurbine will be:</p>
          <p>EQ = Q ^ !ing : LemonJuice ^ !ing : AppleJuice</p>
          <p>^ !ing : StrawberrySyrup ^ !ing : Curacao</p>
        </sec>
        <sec id="sec-3-1-4">
          <title>For this example, Tuuurbine retrieves the \Rainbow" recipe with the adap</title>
          <p>tation \replace Curacao with Food", due to !ing : Curacao.</p>
        </sec>
        <sec id="sec-3-1-5">
          <title>In order to replace Curacao by something more speci c than Food, a new approach based on FCA is proposed.</title>
        </sec>
      </sec>
      <sec id="sec-3-2">
        <title>3.2 Using FCA to search the best ingredient substitution</title>
        <p>When ingredients of the source case must be replaced because these pieces of
food are not available, we choose FCA to exploit ingredient combination in
cocktail recipes in order to search which ingredient(s) is/are the most used with
the ones already used in the recipe that must be adapted. FCA is a classi cation
method allowing object grouping according to the properties they share [5]. FCA
takes as input a binary context, i.e. a table in which objects are described by
properties. Table 1 shows an example of binary context with 7 objects (which
are cocktails), described by two kinds of properties: the ingredients they use,
and some more generic ingredient classes: Alcohol, the generic class of recipes
with at least one alcohol, and Sugar, the generic class of recipes with at least
one sweet ingredient, like sugar or syrup. These generic classes are pre xed by
to be distinguished from the concrete ingredients. For example, the object</p>
        <sec id="sec-3-2-1">
          <title>Screwdriver has the properties Vodka and Orange juice (the ingredients used</title>
          <p>in this cocktail), and Alcohol, because Vodka is an alcohol.</p>
        </sec>
        <sec id="sec-3-2-2">
          <title>FCA produces formal concepts as output. A formal concept is a pair (I; E) where I is a set of properties, E is a set of objects, respectively called the intent</title>
          <p>
            AlcohVooldka White TreuqmuilCaachacBalue cOurcaancgaeoCojcuai-cceLoilmae SugarWhite CsaungearsGurgeanrasdyirnuep
Screwdriver
Rainbow
Tequila sunrise
Ti0Punch
Daiquiri
Caipirinha
Cuba libre
and the extent of the formal concept, such that (
            <xref ref-type="bibr" rid="ref1">1</xref>
            ) I is the set of all properties
shared by the objects of E and (
            <xref ref-type="bibr" rid="ref2">2</xref>
            ) E is the set of all objects sharing
properties in I. The formal concepts can be ordered by extent inclusion, also called
specialisation between concepts, into what is called a concept lattice. Fig. 2
illustrates the lattice corresponding to the binary context given in Table 1. On this
gure, the extents E are given through a reduced form (noted Er): the objects
appear in the most speci c concepts, the complete extent can be computed by
the union of objects belonging to the subconcepts. So, the top concept (#1, in
the gure) contains all the objects. In our example, its intent is Alcohol, a
property shared by all the objects. By contrast, the bottom concept is de ned
by the set of all properties. In our example, its extent is empty as none of the
objects are described by all the properties.
          </p>
          <p>To search a replacing ingredient in a given recipe or in a recipe according to
pieces of food that will be kept, the idea is to exploit the lattice which captures
concept similarities and organization. For example, concept #7, which intent is
f Alcohol; Lime; Sugarg, allows an access to 3 cocktails containing at least one
alcohol, at least one sugar, and lime. Adapting a cocktail can be based on the
closeness between concepts. For example, when a replacing ingredient is searched
for Cachaca in the Caipirinha cocktail (in the intent of concept #11), some
similar concepts (i.e. sharing a same super-concept) can be used. In the lattice
given in example, concept #11 can be generalized to concept number #7, which
extent contains cocktails with some alcohol, lime and some sugar. The cocktails
in the extent of concept #12 are similar to the one of concept #11, because they
share the Alcohol, Lime, and Sugar properties. When removing\Cachaca"
from the Caipirinha, a possible ingredient for substitution, given by the lattice,
could be White rum.</p>
        </sec>
        <sec id="sec-3-2-3">
          <title>The approach exploiting the link between the concepts is used in many works</title>
          <p>using FCA for information retrieval. In Carpineto and Romano [6], the
documents which are good answers to a query are searched in the lattice built from
the document properties and from the query, around the concept representing
the query. The same authors use this neighbour relation between concepts in a
lattice for ordering documents returned by an information retrieval system [7].</p>
          <p>Let CR be the formal concept such that Er(CR) = fRg. A formal concept</p>
        </sec>
        <sec id="sec-3-2-4">
          <title>C close to CR is searched according the following procedure. C is such that</title>
          <p>its intent I(C) does not contain the substituting ingredient (Curacao in the
example) and maximizes jEr(C)j. First, C is searched in the ascendants of CR,
then in its siblings, and nally in the descendants of the siblings. The ingredient
to be substituted is replaced by I(C) n I(CR).</p>
        </sec>
        <sec id="sec-3-2-5">
          <title>To implement our approach, data about ingredient combinations in cocktail</title>
          <p>recipes has been collected. For this, we queried Yummly (http://www.yummly.
com/). 16 queries were submitted; each query was composed of one ingredient
(one available food) and was parametered to return all the Yummly cocktails
and beverage recipes containing this ingredient. 9791 recipes have been collected.</p>
        </sec>
        <sec id="sec-3-2-6">
          <title>Unfortunately, the Yummly search engine does not necessarily return answers</title>
          <p>satisfying the query. So, the results are ltered, only to keep recipes that use
at least one available food. Afterwards, the remaining recipes are deduplicated.</p>
        </sec>
        <sec id="sec-3-2-7">
          <title>After ltering and deduplicating, 6114 recipes are available, but only 1327 of them combine at least 2 available foods.</title>
        </sec>
        <sec id="sec-3-2-8">
          <title>We show now, with query (3), how, after proposing to replace OrangeJuice</title>
          <p>with PineappleJuice and StrawberrySyrup with Grenadine in R, Taaable
searches to replace Curacao which is not in the set of available foods. A
part of the lattice resulting from the binary table containing recipes with</p>
        </sec>
        <sec id="sec-3-2-9">
          <title>PineappleJuice, Grenadine and Vodka is given in Fig. 3. Concept #6 corre</title>
          <p>sponds to R, the recipe that must be adapted, and which has been added in the
binary table to appear in the lattice. The most similar ingredient combination
which includes PineappleJuice, Grenadine and Vodka is given by concept #7.</p>
        </sec>
        <sec id="sec-3-2-10">
          <title>Indeed, concept #8 cannot be used to produce a substitution because its intent</title>
          <p>contains Amaretto which is not an available food. Concept #5 intent contains</p>
        </sec>
        <sec id="sec-3-2-11">
          <title>OrangeJuice, an available food, but concept #5 is less close to concept #6 than</title>
          <p>concept #7, according to the selection procedure based on the maximal number
of objects of Er.
3.4</p>
        </sec>
      </sec>
      <sec id="sec-3-3">
        <title>Adaptation of quantities with mixed integer linear optimization</title>
        <sec id="sec-3-3-1">
          <title>Let us consider the following adaptation problem:</title>
        </sec>
        <sec id="sec-3-3-2">
          <title>Recipe \Eggnog" (10 glasses)</title>
          <p>Source = 10 c` of armagnac, 25 c` of rum, half a liter of milk,</p>
        </sec>
        <sec id="sec-3-3-3">
          <title>5 eggs, 125 g of granulated sugar, 25 c` of fresh cream</title>
          <p>
            Q = \I want a cocktail recipe with cream but without egg or armagnac."
for which Tuuurbine produces the following ingredient substitution:
substitute egg and armagnac with banana and kirsch
(
            <xref ref-type="bibr" rid="ref4">4</xref>
            )
It must be noticed that this example does not comply with the constraints of
the cocktail challenge (banana is not an available food), but has been chosen in
order to illustrate various ideas related to adaptation of quantities. The approach
to ingredient quantity adaptation is based on belief revision [8], applied to a
formalization suited to adaptation of quantities. First, the adaptation problem
(Source; Q) and the domain knowledge DK are formalized. Then, this adaptation
process is described.
          </p>
          <p>Formalization. Numerical variables are introduced to represent the ingredient
quantities in a recipe. For the example, the following variables are introduced,
for each food class C: alcoholC, massC, numberC, sugarC and volumeC, which
represent, respectively, the quantity (in grams) of alcohol in the ingredient C of
the recipe, its mass (in grams), its number, its quantity (in grams) of sugar and
its volume (in centiliters).1 Therefore, the retrieved recipe can be expressed in
this formalism by:</p>
          <p>
            Source = (volumeArmagnac = 10) ^ (volumeRum = 25) ^ (volumeMilk = 50)
^ (numberEgg = 5) ^ (massGranulatedSugar = 125)
^ (volumeFreshCream = 25)
(
            <xref ref-type="bibr" rid="ref5">5</xref>
            )
1 One could consider other variables, e.g., the calories of ingredients, which would
make possible to add constraints on the total number of calories in a dish.
          </p>
        </sec>
        <sec id="sec-3-3-4">
          <title>In theory, all the variables could be continuous (represented by oating-point</title>
          <p>numbers). However, this can lead to adapted cases with, e.g., numberEgg = 1:7,
which is avoided in most recipe books! For this reason, some variables v are
declared as integer (denoted by (v) = integer), the other ones as real numbers
(denoted by (v) = real).</p>
          <p>The domain knowledge DK consists of a conjunction of conversion equations,
conservation equations and sign constraints. The following conversion equations
state that one egg without its shell has (on the average) a mass of 50 g, a volume
of 5:2 c`, a quantity of sugar of 0:77 g and no alcohol:</p>
          <p>massEgg = 50
sugarEgg = 0:77
numberEgg
numberEgg</p>
          <p>
            volumeEgg = 5:2
alcoholEgg = 0:
numberEgg
(
            <xref ref-type="bibr" rid="ref6">6</xref>
            )
with (massEgg) = (volumeEgg) = (sugarEgg) = (alcoholEgg) = real and
(numberEgg) = integer.
          </p>
          <p>
            The following equations are also conjuncts of DK and represent the
conservation of masses, volumes, etc.:
massEggOrEquivalent = massEgg + massBanana
(
            <xref ref-type="bibr" rid="ref7">7</xref>
            )
volumeFood = volumeLiquid + volumeSolidFood
volumeLiquid = volumeBrandy + volumeRum + volumeFreshCream + : : :
volumeBrandy = volumeArmagnac + volumeKirsch + : : :
where Food is the class of the food (any ingredient of a recipe is an instance
of Food) and, e.g., alcoholRum is related to volumeRum thanks to the conversion
equation alcoholRum = 0:4 volumeRum. Actually, equation (
            <xref ref-type="bibr" rid="ref7">7</xref>
            ) corresponds to
the substitution of eggs by bananas.
          </p>
        </sec>
        <sec id="sec-3-3-5">
          <title>Such conservation equations can be acquired using parts of the food hierar</title>
          <p>chy, thanks to some additional information. For instance, if C is a class of the
hierarchy and fD1; D2; : : : ; Dpg is a set of subclasses of C forming a partition
of C (i.e., for each individual x of C, there is exactly one i 2 f1; 2; : : : ; pg such
that x belongs to Di), then massC (resp., volumeC , numberC , etc.) is equal to
the sum of the massDi 's (resp., of the volumeDi 's, of the numberDi 's, etc.).</p>
        </sec>
        <sec id="sec-3-3-6">
          <title>Finally, each variable v is assumed to satisfy the sign constraint v &gt; 0.</title>
        </sec>
        <sec id="sec-3-3-7">
          <title>The substitution (4) indicates that there should be neither egg nor armagnac</title>
          <p>in the adapted recipe. By contrast, there should be some bananas and kirsch
but this piece of information can be entailed by the conservation equations.</p>
        </sec>
        <sec id="sec-3-3-8">
          <title>Therefore, the query is simply modeled by:</title>
          <p>
            Q = (massEgg = 0) ^ (massArmagnac = 0)
(
            <xref ref-type="bibr" rid="ref8">8</xref>
            )
          </p>
          <p>
            The adaptation problem is now formalized: the source case is formalized
by (
            <xref ref-type="bibr" rid="ref5">5</xref>
            ); the query is formalized by (
            <xref ref-type="bibr" rid="ref8">8</xref>
            ) and the domain knowledge is given by
the conversion and conservation equations, and the sign constraints. Since the
source case and the query are to be understood wrt the domain knowledge, the
formulas for them are, respectively, DK ^ Source and DK ^ Q. The result of the
adaptation will be denoted by AdaptedCase.
Description of the adaptation process. Let fv1; v2; : : : ; vng be the set of
the variables used in Source, Q and DK. In the representation space based on
the formalism used above, a particular recipe is represented by a tuple x =
(x1; x2; : : : ; xn) 2 , where = 1 2 : : : n such that i = Z if (vi) =
integer and i = R otherwise (R: set of real numbers, Z: set of integers). Given
', a conjunction of linear constraints, let M(') be the set of x 2 such that
x veri es all the constraints of '. The function ' 7! M(') provides a
modeltheoretical semantics to the logic of the conjunction of linear constraints: '1
entails '2 if M('1) M('2).
          </p>
          <p>The principle of revision-based adaptation consists in a minimal modi
cation of DK ^ Source so that it becomes consistent with DK ^ Q. Such a minimal
modi cation can be computed thanks to a belief revision operator based on a
distance function d on , meaning that the modi cation from an x 2 to an
y 2 is measured by d(x; y). Let S = M(DK ^ Source) and Q = M(DK ^ Q). The
minimal modi cation from the source case to the query is therefore measured
by d = d(S; Q) = infx2S;y2Q d(x; y). Thus, AdaptedCase is such that</p>
          <p>M(AdaptedCase) = fy 2 Q j d(S; y) = d g
where d(S; y) = infx2S d(x; y).</p>
          <p>Now, d is assumed to be a Manhattan distance function:</p>
          <p>n
d(x; y) = X wijyi
i=1
xij
where wi &gt; 0 is a weight associated to the variable vi. Such a weight captures the
e ort of change for this variable. For example, if vi = volumeLemonJuice and vj =
volumeVodka, then wi &lt; wj means that the adaptation process is less \reluctant"
to change the volume of lemon juice than to change the volume of vodka.</p>
          <p>
            Under this assumption, M(AdaptedCase) is the solution of the following
optimization problem in y:
x 2 M(DK ^ Source) y 2 M(DK ^ Q)
minimize d(x; y)
(
            <xref ref-type="bibr" rid="ref9">9</xref>
            )
(10)
The conjunctions of constraints (
            <xref ref-type="bibr" rid="ref9">9</xref>
            ) are linear but the objective function (10) is
not. Now, it can be shown that the set of solutions to this problem coincides
with the set of solutions to the following optimization problem in y:
x 2 M(DK ^ Source)
n
^ zi yi xi
i=1
n
^ zi
i=1
y 2 M(DK ^ Q)
xi
          </p>
          <p>yi
n
minimize X wizi
i=1
which is linear, and thus can be solved with classical operational research
techniques. It is noteworthy that if every variable is continuous, then this
optimization problem is polynomial, otherwise, it is a mixed integer linear optimization,
known to be an NP-hard problem. In practice, the more variables are integers,
the more it will require computing time; thus, if a variable range is big enough,
it may be more appropriate to consider it as real. The heuristic we have chosen
is as follows. If, for a type of food F , it appears in all the recipes of the case base
as units, then (numberF ) = integer.</p>
        </sec>
        <sec id="sec-3-3-9">
          <title>When this linear problem is solved, this gives a solution to the query, ex</title>
          <p>pressed with all the n variables. From a human-interface viewpoint, some of
these variables should not be displayed. For example, if an ingredient is given
by its volume in the source recipe, then it should not be given as a mass in the
adapted case. Since DK relates masses to volumes, there is no loss of information.</p>
        </sec>
        <sec id="sec-3-3-10">
          <title>With the example presented above, the result is as follows:</title>
          <p>AdaptedCase</p>
          <p>DK
^ (volumeKirsch = 9) ^ (volumeRum = 25) ^ (volumeMilk = 50)
^ (numberBanana = 2) ^ (massGranulatedSugar = 96)
^ (volumeFreshCream = 290)
It can be noticed that AdaptedCase entails DK ^ Q, which was expected. For this
example, the following weights have been chosen assuming that more a variable
correponds to a general concept more its associated weight has to be large:
wvolumeFood = 100
wvolumeBrandy = 5</p>
          <p>wsugarFood = 50
wmassEggOrEquivalent = 10</p>
          <p>walcoholFood = 50
and wv = 1 for any other variable v</p>
        </sec>
        <sec id="sec-3-3-11">
          <title>Translated back in an informal way, this gives:</title>
        </sec>
        <sec id="sec-3-3-12">
          <title>Recipe \Eggnog" (10 glasses) after adaptation</title>
          <p>AdaptedCase = 9 c` of kirsch, 25 c` of rum, half a liter of milk,</p>
        </sec>
        <sec id="sec-3-3-13">
          <title>2 bananas, 96 g of sugar, 290 c` of fresh cream</title>
        </sec>
        <sec id="sec-3-3-14">
          <title>This result illustrates the quantity compensations done by the adaptation: the quantity of sugar has been lowered because bananas are sweeter than eggs and the volume of kirsch is higher than the volume of armagnac in the source recipe, because the degree of alcohol is lower for armagnac than for kirsch.</title>
          <p>4</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Sandwich challenge</title>
      <p>The sandwich challenge is addressed with the 2014 Taaable system [9], which
is e cient for the ingredient susbtitution step. The preparation procedure of
the adapted recipe uses, in the same order, the steps used in the source recipe,
because the ontology-based substitution procedure of Taaable favors the
substitution of ingredients of the same type (e.g., a sauce by a sauce). So, the order
of the ingredients in the adapted recipe will be the same as in the source recipe.
To adapt the textual preparation of the recipe, the text occurrences of the
replaced ingredients are substituted with the replacing ingredients. A set of rules
allows to identify plurals of the removed ingredient in the text, and replace them
with the plural form of the replacing ingredients. For example, when replacing
mayo with mustard, \Apply mayo on one slice, tomato sauce on the other." is
adapted to \Apply mustard on one slice, tomato sauce on the other."</p>
    </sec>
    <sec id="sec-5">
      <title>5 Conclusion</title>
      <p>This paper has presented the two systems developed by the Taaable team for
its participation to the 2015 CCC. The two systems are based on the
previous version of Taaable, extended with two new approaches: a FCA approach
to guide ingredient substitution, and an adaptation of the ingredient quantities
based on a mixed linear optimization. The work presented here still needs a
thorough evaluation: ongoing work addresses this issue, following the methodology
introduced in [2].</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>A.</given-names>
            <surname>Cordier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>V.</given-names>
            <surname>Dufour-Lussier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lieber</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Nauer</surname>
          </string-name>
          ,
          <string-name>
            <given-names>F.</given-names>
            <surname>Badra</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Cojan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Gaillard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Infante-Blanco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Molli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Napoli</surname>
          </string-name>
          , and
          <string-name>
            <given-names>H.</given-names>
            <surname>Skaf-Molli</surname>
          </string-name>
          .
          <article-title>Taaable: a Case-Based System for personalized Cooking</article-title>
          . In S. Montani and L. C. Jain, editors,
          <source>Successful Case-based Reasoning Applications-2</source>
          , volume
          <volume>494</volume>
          <source>of Studies in Computational Intelligence</source>
          , pages
          <fpage>121</fpage>
          {
          <fpage>162</fpage>
          . Springer,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>E.</given-names>
            <surname>Gaillard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lieber</surname>
          </string-name>
          , E. Nauer,
          <article-title>and</article-title>
          <string-name>
            <given-names>A.</given-names>
            <surname>Cordier</surname>
          </string-name>
          .
          <article-title>How Case-Based Reasoning on e-Community Knowledge Can Be Improved Thanks to Knowledge Reliability</article-title>
          .
          <source>In Case-Based Reasoning Research and Development</source>
          , volume
          <volume>8765</volume>
          , pages
          <fpage>155</fpage>
          {
          <fpage>169</fpage>
          ,
          <string-name>
            <surname>Cork</surname>
          </string-name>
          , Ireland, Ireland,
          <year>September 2014</year>
          .
          <string-name>
            <given-names>L.</given-names>
            <surname>Lamontagne</surname>
          </string-name>
          and
          <string-name>
            <given-names>E.</given-names>
            <surname>Plaza</surname>
          </string-name>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>E.</given-names>
            <surname>Gaillard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Infante-Blanco</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lieber</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Nauer</surname>
          </string-name>
          .
          <article-title>Tuuurbine: A Generic CBR Engine over RDFS</article-title>
          .
          <source>In Case-Based Reasoning Research and Development</source>
          , volume
          <volume>8765</volume>
          , pages
          <fpage>140</fpage>
          {
          <fpage>154</fpage>
          ,
          <string-name>
            <surname>Cork</surname>
          </string-name>
          , Ireland,
          <year>September 2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <given-names>E.</given-names>
            <surname>Gaillard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lieber</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Nauer</surname>
          </string-name>
          .
          <article-title>Adaptation knowledge discovery for cooking using closed itemset extraction</article-title>
          .
          <source>In The Eighth International Conference on Concept Lattices and their Applications - CLA</source>
          <year>2011</year>
          , pages
          <fpage>87</fpage>
          {
          <fpage>99</fpage>
          ,
          <year>2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>B.</given-names>
            <surname>Ganter</surname>
          </string-name>
          and
          <string-name>
            <given-names>R.</given-names>
            <surname>Wille</surname>
          </string-name>
          .
          <source>Formal Concept Analysis: Mathematical Foundations</source>
          . Springer, Berlin,
          <year>1999</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>C.</given-names>
            <surname>Carpineto</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Romano</surname>
          </string-name>
          .
          <article-title>E ective Reformulation of Boolean Queries with Concept Lattices</article-title>
          . In T. Andreasen,
          <string-name>
            <given-names>H.</given-names>
            <surname>Christiansen</surname>
          </string-name>
          , and H. Legind Larsen, editors,
          <source>Flexible Query Answering Systems, Third International Conference (FQAS'98)</source>
          , volume
          <volume>1495</volume>
          <source>of LNCS</source>
          , pages
          <volume>83</volume>
          {
          <fpage>94</fpage>
          . Springer,
          <year>1998</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>C.</given-names>
            <surname>Carpineto</surname>
          </string-name>
          and
          <string-name>
            <given-names>G.</given-names>
            <surname>Romano. Order-Theoretical Ranking</surname>
          </string-name>
          .
          <source>Journal of the American Society for Information Science</source>
          ,
          <volume>51</volume>
          (
          <issue>7</issue>
          ):
          <volume>587</volume>
          {
          <fpage>601</fpage>
          ,
          <year>2000</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <given-names>J.</given-names>
            <surname>Cojan</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Lieber</surname>
          </string-name>
          .
          <article-title>Applying Belief Revision to Case-Based Reasoning</article-title>
          . In H. Prade and G. Richard, editors,
          <source>Computational Approaches to Analogical Reasoning: Current Trends</source>
          , volume
          <volume>548</volume>
          <source>of Studies in Computational Intelligence</source>
          , pages
          <fpage>133</fpage>
          {
          <fpage>161</fpage>
          . Springer,
          <year>2014</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <given-names>E.</given-names>
            <surname>Gaillard</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Lieber</surname>
          </string-name>
          , and
          <string-name>
            <given-names>E.</given-names>
            <surname>Nauer</surname>
          </string-name>
          .
          <article-title>Case-Based Cooking with Generic Computer Utensils: Taaable Next Generation</article-title>
          .
          <source>In Proceedings of the ICCBR 2014 Workshops</source>
          , number pp
          <fpage>89</fpage>
          -
          <lpage>100</lpage>
          , page 254,
          <string-name>
            <surname>Cork</surname>
          </string-name>
          , Ireland,
          <year>2014</year>
          .
          <string-name>
            <given-names>D. B.</given-names>
            <surname>Leake</surname>
          </string-name>
          and
          <string-name>
            <given-names>J.</given-names>
            <surname>Lieber</surname>
          </string-name>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>