Food Hazard Detection
Food safety hazard detection task requiring annotators to classify short food-incident report texts by hazard-category and product-category (coarse labels), and to identify the specific hazard and product mentions (fine-grained labels). Based on SemEval-2025 Task 9: The Food Hazard Detection Challenge.
Configuration Fileconfig.yaml
This Potato config reproduces the annotation task. Save it as config.yaml and run potato start config.yaml to try it.
# Food Hazard Detection
# Based on Randl et al., SemEval-2025 Task 9: The Food Hazard Detection Challenge
# Paper: https://aclanthology.org/2025.semeval-1.325/
# Dataset: https://food-hazard-detection-semeval-2025.github.io/
#
# This task asks annotators to classify short food-incident report texts.
# Following the two SemEval subtasks, annotators assign the coarse hazard-category
# (1 of 10) and product-category (1 of 22), and highlight the specific hazard and
# product mentions that ground the fine-grained (ST2) labels.
annotation_task_name: "Food Hazard Detection"
task_dir: "."
data_files:
- sample-data.json
item_properties:
id_key: "id"
text_key: "text"
output_annotation_dir: "annotation_output/"
output_annotation_format: "json"
port: 8000
server_name: localhost
annotation_schemes:
# Subtask 1 (coarse): single hazard-category label (1 of 10)
- annotation_type: radio
name: hazard_category
description: "Which hazard-category does this text imply? (choose one)"
labels:
- "allergens"
- "biological"
- "chemical"
- "foreign bodies"
- "fraud"
- "organoleptic aspects"
- "packaging defect"
- "food additives and flavourings"
- "migration"
- "other hazard"
tooltips:
"allergens": "Undeclared or mislabelled allergens (e.g., milk, nuts, gluten)"
"biological": "Microbiological contamination (e.g., Listeria, Salmonella, E. coli)"
"chemical": "Chemical contamination (e.g., pesticides, heavy metals, toxins, aflatoxins)"
"foreign bodies": "Physical contaminants such as glass, metal, or plastic fragments"
"fraud": "Adulteration, mislabelling, or fraudulent substitution"
"organoleptic aspects": "Abnormal smell, taste, colour, or texture"
"packaging defect": "Faulty or damaged packaging affecting safety"
"food additives and flavourings": "Unauthorised or excessive additives/flavourings"
"migration": "Migration of substances from packaging or contact materials"
"other hazard": "Any hazard not covered by the categories above"
# Subtask 1 (coarse): single product-category label (1 of 22)
- annotation_type: radio
name: product_category
description: "Which product-category is affected? (choose one)"
labels:
- "meat, egg and dairy products"
- "cereals and bakery products"
- "fruits and vegetables"
- "soups, broths, sauces and condiments"
- "prepared dishes and snacks"
- "seafood and fish products"
- "nuts, nut products and seeds"
- "confectionery"
- "fats and oils"
- "cocoa and cocoa preparations, coffee and tea"
- "alcoholic beverages"
- "non-alcoholic beverages"
- "herbs and spices"
- "food additives and flavourings"
- "food contact materials"
- "dietetic foods, food supplements, fortified foods"
- "honey and royal jelly"
- "ices and desserts"
- "sugars and syrups"
- "feed materials"
- "pet feed"
- "other food product / mixed"
# Subtask 2 (fine-grained): highlight the specific hazard and product mentions
- annotation_type: span
name: hazard_product_spans
description: "Highlight the specific hazard and product mentioned in the text."
labels:
- "Hazard"
- "Product"
annotation_instructions: |
You will be shown the title or text of a food-incident report. Your task is to:
1. Read the report carefully.
2. Assign the single best hazard-category (Subtask 1).
3. Assign the single best product-category (Subtask 1).
4. Highlight the specific hazard and product mentions in the text (Subtask 2).
html_layout: |
<div style="padding: 15px; max-width: 800px; margin: auto;">
<div style="background: #fef2f2; border: 1px solid #fecaca; border-radius: 8px; padding: 16px; margin-bottom: 16px;">
<strong style="color: #991b1b;">Food Safety Incident Report:</strong>
<p style="font-size: 16px; line-height: 1.7; margin: 8px 0 0 0;">{{text}}</p>
</div>
</div>
allow_all_users: true
instances_per_annotator: 50
annotation_per_instance: 2
allow_skip: true
skip_reason_required: false
Sample Datasample-data.json
[
{
"id": "foodhaz_001",
"text": "The FDA has issued an urgent recall for frozen spinach products manufactured by GreenLeaf Foods due to potential Listeria monocytogenes contamination. Testing revealed the presence of the pathogen in multiple production lots. Consumers are advised to discard any affected products immediately. The risk to immunocompromised individuals is classified as high."
},
{
"id": "foodhaz_002",
"text": "A batch of organic peanut butter from NutriSpread Inc. was found to contain undeclared milk proteins. This poses a serious risk to individuals with dairy allergies. The company has initiated a voluntary recall of all 16-oz jars with best-by dates between March and June 2025."
}
]
// ... and 8 more itemsGet This Design
Clone or download from the repository
Quick start:
git clone https://github.com/davidjurgens/potato-showcase.git cd potato-showcase/semeval/2025/task09-food-hazard-detection potato start config.yaml
Dataset & paper
Randl et al., SemEval-2025 Task 9: The Food Hazard Detection Challenge, SemEval 2025
Citation (BibTeX)
@inproceedings{randl-etal-2025-semeval,
title = "{S}em{E}val-2025 Task 9: The Food Hazard Detection Challenge",
author = "Randl, Korbinian and Pavlopoulos, John and Henriksson, Aron and Lindgren, Tony and Bakagianni, Juli",
booktitle = "Proceedings of the 19th International Workshop on Semantic Evaluation (SemEval-2025)",
year = "2025",
address = "Vienna, Austria",
pages = "2523--2534",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2025.semeval-1.325/"
}Details
Annotation Types
Domain
Use Cases
Tags
Found an issue or want to improve this design?
Open an IssueRelated Designs
SecureNLP - Malware Report Semantic Extraction
Semantic extraction from cybersecurity (APT malware) reports, following SemEval-2018 Task 8 (SecureNLP) on the MalwareTextDB corpus: classify whether a sentence is relevant to malware actions/capabilities, then tag tokens with the Action / Entity / Modifier labels and assign MAEC attribute categories to Action tokens.
HateXplain - Explainable Hate Speech Detection
Multi-task hate speech annotation with classification (hate/offensive/normal), target community identification, and rationale span highlighting. Based on the HateXplain benchmark (Mathew et al., AAAI 2021) - the first dataset covering classification, target identification, and rationale extraction.
MediTOD Medical Dialogue Annotation
Medical history-taking dialogue annotation based on the MediTOD dataset. Annotators label dialogue acts, identify medical entities (symptoms, conditions, medications, tests), and assess doctor-patient communication quality across multi-turn clinical conversations.