code: def __segments_from_subtoken_offsets(
      self, subtoken_offset_df: pd.DataFrame
  ) -> pd.DataFrame:
      return (
          subtoken_offset_df[
              lambda df: df.SentenceId == df.SentenceId.apply(int)
          ]
          .groupby("SentenceId")
          .apply(
              lambda gdf: pd.Series(
                  {
                      "Length": len(gdf),
                      "Start": gdf.SubStart.min(),
                      "End": gdf.SubEnd.max(),
                      "InputId": gdf.InputId.values,
                  }
              )
          )
          .reset_index()
          .assign(
              Segment=lambda df: self.__sentence_segments_from_subtokens(
                  df
              )
          )
          .groupby("Segment")
          .agg(
              {
                  "Start": "min",
                  "End": "max",
                  "SentenceId": lambda x: list(
                      int(x) for x in sorted(x)
                  ),
                  "InputId": np.hstack,
              }
          )
      )
  
file_path: scattertext/scattertext/contextual_embeddings/doc_splitter.py
imports: from typing import Iterable, Callable
  import numpy
  import pandas
  import spacy
label_desc: Use image node_id 3 for calling the SubwordSensitiveSentenceBoundedSplitter obj's underlying member method code with example usage: obj.__segments_from_subtoken_offsets(subtoken_offset_df) and returns: subtoken_offset_df