docstr: Try to find if mentions has anyone or more of the relations this class support
  
  Args:
      mention_x: MentionDataLight
      mention_y: MentionDataLight
  
  Returns:
      Set[RelationType]: One or more of: RelationType.WORDNET_SAME_SYNSET_ENTITY,
          RelationType.WORDNET_SAME_SYNSET_EVENT, RelationType.WORDNET_PARTIAL_SYNSET_MATCH,
          RelationType.WORDNET_DERIVATIONALLY
docstr_tok: ["Try","to","find","if","mentions","has","anyone","or","more","of","the","relations","this","class","support","Args",":","mention_x",":","MentionDataLight","mention_y",":","MentionDataLight","Returns",":","Set","[","RelationType","]",":","One","or","more","of",":","RelationType.WORDNET_SAME_SYNSET_ENTITY",",","RelationType.WORDNET_SAME_SYNSET_EVENT",",","RelationType.WORDNET_PARTIAL_SYNSET_MATCH",",","RelationType.WORDNET_DERIVATIONALLY"]
code: def extract_all_relations(
      self, mention_x: MentionDataLight, mention_y: MentionDataLight
  ) -> Set[RelationType]:
      """
      Try to find if mentions has anyone or more of the relations this class support
  
      Args:
          mention_x: MentionDataLight
          mention_y: MentionDataLight
  
      Returns:
          Set[RelationType]: One or more of: RelationType.WORDNET_SAME_SYNSET_ENTITY,
              RelationType.WORDNET_SAME_SYNSET_EVENT, RelationType.WORDNET_PARTIAL_SYNSET_MATCH,
              RelationType.WORDNET_DERIVATIONALLY
      """
      relations = set()
      mention_x_str = mention_x.tokens_str
      mention_y_str = mention_y.tokens_str
      if StringUtils.is_pronoun(
          mention_x_str.lower()
      ) or StringUtils.is_pronoun(mention_y_str.lower()):
          relations.add(RelationType.NO_RELATION_FOUND)
          return relations
  
      page_x = self.wordnet_impl.get_pages(mention_x)
      page_y = self.wordnet_impl.get_pages(mention_y)
  
      if page_x and page_y:
          deriv_rel = self.extract_derivation(page_x, page_y)
          part_syn_rel = self.extract_partial_synset_match(
              page_x, page_y
          )
          same_syn_rel = self.extract_same_synset_entity(page_x, page_y)
          if deriv_rel != RelationType.NO_RELATION_FOUND:
              relations.add(deriv_rel)
          if part_syn_rel != RelationType.NO_RELATION_FOUND:
              relations.add(part_syn_rel)
          if same_syn_rel != RelationType.NO_RELATION_FOUND:
              relations.add(same_syn_rel)
  
      if len(relations) == 0:
          relations.add(RelationType.NO_RELATION_FOUND)
  
      return relations
  
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 2 for calling the WordnetRelationExtraction obj's underlying member method code with example usage: obj.extract_all_relations(mention_x, mention_y) and returns: relations, relations