>>> from nltk import tokenize >>> p = "Good morning Dr. Adams. The patient is waiting for you in room number 3." >>> tokenize.sent_tokenize(p) ['Good morning Dr. Adams.', 'The patient is waiting for you in room number 3.']
Here is what the above code is Doing:
1. We import the sent_tokenize function from the nltk.tokenize module.
2. We create a variable p that contains a string of two sentences.
3. We call the sent_tokenize function on p and print the result.
The sent_tokenize function uses an instance of PunktSentenceTokenizer from the nltk.tokenize.punkt module,
which is already been trained and thus very well knows to mark the end and beginning of sentence.