I have the following code below that should identify names in a string, but it does not seem to identify all the names.
import spacy
nlp = spacy.load('en_core_web_sm')
text = "Elon Musk 889-888-8888 elonpie@tessa.net Jeff Bezos (345)123-1234 bezzi@zonbi.com Reshma Saujani example.email@email.com 888-888-8888 Barkevious Mingo"
doc = nlp(text)
print([ent for ent in doc.ents if ent.label_ == 'PERSON'])
Output is as follows:
['Elon Musk 889-888-8888', 'Jeff Bezos']
The expected output would be:
['Elon Musk', 'Jeff Bezos', 'Reshma Saujani', 'Barkevious Mingo']
Is there a different package that may be useful, perhaps?