The named entity recognition function identifies and labels entities like persons, locations, or organizations in a given text.

Python code:

'''

from tranformers import pipeline

ner = pipeline("ner", grouped_entities=True)
ner("My name is Sylvian and I work at Hugging Face in Brooklyn.")


'''

Output:

'''

[{'entity_group': 'PER', 'score': 0.99816, 'word': 'Sylvain', 'start': 11, 'end': 18}, 
 {'entity_group': 'ORG', 'score': 0.97960, 'word': 'Hugging Face', 'start': 33, 'end': 45}, 
 {'entity_group': 'LOC', 'score': 0.99321, 'word': 'Brooklyn', 'start': 49, 'end': 57}
]

'''