class_docstr: Minimal state & functionality exported from a trained :class:`~gensim.models.phrases.Phrases` model.
  
  The goal of this class is to cut down memory consumption of `Phrases`, by discarding model state
  not strictly needed for the phrase detection task.
  
  Use this instead of `Phrases` if you do not need to update the bigram statistics with new documents any more.
class_docstr_tok: ["Minimal","state","&","functionality","exported","from","a","trained",":","class",":","`","~gensim.models.phrases.Phrases","`","model",".","The","goal","of","this","class","is","to","cut","down","memory","consumption","of","`","Phrases","`",",","by","discarding","model","state","not","strictly","needed","for","the","phrase","detection","task",".","Use","this","instead","of","`","Phrases","`","if","you","do","not","need","to","update","the","bigram","statistics","with","new","documents","any","more","."]
docstr: Parameters
  ----------
  phrases_model : :class:`~gensim.models.phrases.Phrases`
      Trained phrases instance, to extract all phrases from.
  
  Notes
  -----
  After the one-time initialization, a :class:`~gensim.models.phrases.FrozenPhrases` will be much
  smaller and faster than using the full :class:`~gensim.models.phrases.Phrases` model.
  
  Examples
  ----------
  .. sourcecode:: pycon
  
      >>> from gensim.test.utils import datapath
      >>> from gensim.models.word2vec import Text8Corpus
      >>> from gensim.models.phrases import Phrases, ENGLISH_CONNECTOR_WORDS
      >>>
      >>> # Load corpus and train a model.
      >>> sentences = Text8Corpus(datapath('testcorpus.txt'))
      >>> phrases = Phrases(sentences, min_count=1, threshold=1, connector_words=ENGLISH_CONNECTOR_WORDS)
      >>>
      >>> # Export a FrozenPhrases object that is more efficient but doesn't allow further training.
      >>> frozen_phrases = phrases.freeze()
      >>> print(frozen_phrases[sent])
      [u'trees_graph', u'minors']
docstr_tok: ["Parameters","--","--","--","--","--","phrases_model",":",":","class",":","`","~gensim.models.phrases.Phrases","`","Trained","phrases","instance",",","to","extract","all","phrases","from",".","Notes","--","--","-","After","the","one-time","initialization",",","a",":","class",":","`","~gensim.models.phrases.FrozenPhrases","`","will","be","much","smaller","and","faster","than","using","the","full",":","class",":","`","~gensim.models.phrases.Phrases","`","model",".","Examples","--","--","--","--","--","..","sourcecode",":",":","pycon",">",">",">","from","gensim.test.utils","import","datapath",">",">",">","from","gensim.models.word2vec","import","Text8Corpus",">",">",">","from","gensim.models.phrases","import","Phrases",",","ENGLISH_CONNECTOR_WORDS",">",">",">",">",">",">","#","Load","corpus","and","train","a","model",".",">",">",">","sentences","=","Text8Corpus","(","datapath","(","'testcorpus.txt","'",")",")",">",">",">","phrases","=","Phrases","(","sentences",",","min_count=1",",","threshold=1",",","connector_words=ENGLISH_CONNECTOR_WORDS",")",">",">",">",">",">",">","#","Export","a","FrozenPhrases","object","that","is","more","efficient","but","does","n't","allow","further","training",".",">",">",">","frozen_phrases","=","phrases.freeze","(",")",">",">",">","print","(","frozen_phrases","[","sent","]",")","[","u'trees_graph","'",",","u'minors","'","]"]
code: def __init__(self, phrases_model):
      """
  
      Parameters
      ----------
      phrases_model : :class:`~gensim.models.phrases.Phrases`
          Trained phrases instance, to extract all phrases from.
  
      Notes
      -----
      After the one-time initialization, a :class:`~gensim.models.phrases.FrozenPhrases` will be much
      smaller and faster than using the full :class:`~gensim.models.phrases.Phrases` model.
  
      Examples
      ----------
      .. sourcecode:: pycon
  
          >>> from gensim.test.utils import datapath
          >>> from gensim.models.word2vec import Text8Corpus
          >>> from gensim.models.phrases import Phrases, ENGLISH_CONNECTOR_WORDS
          >>>
          >>> # Load corpus and train a model.
          >>> sentences = Text8Corpus(datapath('testcorpus.txt'))
          >>> phrases = Phrases(sentences, min_count=1, threshold=1, connector_words=ENGLISH_CONNECTOR_WORDS)
          >>>
          >>> # Export a FrozenPhrases object that is more efficient but doesn't allow further training.
          >>> frozen_phrases = phrases.freeze()
          >>> print(frozen_phrases[sent])
          [u'trees_graph', u'minors']
  
      """
      self.threshold = phrases_model.threshold
      self.min_count = phrases_model.min_count
      self.delimiter = phrases_model.delimiter
      self.scoring = phrases_model.scoring
      self.connector_words = phrases_model.connector_words
      logger.info("exporting phrases from %s", phrases_model)
      start = time.time()
      self.phrasegrams = phrases_model.export_phrases()
      self.add_lifecycle_event(
          "created",
          msg=f"exported {self} from {phrases_model} in {time.time() - start:.2f}s",
      )
  
imports: import logging
  import itertools
  from math import log
  import pickle
  from inspect import getfullargspec
  import time
  from gensim import utils, interfaces
label_desc: Use image node_id 1 to create a new FrozenPhrases object from inherited base classes: _PhrasesTransformation with example: obj = FrozenPhrases(phrases_model)