Hi,
what exactly is your input? Is it just a text?
This is a very simple example of a named entity extraction using spacy, a robust and sophisticated python library for natural language processing:
import spacy
from spacy import display
# Class for recognising named entities uses
NER = spacy.load("en_core_web_sm")
# Sample text form a Wikipedia article
raw_text="The Indian Space Research Organisation or is the national space agency of India, headquartered in Bengaluru. It operates under Department of Space which is directly overseen by the Prime Minister of India while Chairman of ISRO acts as executive of DOS as well."
text1= NER(raw_text)
# Print named entities
for word in text1.ents:
print(word.text,word.label_)
Output:
The Indian Space Research Organisation ORG
the national space agency ORG
India GPE
Bengaluru GPE
Department of Space ORG
India GPE
ISRO ORG
DOS ORG
The code is from this article. Check it out, I found it quite helpful.
And this may be helpful regarding specy’s trained pipelines.