code: def split_docs(
      docs, ssplit_pipe, max_len=140, max_word_len=50, chunk_size=2000
  ):
      """
      Using the ssplit pipeline, break up the documents into sentences
  
      Filters out sentences which are too long or have words too long.
  
      This step is necessary because some web text has unstructured
      sentences which overwhelm the tagger, or even text with no
      whitespace which breaks the charlm in the tokenizer or tagger
      """
      raw_sentences = 0
      filtered_sentences = 0
      new_docs = []
  
      logger.info("Splitting raw docs into sentences: %d", len(docs))
      for chunk_start in tqdm(range(0, len(docs), chunk_size)):
          chunk = docs[chunk_start : chunk_start + chunk_size]
          chunk = [stanza.Document([], text=t) for t in chunk]
          chunk = ssplit_pipe(chunk)
          sentences = [s for d in chunk for s in d.sentences]
          raw_sentences += len(sentences)
          sentences = [s for s in sentences if len(s.words) < max_len]
          sentences = [
              s
              for s in sentences
              if max(len(w.text) for w in s.words) < max_word_len
          ]
          filtered_sentences += len(sentences)
          new_docs.extend([s.text for s in sentences])
  
      logger.info("Split sentences: %d", raw_sentences)
      logger.info(
          "Sentences filtered for length: %d", filtered_sentences
      )
      return new_docs
  
file_path: stanza/stanza/utils/datasets/constituency/selftrain.py
imports: import logging
  import os
  import random
  import re
  import stanza
  from stanza.models.common import utils
  from stanza.models.common.bert_embedding import TextTooLongError
  from stanza.utils.get_tqdm import get_tqdm
label_desc: Use image node_id 6 for calling a global function with example usage: split_docs(docs, ssplit_pipe, max_len, max_word_len, chunk_size) and returns: new_docs