class_docstr: GLUE benchmark model, using Keras/TF2 and Huggingface Transformers.
  
  This is a general-purpose classification or regression model. It works for
  one- or two-segment input, and predicts either a multiclass label or
  a regression score. See GlueModelConfig for available options.
  
  This implements the LIT API for inference (e.g. input_spec(), output_spec(),
  and predict()), but also provides a train() method to run fine-tuning.
  
  This is a full-featured implementation, which includes embeddings, attention,
  gradients, as well as support for the different input and output types above.
  For a more minimal example, see ../simple_tf2_demo.py.
class_docstr_tok: ["GLUE","benchmark","model",",","using","Keras\/TF2","and","Huggingface","Transformers",".","This","is","a","general-purpose","classification","or","regression","model",".","It","works","for","one-","or","two-segment","input",",","and","predicts","either","a","multiclass","label","or","a","regression","score",".","See","GlueModelConfig","for","available","options",".","This","implements","the","LIT","API","for","inference","(","e.g",".","input_spec","(",")",",","output_spec","(",")",",","and","predict","(",")",")",",","but","also","provides","a","train","(",")","method","to","run","fine-tuning",".","This","is","a","full-featured","implementation",",","which","includes","embeddings",",","attention",",","gradients",",","as","well","as","support","for","the","different","input","and","output","types","above",".","For","a","more","minimal","example",",","see","..","\/simple_tf2_demo.py","."]
docstr: Slicers along the tokens dimension for each segment.
  
  For tokens ['[CLS]', a0, a1, ..., '[SEP]', b0, b1, ..., '[SEP]'],
  we want to get the slices [a0, a1, ...] and [b0, b1, ...]
  
  Args:
    tokens: <string>[num_tokens], including special tokens
  
  Returns:
    (slicer_a, slicer_b), slice objects
docstr_tok: ["Slicers","along","the","tokens","dimension","for","each","segment",".","For","tokens","[","'","[","CLS","]","'",",","a0",",","a1",",","...",",","'","[","SEP","]","'",",","b0",",","b1",",","...",",","'","[","SEP","]","'","]",",","we","want","to","get","the","slices","[","a0",",","a1",",","...","]","and","[","b0",",","b1",",","...","]","Args",":","tokens",":","<","string",">","[","num_tokens","]",",","including","special","tokens","Returns",":","(","slicer_a",",","slicer_b",")",",","slice","objects"]
code: def _segment_slicers(self, tokens: list[str]):
      """Slicers along the tokens dimension for each segment.
  
      For tokens ['[CLS]', a0, a1, ..., '[SEP]', b0, b1, ..., '[SEP]'],
      we want to get the slices [a0, a1, ...] and [b0, b1, ...]
  
      Args:
        tokens: <string>[num_tokens], including special tokens
  
      Returns:
        (slicer_a, slicer_b), slice objects
      """
      try:
          split_point = tokens.index(self.tokenizer.sep_token)
      except ValueError:
          split_point = len(tokens) - 1
      slicer_a = slice(1, split_point)  # start after [CLS]
      slicer_b = slice(
          split_point + 1, len(tokens) - 1
      )  # end before last [SEP]
      return slicer_a, slicer_b
  
imports: import os
  from collections.abc import Iterable, Sequence
  import re
  import threading
  from typing import Any, Optional
  import attr
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.examples.models import model_utils
  from lit_nlp.lib import file_cache
  from lit_nlp.lib import utils
  import numpy
  import tensorflow
  import transformers
label_desc: Use image node_id 10 for calling the GlueModel obj's underlying member method code with example usage: obj._segment_slicers(tokens) and returns: slicer_a,  slicer_b