class_docstr: BERT encoder for pre-tokenized text.
class_docstr_tok: ["BERT","encoder","for","pre-tokenized","text","."]
docstr: Postprocess, modifying output dict in-place.
docstr_tok: ["Postprocess",",","modifying","output","dict","in-place","."]
code: def _postprocess(self, output: dict[str, np.ndarray]):
      """Postprocess, modifying output dict in-place."""
      # Slice to remove padding, omitting initial [CLS] and final [SEP]
      slicer = slice(1, output.pop("ntok") - 1)
      output["wpm_tokens"] = self.tokenizer.convert_ids_to_tokens(
          output.pop("input_ids")[slicer]
      )
      # <float>[num_tokens, emb_dim]
      output["top_layer_embs"] = output["top_layer_embs"][slicer]
      return output
  
file_path: lit/lit_nlp/examples/coref/encoders.py
imports: import os
  from lit_nlp.api import model
  from lit_nlp.api import types
  from lit_nlp.examples.coref import retokenize
  from lit_nlp.examples.models import model_utils
  from lit_nlp.lib import utils
  import numpy
  import tensorflow
  import transformers
label_desc: Use image node_id 3 for calling the BertEncoderWithOffsets obj's underlying member method code with example usage: obj._postprocess(output) and returns: output