license:apache-2.0 size_categories:n<1K format:parquet modality:text library:datasets library:pandas library:mlcroissant library:polars region:us
---
dataset_info:
  features:
  - name: text
    dtype: string
  - name: label
    dtype: string
  splits:
  - name: train
    num_bytes: 20253
    num_examples: 250
  download_size: 11945
  dataset_size: 20253
configs:
- config_name: default
  data_files:
  - split: train
    path: data/train-*
license: apache-2.0
---

# Food/Not Food Image Caption Dataset

Small dataset of synthetic food and not food image captions.

Text generated using Mistral Chat/Mixtral.

Can be used to train a text classifier on food/not_food image captions as a demo before scaling up to a larger dataset.

See [Colab notebook](https://colab.research.google.com/drive/1fpjeNbmgadzhxVsefryRNPM8mvu1MJiP#scrollTo=UtMQLyTk3J3M) on how dataset was created.
## Example usage

```python
import random
from datasets import load_dataset

# Load dataset
loaded_dataset = load_dataset("arulami/learn_hf_food_not_food_image_captions")

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

# 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: 71
{'text': 'A kabob of grilled vegetables, including zucchini, squash, and onion, perfect for a summer barbecue.', 'label': 'food'}
```