docstr: Extract Relation between two mentions according to Word Embedding cosine distance
  
  Args:
      method (required): OnlineOROfflineMethod.{ONLINE/OFFLINE} run against full wordnet or
          a sub-set of it (default = ONLINE)
      wn_file (required on OFFLINE mode): str Location of wordnet subset file to work with
docstr_tok: ["Extract","Relation","between","two","mentions","according","to","Word","Embedding","cosine","distance","Args",":","method","(","required",")",":","OnlineOROfflineMethod",".","{","ONLINE\/OFFLINE","}","run","against","full","wordnet","or","a","sub-set","of","it","(","default","=","ONLINE",")","wn_file","(","required","on","OFFLINE","mode",")",":","str","Location","of","wordnet","subset","file","to","work","with"]
code: def __init__(
      self,
      method: OnlineOROfflineMethod = OnlineOROfflineMethod.ONLINE,
      wn_file: str = None,
  ):
      """
      Extract Relation between two mentions according to Word Embedding cosine distance
  
      Args:
          method (required): OnlineOROfflineMethod.{ONLINE/OFFLINE} run against full wordnet or
              a sub-set of it (default = ONLINE)
          wn_file (required on OFFLINE mode): str Location of wordnet subset file to work with
      """
      logger.info("Loading Wordnet module")
      self.connectivity = method
      if self.connectivity == OnlineOROfflineMethod.ONLINE:
          self.wordnet_impl = WordnetOnline()
      elif self.connectivity == OnlineOROfflineMethod.OFFLINE:
          if wn_file is not None and os.path.isdir(wn_file):
              self.wordnet_impl = WordnetOffline(wn_file)
          else:
              raise FileNotFoundError(
                  "WordNet resource directory not found or not in path"
              )
  
      logger.info("Wordnet module lead successfully")
      super(WordnetRelationExtraction, self).__init__()
  
file_path: nlp-architect/nlp_architect/data/cdc_resources/relations/wordnet_relation_extraction.py
imports: import logging
  import os
  from typing import Set, List
  from nlp_architect.common.cdc.mention_data import MentionDataLight
  from nlp_architect.data.cdc_resources.data_types.wn.wordnet_page import WordnetPage
  from nlp_architect.data.cdc_resources.relations.relation_extraction import RelationExtraction
  from nlp_architect.data.cdc_resources.relations.relation_types_enums import RelationType, OnlineOROfflineMethod
  from nlp_architect.data.cdc_resources.wordnet.wordnet_offline import WordnetOffline
  from nlp_architect.data.cdc_resources.wordnet.wordnet_online import WordnetOnline
  from nlp_architect.utils.string_utils import StringUtils
label_desc: Use image node_id 1 to create a new WordnetRelationExtraction object from inherited base classes: RelationExtraction with example: obj = WordnetRelationExtraction(method, wn_file)