code: def encode(self, input_ids, attention_mask, entity_pos):
      config = self.config
      if config.transformer_type == "bert":
          start_tokens = [config.cls_token_id]
          end_tokens = [config.sep_token_id]
      elif config.transformer_type == "roberta":
          start_tokens = [config.cls_token_id]
          end_tokens = [config.sep_token_id, config.sep_token_id]
      sequence_output, attention = process_long_input(
          self.bert_model,
          input_ids,
          attention_mask,
          start_tokens,
          end_tokens,
      )
      return sequence_output, attention
  
file_path: DeepKE/src/deepke/relation_extraction/document/model.py
imports: import torch
  import torch.nn
  from opt_einsum import contract
  from .losses import ATLoss
  import torch.nn.functional
  from .module import AttentionUNet
  from .prepro import process_long_input
label_desc: Use image node_id 2 for calling the DocREModel obj's underlying member method code with example usage: obj.encode(input_ids, attention_mask, entity_pos) and returns: sequence_output,  attention