class_docstr: Extract Relation between two mentions according to computation and rule based algorithms
class_docstr_tok: ["Extract","Relation","between","two","mentions","according","to","computation","and","rule","based","algorithms"]
docstr: Check if input mentions has same head lemma relation
  
  Args:
      mention_x: MentionDataLight
      mention_y: MentionDataLight
  
  Returns:
      RelationType.SAME_HEAD_LEMMA or RelationType.NO_RELATION_FOUND
docstr_tok: ["Check","if","input","mentions","has","same","head","lemma","relation","Args",":","mention_x",":","MentionDataLight","mention_y",":","MentionDataLight","Returns",":","RelationType.SAME_HEAD_LEMMA","or","RelationType.NO_RELATION_FOUND"]
code: def extract_same_head_lemma(
      mention_x: MentionDataLight, mention_y: MentionDataLight
  ) -> RelationType:
      """
      Check if input mentions has same head lemma relation
  
      Args:
          mention_x: MentionDataLight
          mention_y: MentionDataLight
  
      Returns:
          RelationType.SAME_HEAD_LEMMA or RelationType.NO_RELATION_FOUND
      """
      if (
          StringUtils.is_preposition(mention_x.mention_head_lemma)
          or StringUtils.is_preposition(mention_y.mention_head_lemma)
          or StringUtils.is_determiner(mention_x.mention_head_lemma)
          or StringUtils.is_determiner(mention_y.mention_head_lemma)
      ):
          return RelationType.NO_RELATION_FOUND
      if mention_x.mention_head_lemma == mention_y.mention_head_lemma:
          return RelationType.SAME_HEAD_LEMMA
      return RelationType.NO_RELATION_FOUND
  
file_path: nlp-architect/nlp_architect/data/cdc_resources/relations/computed_relation_extraction.py
imports: import difflib
  import logging
  import sys
  from typing import 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 RelationType
  from nlp_architect.utils.string_utils import StringUtils
label_desc: Use image node_id 3 for calling the ComputedRelationExtraction obj's underlying member method code with example usage: obj.extract_same_head_lemma(mention_x, mention_y) and returns: RelationType, RelationType, RelationType