Skip to content

Instantly share code, notes, and snippets.

@aniruddha27
Created June 5, 2020 20:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aniruddha27/382059efd7e5884de7bf760b359b13fa to your computer and use it in GitHub Desktop.
Save aniruddha27/382059efd7e5884de7bf760b359b13fa to your computer and use it in GitHub Desktop.
# split sentences
def sentences(text):
# split sentences and questions
text = re.split('[.?]', text)
clean_sent = []
for sent in text:
clean_sent.append(sent)
return clean_sent
# sentences
df['sent'] = df['Speech_clean'].apply(sentences)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment