class_docstr: Featurizer that takes utterances and extracts ordered word cooccurrence
  features matrix from them
class_docstr_tok: ["Featurizer","that","takes","utterances","and","extracts","ordered","word","cooccurrence","features","matrix","from","them"]
docstr: Fits the CooccurrenceVectorizer
  
  Given a list of utterances the CooccurrenceVectorizer will extract word
  pairs appearing in the same utterance. The order in which the words
  appear is kept. Additionally, if self.config.window_size is not None
  then the vectorizer will only look in a context window of
  self.config.window_size after each word.
  
  Args:
      x (iterable): list of utterances
      dataset (dict): dataset from which x was extracted (needed to
          extract the language and the builtin entity scope)
  
  Returns:
      :class:`.CooccurrenceVectorizer`: The fitted vectorizer
docstr_tok: ["Fits","the","CooccurrenceVectorizer","Given","a","list","of","utterances","the","CooccurrenceVectorizer","will","extract","word","pairs","appearing","in","the","same","utterance",".","The","order","in","which","the","words","appear","is","kept",".","Additionally",",","if","self.config.window_size","is","not","None","then","the","vectorizer","will","only","look","in","a","context","window","of","self.config.window_size","after","each","word",".","Args",":","x","(","iterable",")",":","list","of","utterances","dataset","(","dict",")",":","dataset","from","which","x","was","extracted","(","needed","to","extract","the","language","and","the","builtin","entity","scope",")","Returns",":",":","class",":","`",".CooccurrenceVectorizer","`",":","The","fitted","vectorizer"]
code: def fit(self, x, dataset):
      """Fits the CooccurrenceVectorizer
  
      Given a list of utterances the CooccurrenceVectorizer will extract word
      pairs appearing in the same utterance. The order in which the words
      appear is kept. Additionally, if self.config.window_size is not None
      then the vectorizer will only look in a context window of
      self.config.window_size after each word.
  
      Args:
          x (iterable): list of utterances
          dataset (dict): dataset from which x was extracted (needed to
              extract the language and the builtin entity scope)
  
      Returns:
          :class:`.CooccurrenceVectorizer`: The fitted vectorizer
      """
      self.load_resources_if_needed(dataset[LANGUAGE])
      self.fit_builtin_entity_parser_if_needed(dataset)
      self.fit_custom_entity_parser_if_needed(dataset)
  
      self._language = dataset[LANGUAGE]
      self.builtin_entity_scope = set(
          e for e in dataset[ENTITIES] if is_builtin_entity(e)
      )
  
      preprocessed = self._preprocess(list(x))
      utterances = [
          self._enrich_utterance(utterance, builtin_ents, custom_ent)
          for utterance, builtin_ents, custom_ent in zip(*preprocessed)
      ]
      word_pairs = set(
          p for u in utterances for p in self._extract_word_pairs(u)
      )
      self._word_pairs = {
          pair: i for i, pair in enumerate(sorted(word_pairs))
      }
      return self
  
imports: from __future__ import division, unicode_literals
  import json
  from builtins import str, zip
  from copy import deepcopy
  from pathlib import Path
  from future.utils import iteritems
  from snips_nlu.common.utils import json_string, fitted_required, replace_entities_with_placeholders, check_persisted_path
  from snips_nlu.constants import DATA, ENTITY, ENTITY_KIND, LANGUAGE, NGRAM, TEXT, ENTITIES
  from snips_nlu.dataset import get_text_from_chunks, validate_and_format_dataset
  from snips_nlu.entity_parser.builtin_entity_parser import is_builtin_entity
  from snips_nlu.exceptions import _EmptyDatasetUtterancesError, LoadingError
  from snips_nlu.languages import get_default_sep
  from snips_nlu.pipeline.configs import FeaturizerConfig
  from snips_nlu.pipeline.configs.intent_classifier import CooccurrenceVectorizerConfig, TfidfVectorizerConfig
  from snips_nlu.pipeline.processing_unit import ProcessingUnit
  from snips_nlu.preprocessing import stem, tokenize_light
  from snips_nlu.resources import get_stop_words, get_word_cluster
  from snips_nlu.slot_filler.features_utils import get_all_ngrams
label_desc: Use image node_id 4 for calling the CooccurrenceVectorizer obj's underlying member method code with example usage: obj.fit(x, dataset) and returns: self