code: def compute_token_type_ids(batch, separator_token_id):
      """Segment embeddings as described in [1]
      The values {0,1} were found in the repository [2].
      Attributes:
          batch: torch.Tensor, size [batch_size, block_size]
              Batch of input.
          separator_token_id: int
              The value of the token that separates the segments.
      [1] Liu, Yang, and Mirella Lapata. "Text summarization with pretrained encoders."
          arXiv preprint arXiv:1908.08345 (2019).
      [2] https://github.com/nlpyang/PreSumm (/src/prepro/data_builder.py, commit fac1217)
      """
      batch_embeddings = []
      for sequence in batch:
          sentence_num = -1
          embeddings = []
          for s in sequence:
              if s == separator_token_id:
                  sentence_num += 1
              embeddings.append(sentence_num % 2)
          batch_embeddings.append(embeddings)
      return torch.tensor(batch_embeddings)
  
imports: import re
  import html
  import logging
  import pandas
  import os
  import random
  import torch
  from pathlib import Path
  import pickle
  import shutil
  from collections import deque, namedtuple
  from torch.utils.data import Dataset, DataLoader, SequentialSampler
  from tokenizers import BertWordPieceTokenizer
  from transformers import BertTokenizer
label_desc: Use image node_id 8 for calling a global function with example usage: compute_token_type_ids(batch, separator_token_id) and returns: torch