Entity detection using DBpedia and Python

Hi, I am a beginner Python developer.

I simply want to extract entities from an input text. But I could not make this work although I tried many DBpedia python wrappers from Github.

Can you please provide a sample python code or forward me to a resource I can learn how to make this work?

Thank you.

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.