code: def token_freqs(doc):
      """Extract a dict mapping tokens from doc to their occurrences."""
  
      freq = defaultdict(int)
      for tok in tokenize(doc):
          freq[tok] += 1
      return freq
  
file_path: scikit-learn/examples/text/plot_hashing_vs_dict_vectorizer.py
imports: from sklearn.datasets import fetch_20newsgroups
  import re
  from collections import defaultdict
  from time import time
  from sklearn.feature_extraction import DictVectorizer
  import numpy
  from sklearn.feature_extraction import FeatureHasher
  import matplotlib.pyplot
  from sklearn.feature_extraction.text import CountVectorizer
  from sklearn.feature_extraction.text import HashingVectorizer
  from sklearn.feature_extraction.text import TfidfVectorizer
label_desc: Use image node_id 2 for calling a global function with example usage: token_freqs(doc) and returns: freq