# AUTOGENERATED! DO NOT EDIT! File to edit: ../../../nbs/ml.kg.dataset.ipynb.

# %% auto 0
__all__ = ['batch_transform_webnlg']

# %% ../../../nbs/ml.kg.dataset.ipynb 3
def _batch_transform_webnlg(examples):
    for lex, mts in zip(examples['lex'], examples['modified_triple_sets']):
        for text in lex['text']:
            yield dict(text=text, triplets=mts['mtriple_set'][0])

def batch_transform_webnlg(examples):
    records = list(_batch_transform_webnlg(examples))
    return {
        'text': [record['text'] for record in records],
        'triplets': [record['triplets'] for record in records],
    }
