code: def process_example(lines: List[str]) -> MedMentionExample:
      """
      Processes the text lines of a file corresponding to a single MedMention abstract,
      extracts the title, abstract, pubmed id and entities. The lines of the file should
      have the following format:
      PMID | t | Title text
      PMID | a | Abstract text
      PMID TAB StartIndex TAB EndIndex TAB MentionTextSegment TAB SemanticTypeID TAB EntityID
      ...
      """
      pubmed_id, _, title = [
          x.strip() for x in lines[0].split("|", maxsplit=2)
      ]
      _, _, abstract = [
          x.strip() for x in lines[1].split("|", maxsplit=2)
      ]
  
      entities = []
      for entity_line in lines[2:]:
          (
              _,
              start,
              end,
              mention,
              mention_type,
              umls_id,
          ) = entity_line.split("\t")
          mention_type = mention_type.split(",")[0]
          entities.append(
              MedMentionEntity(
                  int(start), int(end), mention, mention_type, umls_id
              )
          )
      return MedMentionExample(
          title, abstract, title + " " + abstract, pubmed_id, entities
      )
  
file_path: scispacy/scispacy/data_util.py
imports: from typing import Optional, NamedTuple, List, Iterator, Dict, Tuple
  import tarfile
  import atexit
  import os
  import shutil
  import tempfile
  from scispacy.file_cache import cached_path
label_desc: Use image node_id 1 for calling a global function with example usage: process_example(lines) and returns: MedMentionExample