docstr: Args:
      mention_line: a Json representation of a single mention
  
  Returns:
      MentionData object
docstr_tok: ["Args",":","mention_line",":","a","Json","representation","of","a","single","mention","Returns",":","MentionData","object"]
code: def read_json_mention_data_line(mention_line: str):
      """
      Args:
          mention_line: a Json representation of a single mention
  
      Returns:
          MentionData object
      """
      # pylint: disable=too-many-branches
  
      try:
          topic_id = None
          coref_chain = None
          doc_id = None
          sent_id = None
          tokens_numbers = None
          score = -1
          mention_type = None
          predicted_coref_chain = None
          mention_context = None
          is_continue = False
          is_singleton = False
          mention_pos = None
          mention_ner = None
          mention_index = -1
  
          mention_text = mention_line["tokens_str"]
  
          if "topic_id" in mention_line:
              topic_id = mention_line["topic_id"]
  
          if "coref_chain" in mention_line:
              coref_chain = mention_line["coref_chain"]
  
          if "doc_id" in mention_line:
              doc_id = mention_line["doc_id"]
              if ".xml" not in doc_id:
                  doc_id = doc_id + ".xml"
  
          if "sent_id" in mention_line:
              sent_id = mention_line["sent_id"]
  
          if "tokens_number" in mention_line:
              tokens_numbers = mention_line["tokens_number"]
  
          if "mention_context" in mention_line:
              mention_context = mention_line["mention_context"]
  
          if (
              "mention_head" in mention_line
              and "mention_head_lemma" in mention_line
          ):
              mention_head = mention_line["mention_head"]
              mention_head_lemma = mention_line["mention_head_lemma"]
              if "mention_head_pos" in mention_line:
                  mention_pos = mention_line["mention_head_pos"]
              if "mention_ner" in mention_line:
                  mention_ner = mention_line["mention_ner"]
          else:
              (
                  mention_head,
                  mention_head_lemma,
                  mention_pos,
                  mention_ner,
              ) = StringUtils.find_head_lemma_pos_ner(str(mention_text))
  
          if "mention_type" in mention_line:
              mention_type = mention_line["mention_type"]
          if "score" in mention_line:
              score = mention_line["score"]
  
          if "is_continuous" in mention_line:
              is_continue = mention_line["is_continuous"]
  
          if "is_singleton" in mention_line:
              is_singleton = mention_line["is_singleton"]
  
          if "predicted_coref_chain" in mention_line:
              predicted_coref_chain = mention_line[
                  "predicted_coref_chain"
              ]
  
          if "mention_index" in mention_line:
              mention_index = mention_line["mention_index"]
  
          mention_data = MentionData(
              topic_id,
              doc_id,
              sent_id,
              tokens_numbers,
              mention_text,
              mention_context,
              mention_head,
              mention_head_lemma,
              coref_chain,
              mention_type,
              is_continue,
              is_singleton,
              score,
              predicted_coref_chain,
              mention_pos,
              mention_ner,
              mention_index,
          )
      except Exception:
          print("Unexpected error:", sys.exc_info()[0])
          raise Exception(
              "failed reading json line-" + str(mention_line)
          )
  
      return mention_data
  
file_path: nlp-architect/nlp_architect/common/cdc/mention_data.py
imports: import sys
  from typing import List
  from nlp_architect.utils.io import load_json_file
  from nlp_architect.utils.string_utils import StringUtils
label_desc: Use image node_id 2 for calling the MentionData obj's underlying member method code with example usage: obj.read_json_mention_data_line(mention_line) and returns: mention_data