docstr: Extract Relation between two mentions according to Referent Dictionary knowledge
  
  Args:
      method (optional): OnlineOROfflineMethod.{ONLINE/OFFLINE} run against full referent
          dictionary or a sub-set of (default = ONLINE)
      ref_dict (required): str Location of referent dictionary file to work with
docstr_tok: ["Extract","Relation","between","two","mentions","according","to","Referent","Dictionary","knowledge","Args",":","method","(","optional",")",":","OnlineOROfflineMethod",".","{","ONLINE\/OFFLINE","}","run","against","full","referent","dictionary","or","a","sub-set","of","(","default","=","ONLINE",")","ref_dict","(","required",")",":","str","Location","of","referent","dictionary","file","to","work","with"]
code: def __init__(
      self,
      method: OnlineOROfflineMethod = OnlineOROfflineMethod.ONLINE,
      ref_dict: str = None,
  ):
      """
      Extract Relation between two mentions according to Referent Dictionary knowledge
  
      Args:
          method (optional): OnlineOROfflineMethod.{ONLINE/OFFLINE} run against full referent
              dictionary or a sub-set of (default = ONLINE)
          ref_dict (required): str Location of referent dictionary file to work with
      """
      logger.info("Loading ReferentDict module")
      if ref_dict is not None and os.path.isfile(ref_dict):
          if method == OnlineOROfflineMethod.OFFLINE:
              self.ref_dict = load_json_file(ref_dict)
          elif method == OnlineOROfflineMethod.ONLINE:
              self.ref_dict = self.load_reference_dict(ref_dict)
          logger.info("ReferentDict module lead successfully")
      else:
          raise FileNotFoundError(
              "Referent Dict file not found or not in path:" + ref_dict
          )
  
      super(ReferentDictRelationExtraction, self).__init__()
  
file_path: nlp-architect/nlp_architect/data/cdc_resources/relations/referent_dict_relation_extraction.py
imports: import logging
  import os
  from typing import Dict, List, Set
  from nlp_architect.common.cdc.mention_data import MentionDataLight
  from nlp_architect.data.cdc_resources.relations.relation_extraction import RelationExtraction
  from nlp_architect.data.cdc_resources.relations.relation_types_enums import OnlineOROfflineMethod, RelationType
  from nlp_architect.utils.io import load_json_file
  from nlp_architect.utils.string_utils import StringUtils
label_desc: Use image node_id 1 to create a new ReferentDictRelationExtraction object from inherited base classes: RelationExtraction with example: obj = ReferentDictRelationExtraction(method, ref_dict)