docstr: Check if input mentions has derivation relation
  
  Args:
      page_x:WordnetPage
      page_y:WordnetPage
  
  Returns:
      RelationType.WORDNET_DERIVATIONALLY or RelationType.NO_RELATION_FOUND
docstr_tok: ["Check","if","input","mentions","has","derivation","relation","Args",":","page_x",":","WordnetPage","page_y",":","WordnetPage","Returns",":","RelationType.WORDNET_DERIVATIONALLY","or","RelationType.NO_RELATION_FOUND"]
code: def extract_derivation(
      page_x: WordnetPage, page_y: WordnetPage
  ) -> RelationType:
      """
      Check if input mentions has derivation relation
  
      Args:
          page_x:WordnetPage
          page_y:WordnetPage
  
      Returns:
          RelationType.WORDNET_DERIVATIONALLY or RelationType.NO_RELATION_FOUND
      """
      x_head = page_x.head
      x_head_lemma = page_x.head_lemma
      y_head = page_y.head
      y_head_lemma = page_y.head_lemma
  
      x_set = set()
      x_set.update(page_x.head_derivationally)
      x_set.update(page_x.head_lemma_derivationally)
  
      y_set = set()
      y_set.update(page_y.head_derivationally)
      y_set.update(page_y.head_lemma_derivationally)
  
      relation = RelationType.NO_RELATION_FOUND
  
      if (
          y_head in x_set
          or y_head_lemma in x_set
          or x_head in y_set
          or x_head_lemma in y_set
          or len(x_set & y_set) > 0
      ):
          relation = RelationType.WORDNET_DERIVATIONALLY
          # print 'matched by derivation - ' + str(x_head)+ ' , ' + str(y_head)
  
      return relation
  
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 4 for calling the WordnetRelationExtraction obj's underlying member method code with example usage: obj.extract_derivation(page_x, page_y) and returns: relation