CoolFace
Datasetpublic

tyan001/if_food_or_not_food

Food/Not Food Sentence Classification Dataset Small dataset of 130 sentences labelled food or not_food. 30 of the not_food sentences are adversarial: they use food words idiomatically or in a non-food context (e.g. "He's the big cheese around the office", "The bakery on Fifth Street shut down after a rent increase") so the sentence sounds food-related on the surface even though it isn't actually about eating or cooking. These exist to test whether a classifier is keying on… See the full description on the dataset page: https://huggingface.co/datasets/tyan001/if_food_or_not_food.

sourceHugging Faceapache-2.0updated 1mo agoView on Hugging Face
0likes36downloads
Dataset Card

Food/Not Food Sentence Classification Dataset

Small dataset of 130 sentences labelled food or not_food.

30 of the not_food sentences are adversarial: they use food words idiomatically or in a non-food context (e.g. "He's the big cheese around the office", "The bakery on Fifth Street shut down after a rent increase") so the sentence sounds food-related on the surface even though it isn't actually about eating or cooking. These exist to test whether a classifier is keying on surface food vocabulary rather than actual food meaning.

Built while following the Hugging Face text classification course from Zero to Mastery, where the task is to predict whether a sentence is about food or not.

It is a held-out evaluation set: the sentences here were written by hand to sanity-check a DistilBERT classifier fine-tuned on `mrdbourke/learn_hf_food_not_food_image_captions`. Unlike that training set, which is made of image captions, these are everyday sentences — recipe notes, cooking descriptions, news headlines, office chatter — so they test whether the model generalises past caption-style text.

All samples are in the train split.

Dataset structure

ColumnTypeDescription
sentencestringAn English sentence, food related or not.
labelstringEither food or not_food.

Label distribution

LabelCount
food50
not_food80

Example usage

python
import random
from datasets import load_dataset

# Load dataset
loaded_dataset = load_dataset("tyan001/if_food_or_not_food")

# Get random index
rand_idx = random.randint(0, len(loaded_dataset["train"]) - 1)

# All samples are in the 'train' split by default (unless otherwise stated)
random_sample = loaded_dataset["train"][rand_idx]

print(f"Showing sample: {rand_idx}\n{random_sample}")
>>> Showing sample: 0
{'sentence': 'The curry had a rich blend of turmeric and cumin.', 'label': 'food'}