CheckYourMeal!: diet management with NLG

CheckYourMeal! is an app designed to manage the diet of a user. The app is a component of a complex cloud architecture designed for assisting users in their interaction with food during a week. Check-YourMeal! allows to show the results of automatic reasoning in both graphical and textual forms. In particular, the bilingual English/Italian textual messages are generated server-side by using the SimpleNLG realizer.


Introduction
Following a healthy diet plays a key role in the fulfillment of a good life. Artificial intelligence and ubiquitous computing are emerging technologies that can help people to eat in a correct way (e.g. (Mankoff et al., 2002;Kaptein et al., 2012;Hashemi and Javidnia, 2012)). Natural Language Generation (NLG) can be used in the diet context in different ways. NLG can be used to explain the results of numeric and symbolic reasoners (e.g. (Dragoni et al., 2017;) or can be used to motivate users toward the best dietetic choice. Indeed, a number of projects have recently use NLG for guiding a user towards a virtuous behavior, among them (Reiter et al., 2003;Braun et al., 2018;Conde-Clemente et al., 2018).
MADiMan (Multimedia Application for Diet Management) is an ongoing project 1 with the aim to build a virtual assistant that is able to: recover the nutritional information directly from a specific recipe, reason over recipes and diets with flexibility, i.e. by allowing some forms of diet disobedience, and persuade the user to minimize such acts of disobedience   modules ( Fig. 1), that are a mobile app (described in Section 2), a numerical reasoner that decides the compatibility of a specific dish in some point of the diet , an information extraction module used to compute the nutrient values of a specific recipe, a NLG service that converts the results of the computing to textual form . The reasoning module of MADiMan overcame reasonable baselines in different simulation experiments . We realized the CheckYourMeal! app in order to evaluate the performance and the usability of the whole architecture with human-evaluation into a realistic context. Moreover, we have recently used the app to test the appealing of the NL generated sentences in a first human-evaluation experiment .

The CheckYourMeal! App and the NLG service
CheckYourMeal! is an iOS app 2 (developed in the Swift functional language) designed to present the result of the reasoning on food and diet in terms of both graphics and textual messages. The app is a prototype currently in a development stage. In Fig. 2 we report three screenshots of the app. The user interface is structured in three sections: the Home section, where the users are provided with general information, the Menu section, where the users can see the suggestions for the next meal and where they can input the chosen meals, and the Profile section, where the users can modify settings and user parameters. In the Menu section (central screenshot in Fig. 2), the user is presented with some suggestions of meals taken from a precompiled database of menus which are ordered by their distance from the ideal values of the dietary reference values. When a user selects a specific menu, CheckYourMeal! shows both (1) a pie-chart and (2) a textual message which contains information about the macronutrients values of the chosen menu.
The server (DietManager service in Fig. 1) is written in Java and it uses the Spring framework to communicate with the CheckYourMeal! app. The server calls the NLG service as an external Java library compacted into a single jar file. The NLG Service is composed by two submodules: (i) a monolithic rule-based documentsentence planner  and, (ii) a bilingual English/Italian realizer defined over the SimpleNLG-it library (Mazzei et al., 2016). The entire NLG service has been developed by using the clojure language, that is a functional language running over the JVM.
The document and sentence planner follows simple fixed schemata. All messages will be composed by two parts: an overall evaluation of the dish and three evaluations for carbohydrates, lipids, proteins. The sentences generated for expressing the appropriateness of the specific macronutrients are positive copula sentences with a predicate expressing the deviation (i.e. rich/poor/perfect), and a PP modifier specifying the macronutrient (e.g. in lipids). Moreover, an adverb (e.g. lightly) distinguishes distinct deviations from the optimal choice. Note that the sentence plans generated are, apart from the lexicon, independent from the language used. So, the user selection of the language for the produced messages (English or Italian) corresponds to use a different realizer class of SimpleNLG-it. The actual implementation of the generator allows to select other two features concerning the lexicon (fixed or variable) and the aggregation strategy (VP and set aggregation). We have tested the app, by considering different values of the various features, in a first human-evaluation experiment with 20 people .
During the demo session, we will show both the iOS app on a mobile phone and inner workings of the NLG Service.

Conclusion and Ongoing Work
In this paper we have presented the main features of CheckYourMeal!, an iOS app developed in the domain of the diet management. The app is used in the MADiMan architecture to provide the results of an automatic reasoner in terms of graphics and short text messages.
Future development concerns the implementation of a more sophisticated method for explanation in the text messages. We intend to integrate the numerical reasoning with ontological reasoning to obtain a causal explanation based over the past dishes. In the actual state of development the system allows for a limited form of humanmachine interaction. In future work, we intend to experiment too a more sophisticated form of interaction based on dialogue, where the system could answer to questions concerning the compatibility of the menu in relation to the diet history.