# naive_reverse_grouper Split batched samples into individual samples. This operator processes a dataset by splitting each batched sample into individual samples. It also handles and optionally exports batch metadata. - If a sample contains 'batch_meta', it is separated and can be exported to a specified path. - The operator converts the remaining data from a dictionary of lists to a list of dictionaries, effectively unbatching the samples. - If `batch_meta_export_path` is provided, the batch metadata is written to this file in JSON format, one entry per line. - If no samples are present in the dataset, the original dataset is returned. 将批量样本拆分为单个样本。 该算子通过将每个批量样本拆分为单个样本来处理数据集。它还处理并可选地导出批量元数据。 - 如果样本包含 'batch_meta',则将其分离并可以导出到指定路径。 - 该算子将剩余数据从字典列表转换为字典列表,从而取消批量样本。 - 如果提供了 `batch_meta_export_path`,则批量元数据将以 JSON 格式写入此文件,每行一个条目。 - 如果数据集中没有样本,则返回原始数据集。 Type 算子类型: **grouper** Tags 标签: cpu ## 🔧 Parameter Configuration 参数配置 | name 参数名 | type 类型 | default 默认值 | desc 说明 | |--------|------|--------|------| | `batch_meta_export_path` | | `None` | the path to export the batch meta. | | `args` | | `''` | extra args | | `kwargs` | | `''` | extra args | ## 📊 Effect demonstration 效果演示 ### test_one_batched_sample ```python NaiveReverseGrouper() ``` #### 📥 input data 输入数据
["Today is Sunday and it's a happy day!", "Sur la plateforme MT4, plusieurs manières d'accéder à \nces fonctionnalités sont conçues simultanément.", '欢迎来到阿里巴巴!']
Today is Sunday and it's a happy day!
Sur la plateforme MT4, plusieurs manières d'accéder à ces fonctionnalités sont conçues simultanément.
欢迎来到阿里巴巴!