Excluding Features
This 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:
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.
insert an ingredient such as salt here
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.
Exclusion functionality will require teamwork:
Will probably need to modify the ontology, data, model, and agent collaboratively.
Here Dialogflow - 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.