docstr: Vectors and vocab for :class:`~gensim.models.fasttext.FastText`.
  
  Implements significant parts of the FastText algorithm.  For example,
  the :func:`word_vec` calculates vectors for out-of-vocabulary (OOV)
  entities.  FastText achieves this by keeping vectors for ngrams:
  adding the vectors for the ngrams of an entity yields the vector for the
  entity.
  
  Similar to a hashmap, this class keeps a fixed number of buckets, and
  maps all ngrams to buckets using a hash function.
  
  Parameters
  ----------
  vector_size : int
      The dimensionality of all vectors.
  min_n : int
      The minimum number of characters in an ngram
  max_n : int
      The maximum number of characters in an ngram
  bucket : int
      The number of buckets.
  count : int, optional
      If provided, vectors will be pre-allocated for at least this many vectors. (Otherwise
      they can be added later.)
  dtype : type, optional
      Vector dimensions will default to `np.float32` (AKA `REAL` in some Gensim code) unless
      another type is provided here.
  
  Attributes
  ----------
  vectors_vocab : np.array
      Each row corresponds to a vector for an entity in the vocabulary.
      Columns correspond to vector dimensions. When embedded in a full
      FastText model, these are the full-word-token vectors updated
      by training, whereas the inherited vectors are the actual per-word
      vectors synthesized from the full-word-token and all subword (ngram)
      vectors.
  vectors_ngrams : np.array
      A vector for each ngram across all entities in the vocabulary.
      Each row is a vector that corresponds to a bucket.
      Columns correspond to vector dimensions.
  buckets_word : list of np.array
      For each key (by its index), report bucket slots their subwords map to.
docstr_tok: ["Vectors","and","vocab","for",":","class",":","`","~gensim.models.fasttext.FastText","`",".","Implements","significant","parts","of","the","FastText","algorithm",".","For","example",",","the",":","func",":","`","word_vec","`","calculates","vectors","for","out-of-vocabulary","(","OOV",")","entities",".","FastText","achieves","this","by","keeping","vectors","for","ngrams",":","adding","the","vectors","for","the","ngrams","of","an","entity","yields","the","vector","for","the","entity",".","Similar","to","a","hashmap",",","this","class","keeps","a","fixed","number","of","buckets",",","and","maps","all","ngrams","to","buckets","using","a","hash","function",".","Parameters","--","--","--","--","--","vector_size",":","int","The","dimensionality","of","all","vectors",".","min_n",":","int","The","minimum","number","of","characters","in","an","ngram","max_n",":","int","The","maximum","number","of","characters","in","an","ngram","bucket",":","int","The","number","of","buckets",".","count",":","int",",","optional","If","provided",",","vectors","will","be","pre-allocated","for","at","least","this","many","vectors",".","(","Otherwise","they","can","be","added","later",".",")","dtype",":","type",",","optional","Vector","dimensions","will","default","to","`","np.float32","`","(","AKA","`","REAL","`","in","some","Gensim","code",")","unless","another","type","is","provided","here",".","Attributes","--","--","--","--","--","vectors_vocab",":","np.array","Each","row","corresponds","to","a","vector","for","an","entity","in","the","vocabulary",".","Columns","correspond","to","vector","dimensions",".","When","embedded","in","a","full","FastText","model",",","these","are","the","full-word-token","vectors","updated","by","training",",","whereas","the","inherited","vectors","are","the","actual","per-word","vectors","synthesized","from","the","full-word-token","and","all","subword","(","ngram",")","vectors",".","vectors_ngrams",":","np.array","A","vector","for","each","ngram","across","all","entities","in","the","vocabulary",".","Each","row","is","a","vector","that","corresponds","to","a","bucket",".","Columns","correspond","to","vector","dimensions",".","buckets_word",":","list","of","np.array","For","each","key","(","by","its","index",")",",","report","bucket","slots","their","subwords","map","to","."]
code: def __init__(
      self, vector_size, min_n, max_n, bucket, count=0, dtype=REAL
  ):
      """Vectors and vocab for :class:`~gensim.models.fasttext.FastText`.
  
      Implements significant parts of the FastText algorithm.  For example,
      the :func:`word_vec` calculates vectors for out-of-vocabulary (OOV)
      entities.  FastText achieves this by keeping vectors for ngrams:
      adding the vectors for the ngrams of an entity yields the vector for the
      entity.
  
      Similar to a hashmap, this class keeps a fixed number of buckets, and
      maps all ngrams to buckets using a hash function.
  
      Parameters
      ----------
      vector_size : int
          The dimensionality of all vectors.
      min_n : int
          The minimum number of characters in an ngram
      max_n : int
          The maximum number of characters in an ngram
      bucket : int
          The number of buckets.
      count : int, optional
          If provided, vectors will be pre-allocated for at least this many vectors. (Otherwise
          they can be added later.)
      dtype : type, optional
          Vector dimensions will default to `np.float32` (AKA `REAL` in some Gensim code) unless
          another type is provided here.
  
      Attributes
      ----------
      vectors_vocab : np.array
          Each row corresponds to a vector for an entity in the vocabulary.
          Columns correspond to vector dimensions. When embedded in a full
          FastText model, these are the full-word-token vectors updated
          by training, whereas the inherited vectors are the actual per-word
          vectors synthesized from the full-word-token and all subword (ngram)
          vectors.
      vectors_ngrams : np.array
          A vector for each ngram across all entities in the vocabulary.
          Each row is a vector that corresponds to a bucket.
          Columns correspond to vector dimensions.
      buckets_word : list of np.array
          For each key (by its index), report bucket slots their subwords map to.
  
      """
      super(FastTextKeyedVectors, self).__init__(
          vector_size=vector_size, count=count, dtype=dtype
      )
      self.min_n = min_n
      self.max_n = max_n
      self.bucket = bucket  # count of buckets, fka num_ngram_vectors
      self.buckets_word = (
          None  # precalculated cache of buckets for each word's ngrams
      )
      self.vectors_vocab = np.zeros(
          (count, vector_size), dtype=dtype
      )  # fka (formerly known as) syn0_vocab
      self.vectors_ngrams = None  # must be initialized later
      self.compatible_hash = True
  
imports: import logging
  import numpy
  from numpy import ones, vstack, float32
  import gensim.models._fasttext_bin
  from gensim.models.word2vec import Word2Vec
  from gensim.models.keyedvectors import KeyedVectors, prep_vectors
  from gensim import utils
  from gensim.utils import deprecated
  from gensim.models import keyedvectors
label_desc: Use image node_id 1 to create a new FastTextKeyedVectors object from inherited base classes: KeyedVectors with example: obj = FastTextKeyedVectors(vector_size, min_n, max_n, bucket, count, dtype)