code: def process_chars(self, sents):
      start_id, end_id = self.vocab["char"].unit2id("\n"), self.vocab[
          "char"
      ].unit2id(
          " "
      )  # special token
      start_offset, end_offset = 1, 1
      (
          chars_forward,
          chars_backward,
          charoffsets_forward,
          charoffsets_backward,
      ) = ([], [], [], [])
      # get char representation for each sentence
      for sent in sents:
          (
              chars_forward_sent,
              chars_backward_sent,
              charoffsets_forward_sent,
              charoffsets_backward_sent,
          ) = ([start_id], [start_id], [], [])
          # forward lm
          for word in sent:
              chars_forward_sent += word
              charoffsets_forward_sent = charoffsets_forward_sent + [
                  len(chars_forward_sent)
              ]  # add each token offset in the last for forward lm
              chars_forward_sent += [end_id]
          # backward lm
          for word in sent[::-1]:
              chars_backward_sent += word[::-1]
              charoffsets_backward_sent = [
                  len(chars_backward_sent)
              ] + charoffsets_backward_sent  # add each offset in the first for backward lm
              chars_backward_sent += [end_id]
          # store each sentence
          chars_forward.append(chars_forward_sent)
          chars_backward.append(chars_backward_sent)
          charoffsets_forward.append(charoffsets_forward_sent)
          charoffsets_backward.append(charoffsets_backward_sent)
      charlens = [
          len(sent) for sent in chars_forward
      ]  # forward lm and backward lm should have the same lengths
      return (
          chars_forward,
          chars_backward,
          charoffsets_forward,
          charoffsets_backward,
          charlens,
      )
  
imports: import random
  import logging
  import torch
  from stanza.models.common.bert_embedding import filter_data
  from stanza.models.common.data import map_to_ids, get_long_tensor, sort_all
  from stanza.models.common.vocab import PAD_ID, VOCAB_PREFIX
  from stanza.models.pos.vocab import CharVocab, CompositeVocab, WordVocab
  from stanza.models.ner.vocab import MultiVocab
  from stanza.models.common.doc import *
  from stanza.models.ner.utils import process_tags, normalize_empty_tags
label_desc: Use image node_id 8 for calling the DataLoader obj's underlying member method code with example usage: obj.process_chars(sents) and returns: chars_forward,  chars_backward,  charoffsets_forward,  charoffsets_backward,  charlens