docstr: Performs predicts with the CrossEncoder on the given sentence pairs.
  
  :param sentences: A list of sentence pairs [[Sent1, Sent2], [Sent3, Sent4]]
  :param batch_size: Batch size for encoding
  :param show_progress_bar: Output progress bar
  :param num_workers: Number of workers for tokenization
  :param activation_fct: Activation function applied on the logits output of the CrossEncoder. If None, nn.Sigmoid() will be used if num_labels=1, else nn.Identity
  :param convert_to_numpy: Convert the output to a numpy matrix.
  :param apply_softmax: If there are more than 2 dimensions and apply_softmax=True, applies softmax on the logits output
  :param convert_to_tensor: Convert the output to a tensor.
  :return: Predictions for the passed sentence pairs
docstr_tok: ["Performs","predicts","with","the","CrossEncoder","on","the","given","sentence","pairs",".",":","param","sentences",":","A","list","of","sentence","pairs","[","[","Sent1",",","Sent2","]",",","[","Sent3",",","Sent4","]","]",":","param","batch_size",":","Batch","size","for","encoding",":","param","show_progress_bar",":","Output","progress","bar",":","param","num_workers",":","Number","of","workers","for","tokenization",":","param","activation_fct",":","Activation","function","applied","on","the","logits","output","of","the","CrossEncoder",".","If","None",",","nn.Sigmoid","(",")","will","be","used","if","num_labels=1",",","else","nn.Identity",":","param","convert_to_numpy",":","Convert","the","output","to","a","numpy","matrix",".",":","param","apply_softmax",":","If","there","are","more","than","2","dimensions","and","apply_softmax=True",",","applies","softmax","on","the","logits","output",":","param","convert_to_tensor",":","Convert","the","output","to","a","tensor",".",":","return",":","Predictions","for","the","passed","sentence","pairs"]
code: def predict(
      self,
      sentences: List[List[str]],
      batch_size: int = 32,
      show_progress_bar: bool = None,
      num_workers: int = 0,
      activation_fct=None,
      apply_softmax=False,
      convert_to_numpy: bool = True,
      convert_to_tensor: bool = False,
  ):
      """
      Performs predicts with the CrossEncoder on the given sentence pairs.
  
      :param sentences: A list of sentence pairs [[Sent1, Sent2], [Sent3, Sent4]]
      :param batch_size: Batch size for encoding
      :param show_progress_bar: Output progress bar
      :param num_workers: Number of workers for tokenization
      :param activation_fct: Activation function applied on the logits output of the CrossEncoder. If None, nn.Sigmoid() will be used if num_labels=1, else nn.Identity
      :param convert_to_numpy: Convert the output to a numpy matrix.
      :param apply_softmax: If there are more than 2 dimensions and apply_softmax=True, applies softmax on the logits output
      :param convert_to_tensor: Convert the output to a tensor.
      :return: Predictions for the passed sentence pairs
      """
      input_was_string = False
      if isinstance(
          sentences[0], str
      ):  # Cast an individual sentence to a list with length 1
          sentences = [sentences]
          input_was_string = True
  
      inp_dataloader = DataLoader(
          sentences,
          batch_size=batch_size,
          collate_fn=self.smart_batching_collate_text_only,
          num_workers=num_workers,
          shuffle=False,
      )
  
      if show_progress_bar is None:
          show_progress_bar = (
              logger.getEffectiveLevel() == logging.INFO
              or logger.getEffectiveLevel() == logging.DEBUG
          )
  
      iterator = inp_dataloader
      if show_progress_bar:
          iterator = tqdm(inp_dataloader, desc="Batches")
  
      if activation_fct is None:
          activation_fct = self.default_activation_function
  
      pred_scores = []
      self.model.eval()
      self.model.to(self._target_device)
      with torch.no_grad():
          for features in iterator:
              model_predictions = self.model(
                  **features, return_dict=True
              )
              logits = activation_fct(model_predictions.logits)
  
              if apply_softmax and len(logits[0]) > 1:
                  logits = torch.nn.functional.softmax(logits, dim=1)
              pred_scores.extend(logits)
  
      if self.config.num_labels == 1:
          pred_scores = [score[0] for score in pred_scores]
  
      if convert_to_tensor:
          pred_scores = torch.stack(pred_scores)
      elif convert_to_numpy:
          pred_scores = np.asarray(
              [score.cpu().detach().numpy() for score in pred_scores]
          )
  
      if input_was_string:
          pred_scores = pred_scores[0]
  
      return pred_scores
  
imports: from transformers import AutoModelForSequenceClassification, AutoTokenizer, AutoConfig
  import numpy
  import logging
  import os
  from typing import Dict, Type, Callable, List
  import torch
  from torch import nn
  from torch.optim import Optimizer
  from torch.utils.data import DataLoader
  from tqdm.autonotebook import tqdm, trange
  from ..None import SentenceTransformer, util
  from ..evaluation import SentenceEvaluator
label_desc: Use image node_id 5 for calling the CrossEncoder obj's underlying member method code with example usage: obj.predict(sentences, batch_size, show_progress_bar, num_workers, activation_fct, apply_softmax, convert_to_numpy, convert_to_tensor) and returns: pred_scores