I have a paragraph as below:
para='''Machine learning is a branch of artificial intelligence (AI) and computer science. It focuses on the use of data \
and algorithms to imitate the way that humans learn, gradually improving its accuracy.
Machine learning is an important component of the growing field of data science. Through the use of statistical methods,\
algorithms are trained to make classifications or predictions, uncovering key insights within data mining projects.\
These insights subsequently drive decision making within applications and businesses, ideally impacting key growth metrics.\
As big data continues to expand and grow, the market demand for data scientists will increase, requiring them to assist in the\
identification of the most relevant business questions and subsequently the data to answer them.'''
para
'Machine learning is a branch of artificial intelligence (AI) and computer science. It focuses on the use of data and algorithms to imitate the way that humans learn, gradually improving its accuracy.\n\nMachine learning is an important component of the growing field of data science. Through the use of statistical methods,algorithms are trained to make classifications or predictions, uncovering key insights within data mining projects.These insights subsequently drive decision making within applications and businesses, ideally impacting key growth metrics.As big data continues to expand and grow, the market demand for data scientists will increase, requiring them to assist in theidentification of the most relevant business questions and subsequently the data to answer them.'
I am trying to segment the two paragraphs as below:
from nltk.tokenize.punkt import PunktSentenceTokenizer, PunktLanguageVars
class BulletPointLangVars(PunktLanguageVars):
sent_end_chars = ('\n\n')
tokenizer = PunktSentenceTokenizer(lang_vars = BulletPointLangVars())
para_split=tokenizer.tokenize(para)
print(para_split)
['Machine learning is a branch of artificial intelligence (AI) and computer science. It focuses on the use of data and algorithms to imitate the way that humans learn, gradually improving its accuracy.\n', 'Machine learning is an important component of the growing field of data science. Through the use of statistical methods,algorithms are trained to make classifications or predictions, uncovering key insights within data mining projects.These insights subsequently drive decision making within applications and businesses, ideally impacting key growth metrics.As big data continues to expand and grow, the market demand for data scientists will increase, requiring them to assist in theidentification of the most relevant business questions and subsequently the data to answer them.']
len(para_split)
> 2
I wanted the paragraph to be split only at \n\n (the paragraph boundary).It is correctly splitting at \n\n . I am curious how this can be achieved using spacy?
Thanks.