...
...
...
...
...
...
...
...
...
...
minLevel | 1 |
---|---|
maxLevel | 2 |
outline | false |
type | list |
printable | false |
Dialogflow
Extend your addFilter intent and add training phrases and entities for excluding an ingredient (type). For example, your Dialogflow agent should be able to make sense of the phrase “recipe without cucumber”. To make sure that the MARBEL agent will be able to handle these ingredients differently from the ones a user wants to include, you should create new parameter names that suggest the ingredient (type) should be excluded instead of included. The table in the Action and parameters section should be extended as follows:
...
Make sure to annotate plenty of phrases again with examples of the use of these parameters! Only if there are enough of these phrases will your Dialogflow agent be robust for all kinds of user input.
As a next step, in a similar vein, extend your agent such that it is able to exclude a cuisine or a dietary restriction (a recipe should not be Japanese or vegan). The table in the Action and parameters section for your addFilter intent should be extended as follows:
...
Prolog and Patterns
In your recipe_selection.pl
file, add the following rules for applying the corresponding filters to the new entities we introduced above. You should define four applyFilter/4
rules where the first argument is instantiated with, respectively, ‘excludeingredient'
, 'excludeingredienttype'
, 'excludedietaryrestriction'
, and 'excludecuisine'
. You should note that to implement these rules it is sufficient to simply require the opposite (the negation) of the basic condition that you used for the rule for 'ingredient'
, etc.
Visuals
You can update the visuals based on what you think will help the user the most. Think about how you can support the implemented capability visually.
Test it Out
Try to filter by excluding an ingredient. Verify that the ingredient is not listed on the a50recipeConfirm
page to ensure that the ingredient is not present in a recipe you select. Verify that your agent is also able to filter recipes based on the exclusion of a cuisine or dietary restriction.
Info
All done?
Proceed with https://socialrobotics.atlassian.net/wiki/spaces/PM2/pages/2216001572/Designing+and+Developing+Your+Agent#Agent-Capability-9%3A-Confirm-the-Chosen-RecipeThis section outlines the steps, requirements, and evaluation criteria for the "Excluding Features" task. This task challenges you to extend your project by enabling your agent to exclude specific ingredients, cuisines, or other features from recipes, pushing your comprehension of the concepts further.Introduction
This task focuses on enhancing your agent’s capabilities by introducing exclusion functionality, where users can request recipes that do not include specific features. For example:
Panel | ||
---|---|---|
| ||
A: What recipe would you like to cook? U: I want a recipe without ____ *. A: Here is a list of recipes that fit your preferences.
|
This extension will test your understanding of data preprocessing, model architecture, and integration with MARBEL, Prolog, and Python. It also introduces flexibility in how you implement the solution, allowing you to experiment with multiple approaches. Each team has the opportunity to come up with unique solutions. Update the start page
of your agent to include its exclusion capabilities.
1. Setting Up
Create a New Branch:
Name the branch
inclusion-only
in your GitHub repository.This branch will preserve your complete inclusion-based model as a backup.
Why?: If exclusion functionality fails or produces different results, you can revert to this branch to meet the base inclusion requirements.
Understand the Requirements:
Inclusion is the base requirement for passing the project.
Exclusion is required to do well, while extensions beyond exclusion are needed to achieve great results.
2. What is Exclusion?
The exclusion feature allows the agent to handle requests that filter out specific features from recipes. See the Assessment Rubric for more specific Exclusion goals. The minimum requirement is:
Excluding ingredients (e.g., “no salt”).
Excluding cuisines (e.g., “not Asian”).
The best implementations will also include:
Excluding tags (e.g., dietary restrictions, meal types).
Extending functionality to other recipe attributes.
3. Potential Approaches
There are multiple ways to implement exclusion functionality, each with its own trade-offs, which you should consider. These are the methods we came up with off the top of our heads. They range in how effective they are. Some we have not tried to implement ourselves. Below are some approaches you can consider:
Intent-Based Approach
What?: Add separate intent(s) for exclusion.
How?: Modify the ontology and train your classifier to detect exclusion intents. Add rules in your Prolog/MARBEL agent.
Slot-Based Approach
What?: Extend slot tagging to include exclusion slots.
How?: Add exclusion-specific slot labels and update the dataset.
Rule-Based Approach
What?: Write Prolog or Python rules to handle exclusion logic based on sentence structure.
How?: Use rules to match exclusion requests and filter results dynamically.
Classifier-Based Approach
What?: Train a custom classifier to detect exclusion-related queries or slots.
How?: Use supervised learning with a dataset tagged for exclusion features vs inclusion features.
Negation-Slot Approach
What?: Introduce a
negation
slot to identify words like "without," "no," or "exclude" in user queries. Use this slot in combination with existing slots (e.g.,ingredient
,cuisine
) to handle exclusion requests.How?: Update your dataset and preprocessing pipeline to tag negation words. Modify the slot classifier to predict
negation
and apply logic to exclude recipes based on these tags.
Note |
---|
Exclusion functionality will require teamwork:
|
Info |
---|
Here OLD INSTRUCTIONS Filter by Excluding Features one can find the instructions for last year's Dialogflow-based agent. This could provide some inspiration for your methodology but parts do not necessarily apply anymore. |
Data
Data Preparation for Exclusion
You will probably need to update the Ontology:
Add new intents, and/or slots specifically for exclusion to support the functionality.Generate Additional Data:
Use the providedexclusion_examples
dataset in the repository as a starting point. This dataset includes examples with a form of negation tagging.You are not required to use this dataset or the way the tags are structured, as they may not perfectly align with your approach.
Note: A few examples may not fit correctly or could include errors, so review them carefully.
Extend Dataset:
Create additional examples manually or use tools like ChatGPT to generate exclusion queries. Ensure that exclusion data aligns with the tagging system you're using, whether or not it matches the inclusion format exactly.
Final Report
In your report you will need to:
Explain your chosen approach.
Discuss its advantages, limitations, and potential improvements.
Additionally one could compare the pros and cons of different approaches.