class_docstr: Class for linking of entity substrings in the document to entities in Wikidata
class_docstr_tok: ["Class","for","linking","of","entity","substrings","in","the","document","to","entities","in","Wikidata"]
code: def process_cand_ent(
      self,
      cand_ent_init,
      entities_and_ids,
      substr_split,
      tag,
      tag_conf,
      use_tags,
  ):
      for (
          title,
          entity_id,
          rels,
          ent_tag,
          page,
          label,
          descr,
      ) in entities_and_ids:
          if (ent_tag == tag and use_tags) or not use_tags:
              substr_score = self.calc_substr_score(
                  title, substr_split, tag, ent_tag, label
              )
              cand_ent_init[entity_id].add(
                  (substr_score, rels, tag_conf, page, label, descr)
              )
      return cand_ent_init
  
imports: import re
  import sqlite3
  from logging import getLogger
  from typing import List, Dict, Tuple, Any, Union
  from collections import defaultdict
  import nltk
  import spacy
  from hdt import HDTDocument
  from nltk.corpus import stopwords
  from rapidfuzz import fuzz
  from deeppavlov.core.commands.utils import expand_path
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.component import Component
  from deeppavlov.core.models.serializable import Serializable
  from deeppavlov.models.entity_extraction.find_word import WordSearcher
label_desc: Use image node_id 9 for calling the EntityLinker obj's underlying member method code with example usage: obj.process_cand_ent(cand_ent_init, entities_and_ids, substr_split, tag, tag_conf, use_tags) and returns: cand_ent_init