docstr: Extract Relation between two mentions according to Word Embedding cosine distance
  
  Args:
      method (optional): EmbeddingMethod.{GLOVE/GLOVE_OFFLINE/ELMO/ELMO_OFFLINE}
          (default = GLOVE)
      glove_file (required on GLOVE/GLOVE_OFFLINE mode): str Location of Glove file
      elmo_file (required on ELMO_OFFLINE mode): str Location of Elmo file
docstr_tok: ["Extract","Relation","between","two","mentions","according","to","Word","Embedding","cosine","distance","Args",":","method","(","optional",")",":","EmbeddingMethod",".","{","GLOVE\/GLOVE_OFFLINE\/ELMO\/ELMO_OFFLINE","}","(","default","=","GLOVE",")","glove_file","(","required","on","GLOVE\/GLOVE_OFFLINE","mode",")",":","str","Location","of","Glove","file","elmo_file","(","required","on","ELMO_OFFLINE","mode",")",":","str","Location","of","Elmo","file"]
code: def __init__(
      self,
      method: EmbeddingMethod = EmbeddingMethod.GLOVE,
      glove_file: str = None,
      elmo_file: str = None,
      cos_accepted_dist: float = 0.7,
  ):
      """
      Extract Relation between two mentions according to Word Embedding cosine distance
  
      Args:
          method (optional): EmbeddingMethod.{GLOVE/GLOVE_OFFLINE/ELMO/ELMO_OFFLINE}
              (default = GLOVE)
          glove_file (required on GLOVE/GLOVE_OFFLINE mode): str Location of Glove file
          elmo_file (required on ELMO_OFFLINE mode): str Location of Elmo file
      """
      if method == EmbeddingMethod.GLOVE:
          self.embedding = GloveEmbedding(glove_file)
          self.contextual = False
      elif method == EmbeddingMethod.GLOVE_OFFLINE:
          self.embedding = GloveEmbeddingOffline(glove_file)
          self.contextual = False
      elif method == EmbeddingMethod.ELMO:
          self.embedding = ElmoEmbedding()
          self.contextual = True
      elif method == EmbeddingMethod.ELMO_OFFLINE:
          self.embedding = ElmoEmbeddingOffline(elmo_file)
          self.contextual = True
  
      self.accepted_dist = cos_accepted_dist
      super(WordEmbeddingRelationExtraction, self).__init__()
  
file_path: nlp-architect/nlp_architect/data/cdc_resources/relations/word_embedding_relation_extraction.py
imports: import logging
  import math
  from typing import List, Set
  from scipy.spatial.distance import cosine
  from nlp_architect.common.cdc.mention_data import MentionDataLight
  from nlp_architect.data.cdc_resources.embedding.embed_elmo import ElmoEmbedding, ElmoEmbeddingOffline
  from nlp_architect.data.cdc_resources.embedding.embed_glove import GloveEmbedding, GloveEmbeddingOffline
  from nlp_architect.data.cdc_resources.relations.relation_extraction import RelationExtraction
  from nlp_architect.data.cdc_resources.relations.relation_types_enums import EmbeddingMethod, RelationType
  from nlp_architect.utils.string_utils import StringUtils
label_desc: Use image node_id 1 to create a new WordEmbeddingRelationExtraction object from inherited base classes: RelationExtraction with example: obj = WordEmbeddingRelationExtraction(method, glove_file, elmo_file, cos_accepted_dist)