class_docstr: Question Answering Jax model based on TyDiQA Dataset.
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
      # Question starts after the [CLS] token
      slicer_question = slice(1, split_point)
      # Context ends before the last [SEP] token
      slicer_context = slice(split_point + 1, len(tokens) - 1)
      return slicer_question, slicer_context
  
file_path: lit/lit_nlp/examples/models/tydi.py
imports: from collections.abc import Iterable
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.examples.datasets import question_answering
  import numpy
  import transformers
label_desc: Use image node_id 2 for calling the TyDiModel obj's underlying member method code with example usage: obj._segment_slicers(tokens) and returns: slicer_question,  slicer_context