In this project, I trained a chatbot using RASA, an open-source machine learning framework for automated text and voice-based conversations, to recommend food recipes. ‘Be My Chef’ is designed to recommend recipes tailored to dietary allergies and drug interactions. This project specifically targets elderly users who find traditional technologies challenging, offering voice-activated assistants like Alexa. The project is specifically aimed at elderly users who struggle with traditional technologies, by offering a voice-activated assistant akin to Alexa. My aim is to foster healthier living and the ethical use of AI, thus contributing to a more equitable world in the context of aging and technology.
The chatbot utilizes user input to determine their preferred cuisine and desired ingredients for meals. It also accommodates users' dietary restrictions by allowing them to exclude ingredients they dislike or are allergic to. The BMC offers a selection of recipes, detailing the name of the dish and the required cooking time. Users can personalize their experience by adding or removing ingredients, which refines the bot’s recommendations over time. The chatbot continues to present recipes until the user finds one that they like. Upon selection, the chatbot sends an SMS to the user's phone containing the recipe name and a URL for the detailed recipe description.
The bot primarily relies on two models: an NLU model and a core model. The NLU model's role is to detect the user's intention and extract the entities mentioned by the user. For example, it understands that when a user says "Include green pepper," the intention is to include an ingredient, with "green pepper" being the specific entity identified as that ingredient. This model has been trained on a vast dataset of potential intentions and entities, compiled from naturally spoken sentences. The core model is tasked with navigating the user's journey through the dialogue and taking appropriate actions based on the chat history and current user input. This model was trained using stories collected from real interactions with potential users of the bot. Thanks to the comprehensive training datasets, both the NLU and core models have achieved an accuracy rate of 99% on the test dataset.
To manage the necessary actions, several Python scripts have been implemented. These scripts handle various logics, such as verifying input data, searching for possible recipes via the Spoonacular API, maintaining a list of the user's favorites, navigating through the found recipes, and ultimately sending the selected recipe to the user's cellphone.