code: def count_text(ngram, hash_size, doc_id, text=None):
      """
      Compute hashed ngram counts of text.
      """
      row, col, data = [], [], []
      # Tokenize
      tokens = tokenize(utils.normalize(text))
  
      # Get ngrams from tokens, with stopword/punctuation filtering.
      ngrams = tokens.ngrams(
          n=ngram, uncased=True, filter_fn=utils.filter_ngram
      )
  
      # Hash ngrams and count occurrences
      counts = Counter([utils.hash(gram, hash_size) for gram in ngrams])
  
      # Return in sparse matrix data format.
      row.extend(counts.keys())
      col.extend([doc_id] * len(counts))
      data.extend(counts.values())
      return row, col, data
  
imports: import numpy
  import scipy.sparse
  import math
  from multiprocessing import Pool
  from multiprocessing.util import Finalize
  from functools import partial
  from collections import Counter
  from .None import utils
  from .doc_db import DocDB
  from .None import tokenizers
  import parlai.utils.logging
label_desc: Use image node_id 5 for calling a global function with example usage: count_text(ngram, hash_size, doc_id, text) and returns: row,  col,  data