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 the given relation between them
  
  Args:
      mention_x: MentionDataLight
      mention_y: MentionDataLight
      relation: RelationType
  
  Returns:
      RelationType: relation in case mentions has given relation or
          RelationType.NO_RELATION_FOUND otherwise
docstr_tok: ["Check","if","input","mentions","has","the","given","relation","between","them","Args",":","mention_x",":","MentionDataLight","mention_y",":","MentionDataLight","relation",":","RelationType","Returns",":","RelationType",":","relation","in","case","mentions","has","given","relation","or","RelationType.NO_RELATION_FOUND","otherwise"]
code: def extract_sub_relations(
      self,
      mention_x: MentionDataLight,
      mention_y: MentionDataLight,
      relation: RelationType,
  ) -> RelationType:
      """
      Check if input mentions has the given relation between them
  
      Args:
          mention_x: MentionDataLight
          mention_y: MentionDataLight
          relation: RelationType
  
      Returns:
          RelationType: relation in case mentions has given relation or
              RelationType.NO_RELATION_FOUND otherwise
      """
      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()):
          return RelationType.NO_RELATION_FOUND
  
      if relation == RelationType.EXACT_STRING:
          return self.extract_exact_string(mention_x, mention_y)
      if relation == RelationType.FUZZY_FIT:
          return self.extract_fuzzy_fit(mention_x, mention_y)
      if relation == RelationType.FUZZY_HEAD_FIT:
          return self.extract_fuzzy_head_fit(mention_x, mention_y)
      if relation == RelationType.SAME_HEAD_LEMMA:
          is_same_lemma = self.extract_same_head_lemma(
              mention_x, mention_y
          )
          if is_same_lemma != RelationType.NO_RELATION_FOUND:
              return relation
  
      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 2 for calling the ComputedRelationExtraction obj's underlying member method code with example usage: obj.extract_sub_relations(mention_x, mention_y, relation) and returns: RelationType, RelationType, self, self, self, relation