Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
nltk.download('punkt')
nested_sent_token = [nltk.sent_tokenize(lst) for lst in empty_lst]
# flatten list, len: 3241
flat_sent_token = [item for sublist in nested_sent_token for item in sublist]
print("Flatten sentence token: ", len(flat_sent_token))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment