I have used named entity recognition using spacy on a newspaper report and added the output in a pandas dataframe column. This is what I've got:
[('Madaripur', 'GPE'), ('Sadar', 'GPE'), ('Madaripur', 'GPE'),
('Wednesday', 'DATE'), ('Rozina Parveen', 'PERSON'), ('55', 'DATE'),
('Jalal Ahmed', 'PERSON'), ('Barguna', 'GPE'), ('Mahfuzur Rahman', 'PERSON'),
('Rozina', 'PERSON'), ('Mostafapur Bridge', 'FAC'), ('Dhaka', 'GPE'),
('around 12:30 pm', 'TIME'), ('Rozina', 'PERSON'), ('Mahfuzur', 'PERSON'),
('Madaripur Sadar Hospital', 'FAC'), ('Madaripur Sadar Police Station', 'ORG'),
('Rezaul Karim', 'PERSON')]
Which looks like formatted as a list of tuples of strings, but seems like the whole thing is actually of datatype str
. I want to convert this to a list
of tuple
s of strings like the way it looks and iterate through the names and entities. How can I do that?