class_docstr: A modified wrapper for a public python BPE tokenizer. The modifications allow encoding directly into the formats
  required for finetune. Particularly with respect to formatting with multiple inputs.
class_docstr_tok: ["A","modified","wrapper","for","a","public","python","BPE","tokenizer",".","The","modifications","allow","encoding","directly","into","the","formats","required","for","finetune",".","Particularly","with","respect","to","formatting","with","multiple","inputs","."]
docstr: Convert a batch of raw text to a batch of byte-pair encoded token indices.
docstr_tok: ["Convert","a","batch","of","raw","text","to","a","batch","of","byte-pair","encoded","token","indices","."]
code: def _encode(self, texts):
      """
      Convert a batch of raw text to a batch of byte-pair encoded token indices.
      """
      batch_tokens = []
      batch_token_idxs = []
      batch_char_ends = []
      batch_char_starts = []
      for i, text in enumerate(texts):
          subtokens, token_starts, token_ends = self.tokenizer.tokenize(
              text
          )
          subtoken_idxs = self.tokenizer.convert_tokens_to_ids(
              subtokens
          )
  
          batch_tokens.append(subtokens)
          batch_token_idxs.append(subtoken_idxs)
          batch_char_ends.append(token_ends)
          batch_char_starts.append(token_starts)
  
      return EncodedOutput(
          token_ids=batch_token_idxs,
          tokens=batch_tokens,
          token_ends=batch_char_ends,
          token_starts=batch_char_starts,
      )
  
imports: import os
  import numpy
  import finetune
  from finetune.encoding.input_encoder import EncodedOutput, BaseEncoder
  from finetune.base_models.bert.tokenizer import FullTokenizer
label_desc: Use image node_id 4 for calling the BERTEncoder obj's underlying member method code with example usage: obj._encode(texts) and returns: EncodedOutput