CoolFace
Datasetpublic

Tellurio/PubMed-MultiLabel-MeSH

PubMed MultiLabel Text Classification (MeSH) A dataset of 50,000 PubMed biomedical articles, each manually annotated by domain experts with MeSH (Medical Subject Headings) labels. With 21,918 unique labels and a mean of ~12.7 labels per document, this is a densely-labeled extreme multi-label classification benchmark. Dataset Description Property Value Train examples 40,000 Test examples 10,000 Total unique MeSH labels 21,918 Mean labels per… See the full description on the dataset page: https://huggingface.co/datasets/Tellurio/PubMed-MultiLabel-MeSH.

sourceHugging Facecc0-1.0updated 6mo agoView on Hugging Face
0likes58downloads
Dataset Card

PubMed MultiLabel Text Classification (MeSH)

A dataset of 50,000 PubMed biomedical articles, each manually annotated by domain experts with MeSH (Medical Subject Headings) labels. With 21,918 unique labels and a mean of ~12.7 labels per document, this is a densely-labeled extreme multi-label classification benchmark.

Dataset Description

PropertyValue
Train examples40,000
Test examples10,000
Total unique MeSH labels21,918
Mean labels per document~12.7
Median labels per document12
Max labels per document46

Label distribution

Docs per label# Labels% of total
13,99018.2%
2–57,02032.0%
6–103,41215.6%
11–505,51825.2%
51–1001,0684.9%
101+9104.2%

MeSH Root Categories

Each label belongs to one or more MeSH root categories. The dataset includes binary indicator columns for the 14 root categories:

CodeRoot Category
AAnatomy
BOrganisms
CDiseases
DChemicals and Drugs
EAnalytical, Diagnostic and Therapeutic Techniques, and Equipment
FPsychiatry and Psychology
GPhenomena and Processes
HDisciplines and Occupations
IAnthropology, Education, Sociology, and Social Phenomena
JTechnology, Industry, and Agriculture
LInformation Science
MNamed Groups
NHealth Care
ZGeographicals

Fields

FieldTypeDescription
pmidstringPubMed article ID
titlestringArticle title
abstractstringArticle abstract text
label_idslist[int]MeSH label indices (into the 21,918-label vocabulary)
label_nameslist[string]Human-readable MeSH label names
mesh_rootsdictBinary flags {"A": 0/1, ..., "Z": 0/1} for root categories

Additional files

  • `label_vocab.json` — ordered list of all 21,918 MeSH label names (index = label ID)
  • `label_metadata.jsonl` — full label metadata including MeSH tree IDs and root categories for hierarchical classification research

Splits

An 80/20 random split with seed 42 (no predefined split exists in the original data).

Usage

python
from datasets import load_dataset

ds = load_dataset("Tellurio/PubMed-MultiLabel-MeSH")

example = ds["train"][0]
print(example["title"])
print(example["label_names"])  # e.g. ["Humans", "Female", "DNA Probes, HPV", ...]
print(example["label_ids"])    # e.g. [5, 2, 0, ...]
print(example["mesh_roots"])   # e.g. {"A": 0, "B": 1, "C": 1, ...}

Loading label metadata for hierarchical / zero-shot approaches

Each of the 21,918 MeSH labels has associated tree IDs and root categories stored in label_metadata.jsonl.

python
import json
from huggingface_hub import hf_hub_download

path = hf_hub_download(
    repo_id="Tellurio/PubMed-MultiLabel-MeSH",
    filename="label_metadata.jsonl",
    repo_type="dataset",
)

labels = []
with open(path) as f:
    for line in f:
        labels.append(json.loads(line))

# Example label entry
print(labels[0])
# {"id": 0, "label": "DNA Probes, HPV", "mesh_tree_ids": ["D13.444...", ...], "mesh_roots": ["Chemicals and Drugs [D]"]}

Source

Originally from Kaggle: PubMed MultiLabel Text Classification Dataset MeSH by Owais Ahmad.

Citation

bibtex
@misc{pubmed_multilabel_mesh,
  author = {Owais Ahmad},
  title = {PubMed MultiLabel Text Classification Dataset MeSH},
  year = {2022},
  publisher = {Kaggle},
  url = {https://www.kaggle.com/datasets/owaiskhan9654/pubmed-multilabel-text-classification}
}

License

CC0: Public Domain