class_docstr: Word-hashing layer for DSSM-based models.
  
  The input of :class:`WordHashingUnit` should be a list of word
  sub-letter list extracted from one document. The output of is
  the word-hashing representation of this document.
  
  :class:`NgramLetterUnit` and :class:`VocabularyUnit` are two
  essential prerequisite of :class:`WordHashingUnit`.
  
  Examples:
     >>> letters = [['#te', 'tes','est', 'st#'], ['oov']]
     >>> word_hashing = WordHashing(
     ...     term_index={
     ...      '_PAD': 0, 'OOV': 1, 'st#': 2, '#te': 3, 'est': 4, 'tes': 5
     ...      })
     >>> hashing = word_hashing.transform(letters)
     >>> hashing[0]
     [0.0, 0.0, 1.0, 1.0, 1.0, 1.0]
     >>> hashing[1]
     [0.0, 1.0, 0.0, 0.0, 0.0, 0.0]
docstr: Class initialization.
  
  :param term_index: term-index mapping generated by
      :class:`VocabularyUnit`.
  :param dim_triletter: dimensionality of tri_leltters.
docstr_tok: ["Class","initialization",".",":","param","term_index",":","term-index","mapping","generated","by",":","class",":","`","VocabularyUnit","`",".",":","param","dim_triletter",":","dimensionality","of","tri_leltters","."]
code: def __init__(
      self,
      term_index: dict,
  ):
      """
      Class initialization.
  
      :param term_index: term-index mapping generated by
          :class:`VocabularyUnit`.
      :param dim_triletter: dimensionality of tri_leltters.
      """
      self._term_index = term_index
  
imports: import collections
  import numpy
  from .unit import Unit
label_desc: Use image node_id 1 to create a new WordHashing object from inherited base classes: Unit with example: obj = WordHashing(term_index)