class_docstr: Model wrapper for coreference resolution.
class_docstr_tok: ["Model","wrapper","for","coreference","resolution","."]
code: def get_mapping_to_input_sequence(self, output_ids):
      # Get the mapping from the output with special tokens
      # to the input without special tokens.
      mapping, new_id = [], -1
      for i in range(len(output_ids)):
          if output_ids[i] == self.mention_start_id:
              new_id += 1
          elif output_ids[i] == self.mention_end_id:
              new_id += 0
          else:
              new_id += 1
          mapping.append(new_id)
          if output_ids[i] == self.mention_start_id:
              new_id -= 1
  
      return mapping
  
file_path: DeepKE/src/deepke/triple_extraction/ASP/models/model_coref.py
imports: import sys
  import os
  import torch
  import torch.nn
  import logging
  from transformers import T5Tokenizer
  from .t5_coref import T5Coref
label_desc: Use image node_id 6 for calling the CorefModel obj's underlying member method code with example usage: obj.get_mapping_to_input_sequence(output_ids) and returns: mapping