Course:CPSC312-2023-cookRecommendation

From UBC Wiki

Authors: Yuefeng Zhao, Ethan Tan, Zet Zhou

What is the problem?

Nowadays, deciding what to cook can be a very challenging task. It is easy to feel overwhelmed with the limitless dish options that exist for you to cook. Conversely, it is also easy to become bored of cooking the same dish over and over again.

To alleviate the confusion, we made a recommendation tool to help users decide what to cook. Our tool has two simple modes, giving users flexibility to obtain the best recommendation for them. The first mode allows users to pick some of their favourite ingredients, and based on their inputs, the tool will recommend a dish which it thinks will suit the users' preference. The other mode outputs a recommendation on what dish to cook based on what ingredients a user has available to work with.

No matter how confused you're feeling about what to make, our recommendation tool has you covered!

What is the something extra?

Straying from lecture and assignment content, we have done several things which qualify as "something extra".

Firstly, we have implemented a GUI to connect with our recommender tool. This was done using the XPCE toolkit, which uses built in graphics defined in C, resulting in our program having a fast and responsive GUI. The GUI supports both modes of our recommendation tool, and handles user inputs robustly for each case. This required lots of extra research well beyond the scope of this course. For example, the development process required running a remote server to launch the GUI since XPCE is not setup friendly with Apple Silicon Macbooks.

Secondly, we implemented our own modified Natural Language Interfacing to allow users to ask natural sentence questions (ex. What can I make with cheese and pasta?). While some NLI content was covered in lecture, we have used our own design to tailor the NLI processing directly to our application's use cases (food related questions). This allows users to directly input proper English sentences when asking for recommendations.

Finally, our recommendation tool goes above and beyond by providing users with two modes to obtain a recommendation. We understand that sometimes one recommendation is not enough for a user to decide, and it would be beneficial to have more options to choose from. For example, perhaps the recommender tool outputs a single dish that the user does not know how to make. In that case, the user can simply generate more options using the other mode. Providing users with enhanced flexibility is why we wanted to offer two distinct paths for users to interact with.

What did we learn from doing this?

-Prolog is extremely efficient for NLI, and is ideal for any sort of language processing task. We were able to add NLI functionality to our program based on exactly what sentences we want to allow, and our program executes the NLI functionality efficiently and robustly. The concept of difference lists, and being able to isolate different components of sentences for querying purposes was a novel approach to problem solving for all of us.

-Prolog is an extremely capable language for handling user queries and database type operations. We could implement our own "backend" database using facts within the application code itself, and querying the database using predicates was incredibly simple. It becomes clear how the simplicity and efficiency of executing queries with Prolog can be extended upon with regards to our application. For example, our application's database could be expanded to a full scale external database without needing to change the querying logic for our program, once the database is connected to our program.

-We learned how to use many different built in library functions. In doing so, we learned that Prolog has mediocre documentation compared to more currently popular languages like java. The documentation does not offer in-depth explanations for library functions, and does not even provide example use cases. Often times, it is more beneficial to try to use the function yourself and figure out what exactly is occurring. This can be advantageous because it forces you to get hands-on with each library function you want to use. However, it is also disadvantageous because it can be a time consuming process just to find out that one library function does not offer the exact behaviour you were looking for.

-We learned how to use external modules with Prolog, for example XPCE, and learned how to program a GUI to responsively handle user input.

-In writing a full scale program, we learned how to handle a program's logic flow within logical programming. Without explicit if-else branching and loops, it was sometimes hard to figure out how to navigate users throughout our program. For example, since we offer two different modes for our recommender tool that users can choose from, we have to be able to navigate users through two different control flows, each having its own program logic and GUI responses. Our solution not only handles this challenge appropriately, but is also immediately extensible to handle additional modes if we want to implement further options for users.

Links to code etc.

https://github.com/MaxonZhao/cpsc312project2-CookRecommendation