Skip to content

Properties from DBPedia ontology

BabelPyEntityLinking(field_to_link, api_key=None, lang='EN')

Bases: EntityLinking

Exogenous technique which expands each content by using as external source the the BabelFy library.

Each content will be expanded with the following babelfy properties (if available):

  • 'babelSynsetID',
  • 'DBPediaURL',
  • 'BabelNetURL',
  • 'score',
  • 'coherenceScore',
  • 'globalScore',
  • 'source'
PARAMETER DESCRIPTION
field_to_link

Field of the raw source which will be used to search for the content properties in BabelFy

TYPE: str

api_key

String obtained by registering to babelfy website. If None only few queries can be executed

TYPE: str DEFAULT: None

lang

Language of the properties to retrieve

TYPE: str DEFAULT: 'EN'

Source code in clayrs/content_analyzer/exogenous_properties_retrieval.py
625
626
627
628
629
630
def __init__(self, field_to_link: str, api_key: str = None, lang: str = "EN"):
    super().__init__("all_retrieved")  # fixed mode since it doesn't make sense for babelfy
    self.__field_to_link = field_to_link
    self.__api_key = api_key
    self.__lang = lang
    self.__babel_client = BabelfyClient(self.__api_key, {"lang": lang})