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:
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."
# Print named entities
for word in text1.ents:
The Indian Space Research Organisation ORG
the national space agency ORG
Department of Space 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.