code: def dbpedia_spotlight_factory(
      nlp,
      name,
      language_code,
      dbpedia_rest_endpoint,
      process,
      confidence,
      support,
      types,
      sparql,
      policy,
      span_group,
      overwrite_ents,
      raise_http_errors,
      verify_ssl,
      debug,
  ):
      """Factory of the pipeline stage `dbpedia_spotlight`.
      Parameters:
      - `language_code`: which language to use for entity linking. Possible values are listed in EntityLinker.supported_languages. If the parameter is left as None, the language code is matched with the nlp object currently used.
      - `dbpedia_rest_endpoint`: this needs to be configured if you want to use a different REST endpoint from the default `EntityLinker.base_url`. Example: `http://localhost:2222/rest` for a localhost server
      - `process`: (REST API path) which of the processes to use from DBpedia Spotlight (see https://www.dbpedia-spotlight.org/api). The value can be 'annotate', 'spot' or 'candidates'
      - `confidence`: (REST API parameter) confidence score for disambiguation / linking
      - `support`: (REST API parameter) how prominent is this entity in Lucene Model, i.e. number of inlinks in Wikipedia
      - `types`: (REST API parameter) types filter (Eg.DBpedia:Place)
      - `sparql`: (REST API parameter) SPARQL filtering
      - `policy`: (REST API parameter) (whitelist) select all entities that have the same type; (blacklist) - select all entities that have not the same type.
      - `span_group`: which span group to write the entities to. By default the value is `dbpedia_spotlight` which writes to `doc.spans['dbpedia_spotlight']`
      - `overwrite_ents`: if set to False, it won't overwrite `doc.ents` in cases of overlapping spans with current entities, and only produce the results in `doc.spans[span_group]. If it is True, it will move the entities from doc.ents into `doc.spans['ents_original']`
      - `raise_http_errors`: if set to True, it will raise the HTTPErrors generated by the dbpedia REST API. If False instead, HTTPErrors will be ignored. Default to True.
      - `verify_ssl`: if set to False, it will not verify SSL certificates (strongly discouraged). Default to True for verification.
      - `debug`: prints several debug information to stdout
      """
      logger.remove()
      if debug:
          logger.add(sys.stdout, level="DEBUG")
      else:
          logger.add(sys.stdout, level="INFO")
      logger.debug(
          f"dbpedia_spotlight_factory: {nlp}, language_code: {language_code}, dbpedia_rest_endpoint: {dbpedia_rest_endpoint}, "
          f"process: {process}, confidence: {confidence}, support: {support}, types: {types}, "
          f"sparql: {sparql}, policy: {policy}, overwrite_ents: {overwrite_ents}, raise_http_errors: {raise_http_errors}, verify_ssl: {verify_ssl}"
      )
      # take the language code from the nlp object
      nlp_lang_code = nlp.meta["lang"]
      logger.debug(f'nlp.meta["lang"]={nlp_lang_code}')
      # language_code can override the language code from the nlp object
      if not language_code:
          language_code = nlp_lang_code
      return EntityLinker(
          language_code,
          dbpedia_rest_endpoint,
          process,
          confidence,
          support,
          types,
          sparql,
          policy,
          span_group,
          overwrite_ents,
          raise_http_errors,
          verify_ssl,
          debug,
      )
  
file_path: spacy-dbpedia-spotlight/spacy_dbpedia_spotlight/entity_linker.py
imports: import concurrent.futures
  import sys
  import requests
  import spacy
  from multiprocessing.pool import ThreadPool
  from loguru import logger
  from requests import HTTPError
  from spacy import util
  from spacy.language import Language
  from spacy.tokens import Doc, Span
label_desc: Use image node_id 1 for calling a global function with example usage: dbpedia_spotlight_factory(nlp, name, language_code, dbpedia_rest_endpoint, process, confidence, support, types, sparql, policy, span_group, overwrite_ents, raise_http_errors, verify_ssl, debug) and returns: EntityLinker