code: def _extract_doc_data(docs):
      doc_lengths = list(
          docs.apply(lambda d: np.array(d.values()).sum())
      )
      term_freqs_dict = _sum_sarray_dicts(docs)
  
      vocab = term_freqs_dict.keys()
      term_freqs = term_freqs_dict.values()
  
      return {
          "doc_lengths": doc_lengths,
          "vocab": vocab,
          "term_frequency": term_freqs,
      }
  
file_path: pyLDAvis/notebooks/pyLDAvis/graphlab.py
imports: import funcy
  import numpy
  import pandas
  import graphlab
  import pyLDAvis
label_desc: Use image node_id 3 for calling a global function with example usage: _extract_doc_data(docs) and returns: dict