transformer_rankers.utils.utils.acumulate_list_multiple_relevant

transformer_rankers.utils.utils.acumulate_list_multiple_relevant(l: List[float]) → List[List[float]][source]

Splits a list that has variable number of labels 1 first followed by N 0.

Parameters

l – List of floats

Returns: List of list of floats divided every set of 1s followed by 0s. Example: [1,1,1,0,0,1,0,0,1,1,0,0] –> [[1,1,1,0,0], [1,0,0], [1,1,0,0]]