docstr: Format comparison examples as a list of IDs
  
  pairs: Array of text, shape [batch, 2]
docstr_tok: ["Format","comparison","examples","as","a","list","of","IDs","pairs",":","Array","of","text",",","shape","[","batch",",","2","]"]
code: def _text_to_ids(self, pair, pad_token=None):
      """
      Format comparison examples as a list of IDs
  
      pairs: Array of text, shape [batch, 2]
      """
      assert (
          self.config.chunk_long_sequences is False
      ), "Chunk Long Sequences is not compatible with comparison"
      arr_forward = next(super()._text_to_ids(pair))
      reversed_pair = pair[::-1]
      arr_backward = next(super()._text_to_ids(reversed_pair))
      kwargs = arr_forward._asdict()
      kwargs["tokens"] = [arr_forward.tokens, arr_backward.tokens]
      kwargs["token_ids"] = np.stack(
          [arr_forward.token_ids, arr_backward.token_ids], 0
      )
      yield EncodedOutput(**kwargs)
  
imports: import numpy
  import tensorflow
  import copy
  from finetune.errors import FinetuneError
  from finetune.base import BaseModel
  from finetune.target_models.classifier import Classifier, ClassificationPipeline
  from finetune.encoding.input_encoder import EncodedOutput, tokenize_context
label_desc: Use image node_id 2 for calling the ComparisonPipeline obj's underlying member method code with example usage: obj._text_to_ids(pair, pad_token) without return types