class_docstr: A class representing two commonly needed views of a Knowledge Base:
  1. A mapping from concept_id to an Entity NamedTuple with more information.
  2. A mapping from aliases to the sets of concept ids for which they are aliases.
  
  Parameters
  ----------
  file_path: str, required.
      The file path to the json/jsonl representation of the KB to load.
code: def __init__(
      self,
      file_path: Optional[str] = None,
  ):
      if file_path is None:
          raise ValueError(
              "Do not use the default arguments to KnowledgeBase. "
              "Instead, use a subclass (e.g UmlsKnowledgeBase) or pass a path to a kb."
          )
      if file_path.endswith("jsonl"):
          raw = (
              json.loads(line) for line in open(cached_path(file_path))
          )
      else:
          raw = json.load(open(cached_path(file_path)))
  
      alias_to_cuis: Dict[str, Set[str]] = defaultdict(set)
      self.cui_to_entity: Dict[str, Entity] = {}
  
      for concept in raw:
          unique_aliases = set(concept["aliases"])
          unique_aliases.add(concept["canonical_name"])
          for alias in unique_aliases:
              alias_to_cuis[alias].add(concept["concept_id"])
          self.cui_to_entity[concept["concept_id"]] = Entity(**concept)
  
      self.alias_to_cuis: Dict[str, Set[str]] = {**alias_to_cuis}
  
imports: from typing import List, Dict, NamedTuple, Optional, Set
  import json
  from collections import defaultdict
  from scispacy.file_cache import cached_path
  from scispacy.umls_semantic_type_tree import UmlsSemanticTypeTree, construct_umls_tree_from_tsv
label_desc: Use image node_id 1 to create a new KnowledgeBase object  with example: obj = KnowledgeBase(file_path)