code: def segment(
      self, doc: spacy.tokens.doc.Doc
  ) -> Iterable[spacy.tokens.span.Span]:
      sent_interval_index = pd.IntervalIndex.from_tuples(
          [(s[0].idx, s[0].idx + len(str(s))) for s in doc.sents]
      )
  
      subtokens = self.tokenizer(str(doc), return_offsets_mapping=True)
  
      subtoken_offset_df = (
          pd.DataFrame(
              subtokens["offset_mapping"],
              columns=["SubStart", "SubEnd"],
          )
          .assign(
              InputId=subtokens["input_ids"],
              SentenceId=lambda df: (
                  sent_interval_index.get_indexer(df.SubStart)
                  + sent_interval_index.get_indexer(df.SubEnd)
              )
              / 2,
          )[lambda df: (df.SubStart < df.SubEnd) & (df.SentenceId > -1)]
          .assign(Count=lambda df: np.arange(len(df)) + 1)
      )
  
      segment_df = self.__segments_from_subtoken_offsets(
          subtoken_offset_df
      )
  
      sents = list(doc.sents)
      for _, row in segment_df.iterrows():
          start_i = sents[row.SentenceId[0]][0].i
          end_i = sents[row.SentenceId[-1]][-1].i + 1
          yield doc[start_i:end_i]
  
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 2 for calling the SubwordSensitiveSentenceBoundedSplitter obj's underlying member method code with example usage: obj.segment(doc) without return types