@dipanjanS @valhalla I think it should be sent = [sentence] instead of sent = [].
Whenever a chunk is ready the current sentence is skipped right now.
Maybe this is the fix:
        if length < 1024:
            sentences.append(sentence)
        else:
            nested.append(sentences)
            sentences = [ sentence ]
            length = len(sentence)