I wish to perform sentence tokenization for sentence without punctuation, below is the code:
import nltk
def segment_sentences(text):
# Download the Punkt tokenizer if necessary
nltk.download('punkt')
# Tokenize the text into sentences
sentences = nltk.sent_tokenize(text)
return sentences
input_text = "hello how are you today i hope you're doing well have a great day"
sentences = segment_sentences(input_text)
# Print the segmented sentences
for sentence in sentences:
print(sentence)
Desired output
hello how are you today
i hope you're doing well
have a great day
But current output
hello how are you today i hope you're doing well have a great day
How should I address it?