class_docstr: Dictionary encapsulates the mapping between normalized words and their integer ids.
  
  Notable instance attributes:
  
  Attributes
  ----------
  token2id : dict of (str, int)
      token -> token_id. I.e. the reverse mapping to `self[token_id]`.
  cfs : dict of (int, int)
      Collection frequencies: token_id -> how many instances of this token are contained in the documents.
  dfs : dict of (int, int)
      Document frequencies: token_id -> how many documents contain this token.
  num_docs : int
      Number of documents processed.
  num_pos : int
      Total number of corpus positions (number of processed words).
  num_nnz : int
      Total number of non-zeroes in the BOW matrix (sum of the number of unique
      words per document over the entire corpus).
class_docstr_tok: ["Dictionary","encapsulates","the","mapping","between","normalized","words","and","their","integer","ids",".","Notable","instance","attributes",":","Attributes","--","--","--","--","--","token2id",":","dict","of","(","str",",","int",")","token","-",">","token_id",".","I.e",".","the","reverse","mapping","to","`","self","[","token_id","]","`",".","cfs",":","dict","of","(","int",",","int",")","Collection","frequencies",":","token_id","-",">","how","many","instances","of","this","token","are","contained","in","the","documents",".","dfs",":","dict","of","(","int",",","int",")","Document","frequencies",":","token_id","-",">","how","many","documents","contain","this","token",".","num_docs",":","int","Number","of","documents","processed",".","num_pos",":","int","Total","number","of","corpus","positions","(","number","of","processed","words",")",".","num_nnz",":","int","Total","number","of","non-zeroes","in","the","BOW","matrix","(","sum","of","the","number","of","unique","words","per","document","over","the","entire","corpus",")","."]
docstr: Parameters
  ----------
  documents : iterable of iterable of str, optional
      Documents to be used to initialize the mapping and collect corpus statistics.
  prune_at : int, optional
      Dictionary will try to keep no more than `prune_at` words in its mapping, to limit its RAM
      footprint, the correctness is not guaranteed.
      Use :meth:`~gensim.corpora.dictionary.Dictionary.filter_extremes` to perform proper filtering.
  
  Examples
  --------
  .. sourcecode:: pycon
  
      >>> from gensim.corpora import Dictionary
      >>>
      >>> texts = [['human', 'interface', 'computer']]
      >>> dct = Dictionary(texts)  # initialize a Dictionary
      >>> dct.add_documents([["cat", "say", "meow"], ["dog"]])  # add more document (extend the vocabulary)
      >>> dct.doc2bow(["dog", "computer", "non_existent_word"])
      [(0, 1), (6, 1)]
docstr_tok: ["Parameters","--","--","--","--","--","documents",":","iterable","of","iterable","of","str",",","optional","Documents","to","be","used","to","initialize","the","mapping","and","collect","corpus","statistics",".","prune_at",":","int",",","optional","Dictionary","will","try","to","keep","no","more","than","`","prune_at","`","words","in","its","mapping",",","to","limit","its","RAM","footprint",",","the","correctness","is","not","guaranteed",".","Use",":","meth",":","`","~gensim.corpora.dictionary.Dictionary.filter_extremes","`","to","perform","proper","filtering",".","Examples","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","from","gensim.corpora","import","Dictionary",">",">",">",">",">",">","texts","=","[","[","'human","'",",","'interface","'",",","'computer","'","]","]",">",">",">","dct","=","Dictionary","(","texts",")","#","initialize","a","Dictionary",">",">",">","dct.add_documents","(","[","[","``","cat","''",",","``","say","''",",","``","meow","''","]",",","[","``","dog","''","]","]",")","#","add","more","document","(","extend","the","vocabulary",")",">",">",">","dct.doc2bow","(","[","``","dog","''",",","``","computer","''",",","``","non_existent_word","''","]",")","[","(","0",",","1",")",",","(","6",",","1",")","]"]
code: def __init__(self, documents=None, prune_at=2000000):
      """
  
      Parameters
      ----------
      documents : iterable of iterable of str, optional
          Documents to be used to initialize the mapping and collect corpus statistics.
      prune_at : int, optional
          Dictionary will try to keep no more than `prune_at` words in its mapping, to limit its RAM
          footprint, the correctness is not guaranteed.
          Use :meth:`~gensim.corpora.dictionary.Dictionary.filter_extremes` to perform proper filtering.
  
      Examples
      --------
      .. sourcecode:: pycon
  
          >>> from gensim.corpora import Dictionary
          >>>
          >>> texts = [['human', 'interface', 'computer']]
          >>> dct = Dictionary(texts)  # initialize a Dictionary
          >>> dct.add_documents([["cat", "say", "meow"], ["dog"]])  # add more document (extend the vocabulary)
          >>> dct.doc2bow(["dog", "computer", "non_existent_word"])
          [(0, 1), (6, 1)]
  
      """
      self.token2id = {}
      self.id2token = {}
      self.cfs = {}
      self.dfs = {}
  
      self.num_docs = 0
      self.num_pos = 0
      self.num_nnz = 0
  
      if documents is not None:
          self.add_documents(documents, prune_at=prune_at)
          self.add_lifecycle_event(
              "created",
              msg=f"built {self} from {self.num_docs} documents (total {self.num_pos} corpus positions)",
          )
  
imports: from collections import defaultdict
  from collections.abc import Mapping
  import logging
  import itertools
  from typing import Optional, List, Tuple
  from gensim import utils
label_desc: Use image node_id 1 to create a new Dictionary object from inherited base classes: utils, Mapping with example: obj = Dictionary(documents, prune_at)