Skip to content
ml-recall

#sentence-segmentation

1 question from NLP Fundamentals

Timed test

1 question · 1 min · score and explanations at the end

Take a test
Q 1 / 1Score 0 / 0

Question 1: Short answer

mediumAI-checkedNLP Fundamentals

A naive sentence splitter breaks the text after every ".", "?" or "!" that is followed by whitespace:

import re
txt = "Dr. Lee paid 3.50 euros for tea. She left at 5 p.m. on Monday. Was it worth it? Yes."
print(len(re.split(r"(?<=[.?!])\s+", txt)))

What does it print? (The text has 4 real sentences.)

a whole number