jessicalamjh/discussion-generation
PMCOA Discussion Generation Dataset A dataset of 627 biomedical papers from PubMed Central Open Access, built for the task of discussion section generation: given a manuscript (with its Discussion section removed) and the full text of its cited papers, generate the Discussion section. Each sample contains: manuscript — the paper with its Discussion section removed relevant_papers — full text of the papers cited in the gold discussion gold_discussion — the ground-truth… See the full description on the dataset page: https://huggingface.co/datasets/jessicalamjh/discussion-generation.
PMCOA Discussion Generation Dataset
A dataset of 627 biomedical papers from PubMed Central Open Access, built for the task of discussion section generation: given a manuscript (with its Discussion section removed) and the full text of its cited papers, generate the Discussion section.
Each sample contains:
manuscript— the paper with its Discussion section removedrelevant_papers— full text of the papers cited in the gold discussiongold_discussion— the ground-truth Discussion section
The canonical schema is defined in `src/discussion_generation/data/schemas.py` and documented in detail in `src/discussion_generation/data/README.md`.
Why some fields are JSON strings
Apache Arrow (which backs HuggingFace datasets) requires every column to have a fixed, uniform schema. Two patterns in the native schema are incompatible with that:
The following fields are serialized to JSON strings before upload:
Additionally, ContentId (tuple[int, ...]) is stored as list[int] because Arrow has no tuple type. This affects gold_discussion_content_id and each element of content_ids_referenced_in_gold_discussion.
All other fields keep their original structure.
Restoring the original structure
Parse JSON strings back and validate with the Sample Pydantic model. Pydantic handles list[int] → tuple[int, ...] coercion for ContentId fields automatically.
import json
from datasets import load_dataset
from discussion_generation.data.schemas import Sample
ds = load_dataset("jessicalamjh/discussion-generation", split="train")
def restore(record: dict) -> Sample:
record = dict(record)
record["manuscript"] = json.loads(record["manuscript"])
record["relevant_papers"] = json.loads(record["relevant_papers"])
record["gold_discussion"] = json.loads(record["gold_discussion"])
return Sample.model_validate(record)
samples: list[Sample] = [restore(r) for r in ds]Or, more simply, via load_schematized_dataset in `src/discussion_generation/utils/data.py`, which does the same thing:
from discussion_generation.utils.data import load_schematized_dataset
samples = load_schematized_dataset("jessicalamjh/discussion-generation", split="train")