Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python split string to sentences

import spacy
nlp = spacy.load('en_core_web_sm') # Load the English Model

string1 = "This is the first sentence. This is the second sentence. This is the third sentence."
doc = nlp(string1)

list(doc.sents)
    
 # Output: ["This is the first sentence.", "This is the second sentence.", "This is the third sentence."]
Source by ashutoshtripathi.com #
 
PREVIOUS NEXT
Tagged: #python #split #string #sentences
ADD COMMENT
Topic
Name
7+2 =