code: def _doc_to_feature_representation(self, doc) -> Dict:
      offset_tokens = {}
      for sent in doc.sents:
          sent_features = sent  # self._sent_to_token_features(sent)
          for ngram_size in self.ngram_sizes:
              if len(sent_features) >= ngram_size:
                  for ngram in sequence_window(
                      sent_features, ngram_size
                  ):
                      if not self.exclude_ngram_filter(ngram):
                          self._add_ngram_to_token_stats(
                              ngram, offset_tokens
                          )
      return offset_tokens
  
imports: from typing import List, Tuple, Union, Optional, Callable, Dict
  from collections import deque
  from scattertext.features.FeatsFromSpacyDoc import FeatsFromSpacyDoc
  from scattertext.features.featoffsets.feat_and_offset_getter import FeatAndOffsetGetter
  from scattertext.Common import MY_ENGLISH_STOP_WORDS
label_desc: Use image node_id 2 for calling the FlexibleNGramFeaturesBase obj's underlying member method code with example usage: obj._doc_to_feature_representation(doc) and returns: offset_tokens