code: def build_hamlet_jz_df():
      # type: () -> pd.DataFrame
      categories, documents = get_docs_categories()
      clean_function = lambda text: "" if text.startswith("[") else text
      df = pd.DataFrame(
          {
              "category": categories,
              "parsed": [
                  whitespace_nlp(clean_function(doc))
                  for doc in documents
              ],
          }
      )
      df = df[df["parsed"].apply(lambda x: len(str(x).strip()) > 0)]
      return df
  
imports: import re
  from unittest import TestCase
  import pandas
  from sklearn.feature_extraction.text import TfidfTransformer
  from sklearn.linear_model import PassiveAggressiveClassifier
  from scattertext import CorpusFromParsedDocuments
  from scattertext import FeatsFromSpacyDoc, FeatsFromSpacyDocAndEmpath
  from scattertext import TermDocMatrixFactory
  from scattertext.TermDocMatrixFactory import FeatsFromDoc
  from scattertext.WhitespaceNLP import whitespace_nlp, Doc, Tok
label_desc: Use image node_id 3 for calling a global function with example usage: build_hamlet_jz_df() and returns: df