neuralset.events.transforms.utils.chunk_events

neuralset.events.transforms.utils.chunk_events(events: DataFrame, event_type_to_chunk: Literal['Audio', 'Video'], event_type_to_use: str | None = None, min_duration: float | None = None, max_duration: float = inf)[source][source]

Split events into smaller chunks. If event_type_to_use is None, the events are chunked into chunks of max_duration. If event_type_to_use is not None, the events are chunked based on the train/val/test splits of the event_type_to_use, ensuring that each chunk has duration between min_duration and max_duration.