class_docstr: Class to split documents into chunks of max_seq_len symbols so that the length will not exceed
  maximal sequence length to feed into BERT
class_docstr_tok: ["Class","to","split","documents","into","chunks","of","max_seq_len","symbols","so","that","the","length","will","not","exceed","maximal","sequence","length","to","feed","into","BERT"]
code: def sanitize(self, text):
      text_len = len(text)
  
      if text_len > 0 and text[text_len - 1] not in {".", "!", "?"}:
          i = text_len - 1
          while text[i] in self.punct_ext and i > 0:
              i -= 1
              if (
                  text[i] in {".", "!", "?"}
                  and text[i - 1].lower() in self.russian_letters
              ) or (
                  i > 1
                  and text[i] in {".", "!", "?"}
                  and text[i - 1] in '"'
                  and text[i - 2].lower() in self.russian_letters
              ):
                  break
  
          text = text[: i + 1]
      text = re.sub(r"\s+", " ", text)
      return text
  
file_path: DeepPavlov/deeppavlov/models/entity_extraction/ner_chunker.py
imports: import re
  from logging import getLogger
  from string import punctuation
  from typing import List, Tuple, Union, Any
  from nltk import sent_tokenize
  from transformers import AutoTokenizer
  from deeppavlov.core.common.registry import register
  from deeppavlov.core.models.component import Component
  from deeppavlov.core.common.chainer import Chainer
  from deeppavlov.models.entity_extraction.entity_detection_parser import EntityDetectionParser
label_desc: Use image node_id 3 for calling the NerChunker obj's underlying member method code with example usage: obj.sanitize(text) and returns: text