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 fuzzy fit relation
  
  Args:
      mention_x: MentionDataLight
      mention_y: MentionDataLight
  
  Returns:
      RelationType.FUZZY_FIT or RelationType.NO_RELATION_FOUND
docstr_tok: ["Check","if","input","mentions","has","fuzzy","fit","relation","Args",":","mention_x",":","MentionDataLight","mention_y",":","MentionDataLight","Returns",":","RelationType.FUZZY_FIT","or","RelationType.NO_RELATION_FOUND"]
code: def extract_fuzzy_fit(
      mention_x: MentionDataLight, mention_y: MentionDataLight
  ) -> RelationType:
      """
      Check if input mentions has fuzzy fit relation
  
      Args:
          mention_x: MentionDataLight
          mention_y: MentionDataLight
  
      Returns:
          RelationType.FUZZY_FIT or RelationType.NO_RELATION_FOUND
      """
      try:
          from num2words import num2words
      except (AttributeError, ImportError):
          logger.error(
              "num2words is not installed, please install nlp_architect with [all] package. "
              + "for example: pip install nlp_architect[all]"
          )
          sys.exit()
  
      relation = RelationType.NO_RELATION_FOUND
      mention1_str = mention_x.tokens_str
      mention2_str = mention_y.tokens_str
      if (
          difflib.SequenceMatcher(
              None, mention1_str, mention2_str
          ).ratio()
          * 100
          >= 90
      ):
          relation = RelationType.FUZZY_FIT
          return relation
  
      # Convert numbers to words
      x_words = [
          num2words(int(w)).replace("-", " ") if w.isdigit() else w
          for w in mention1_str.split()
      ]
      y_words = [
          num2words(int(w)).replace("-", " ") if w.isdigit() else w
          for w in mention2_str.split()
      ]
  
      fuzzy_result = (
          difflib.SequenceMatcher(
              None, " ".join(x_words), " ".join(y_words)
          ).ratio()
          * 100
          >= 85
      )
      if fuzzy_result:
          relation = RelationType.FUZZY_FIT
      return relation
  
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 5 for calling the ComputedRelationExtraction obj's underlying member method code with example usage: obj.extract_fuzzy_fit(mention_x, mention_y) and returns: relation, relation