I'm working on a dataset that has text and I want to extract a name in the text. So its tweet_id, text columns and I want to extract name from the tweet text.
text.startswith('This is ') and re.match(r'[A-Z].*', text.split()[2]):
new_names.append(text.split()[2].strip(',').strip('.'))
This is what I used to extract the name after "this is".
I want to extract the name that might be in the middle of the text such as after the words, "name is" and "named", how do i go about doing that?