I am using the sentencizer from spacy to split the document into sentences. The default delimiters in sentencizer is (' . ' , ' ! ' , ' ? ' ). But if i gave a sentence like:
"A fawn was racing in the forest!He was ahead of the rabbit?He was ahead of the elephant."
Its not splitting into 3 sentences.
I tried this :
sen = "A fawn was racing in the forest!He was ahead of the rabbit?He
was ahead of the elephant."
nlp = spacy.load('en')
nlp.add_pipe(nlp.create_pipe('sentencizer'), first=True)
doc = nlp(sen)
sentences = [sent.string.strip() for sent in doc.sents]
But it's not splitting in the !, ?.
The expected output for the input:
"A fawn was racing in the forest!He was ahead of the rabbit?He was ahead of the elephant."
"A fawn was racing in the forest!"
"He was ahead of the rabbit?"
"He was ahead of the elephant."
Can anyone help for this.
Thanks in advance.