def text2sentences(text, labels):
sentence = '<STR_LIT>'<EOL>for i, label in enumerate(labels):<EOL><INDENT>if label == '<STR_LIT:1>':<EOL><INDENT>if sentence:<EOL><INDENT>yield sentence<EOL><DEDENT>sentence = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>sentence += text[i]<EOL><DEDENT><DEDENT>if sentence:<EOL><INDENT>yield sentence<EOL><DEDENT>
Splits given text at predicted positions from `labels`