code: def test_naive_entity_linking(self):
      text = "There was a lot of Dipalmitoylphosphatidylcholine."
      doc = self.nlp(text)
  
      # Check that the linker returns nothing if we set the filter_for_definitions flag
      # and set the threshold very high for entities without definitions.
      self.linker.filter_for_definitions = True
      self.linker.no_definition_threshold = 3.0
      doc = self.linker(doc)
      assert doc.ents[0]._.kb_ents == []
  
      # Check that the linker returns only high confidence entities if we
      # set the threshold to something more reasonable.
      self.linker.no_definition_threshold = 0.95
      doc = self.linker(doc)
      assert doc.ents[0]._.kb_ents == [("C0000039", 1.0)]
  
      self.linker.filter_for_definitions = False
      self.linker.threshold = 0.45
      doc = self.linker(doc)
      # Without the filter_for_definitions filter, we get 2 entities for
      # the first mention.
      assert len(doc.ents[0]._.kb_ents) == 2
  
      id_with_score = doc.ents[0]._.kb_ents[0]
      assert id_with_score == ("C0000039", 1.0)
      umls_entity = self.linker.kb.cui_to_entity[id_with_score[0]]
      assert umls_entity.concept_id == "C0000039"
      assert umls_entity.types == ["T109", "T121"]
  
file_path: scispacy/tests/test_linking.py
imports: import unittest
  import tempfile
  import spacy
  from scispacy.candidate_generation import CandidateGenerator, create_tfidf_ann_index
  from scispacy.linking import EntityLinker
  from scispacy.umls_utils import UmlsKnowledgeBase
  from scispacy.abbreviation import AbbreviationDetector
label_desc: Use image node_id 2 for calling the TestLinker obj's underlying member method code with example usage: obj.test_naive_entity_linking() without return types