Find the count of predicted categories.

Thanks @ipazin. However, what would be the criteria to concatenate the extracted sentences into their original paragraph? Means, I have column of extracted sentences which I extracted from some paragraphs, now what would be the criteria to join them back into their original paragraphs?