In this article
Exploding a list changes the row unit; preserve parent lineage before treating the resulting rows as training observations or aggregate counts.
Name the observation after expansion
A dataset contains one document per row and a list of extracted entities. After expansion, a report counts rows and calls the number a document count. The cuDF explode reference describes list elements becoming rows with replicated indices. The new row unit is an entity occurrence associated with a parent, not an additional independent document. Define the unit before using the expanded table for training, sampling or coverage statistics.
Preserve a parent key before changing the index
Retain a stable document identifier as an explicit column and preserve a child position if repeated equal elements must remain distinguishable. The cuDF dataframe reference distinguishes table indices and columns. A replicated index may be useful locally, but resetting it should not erase the only connection to the parent. Likewise a repeated entity value is not necessarily a duplicate record: it can represent a different occurrence within the same source document.
Decide what an empty list represents
The pandas explode reference documents empty-list and index behavior in its interface. Use explicit fixtures to establish the intended compatible GPU path rather than assuming an empty collection means the parent should disappear. Separate a known empty entity list from unavailable extraction. Depending on the dataset contract, they can imply different supervision, missingness and parent coverage even if the child-value column is empty or nullable in both cases.
Keep parent weighting separate from child weighting
A document with many entities contributes more expanded rows than a document with few entities. That may be intentional for an entity-level task, but it changes the sampling population for a document-level objective. Preserve the grouping needed to apply a deliberate weighting or split policy. Randomly splitting child rows can also place related children of the same parent in different evaluation partitions. Expansion is a representation operation, not an independent decision about how observations should be weighted or separated.
Reconcile source coverage and child counts
Test a parent with repeated elements, an empty list, an unavailable list and a normal list. Verify parent coverage, child identities and the declared aggregation denominator. The guides on dataset sample identities and nullable feature contracts provide related context. A correct exploded table preserves the meaning of both levels. Its larger row count is useful only when the report explains whether it describes source documents, child occurrences or usable model examples.
Earn rental income from GPUs
Have idle GPUs or looking to fund AI infrastructure? Retrivium finds a rental platform, sets up the server and helps you assess income and costs with a pilot.