class_docstr: Intent parser which consists in two steps: intent classification then
  slot filling
class_docstr_tok: ["Intent","parser","which","consists","in","two","steps",":","intent","classification","then","slot","filling"]
docstr: Fits the probabilistic intent parser
  
  Args:
      dataset (dict): A valid Snips dataset
      force_retrain (bool, optional): If *False*, will not retrain intent
          classifier and slot fillers when they are already fitted.
          Default to *True*.
  
  Returns:
      :class:`ProbabilisticIntentParser`: The same instance, trained
docstr_tok: ["Fits","the","probabilistic","intent","parser","Args",":","dataset","(","dict",")",":","A","valid","Snips","dataset","force_retrain","(","bool",",","optional",")",":","If","*","False","*",",","will","not","retrain","intent","classifier","and","slot","fillers","when","they","are","already","fitted",".","Default","to","*","True","*",".","Returns",":",":","class",":","`","ProbabilisticIntentParser","`",":","The","same","instance",",","trained"]
code: def fit(self, dataset, force_retrain=True):
      """Fits the probabilistic intent parser
  
      Args:
          dataset (dict): A valid Snips dataset
          force_retrain (bool, optional): If *False*, will not retrain intent
              classifier and slot fillers when they are already fitted.
              Default to *True*.
  
      Returns:
          :class:`ProbabilisticIntentParser`: The same instance, trained
      """
      logger.info("Fitting probabilistic intent parser...")
      dataset = validate_and_format_dataset(dataset)
      intents = list(dataset[INTENTS])
      if self.intent_classifier is None:
          self.intent_classifier = IntentClassifier.from_config(
              self.config.intent_classifier_config,
              builtin_entity_parser=self.builtin_entity_parser,
              custom_entity_parser=self.custom_entity_parser,
              resources=self.resources,
              random_state=self.random_state,
          )
  
      if force_retrain or not self.intent_classifier.fitted:
          self.intent_classifier.fit(dataset)
  
      if self.slot_fillers is None:
          self.slot_fillers = dict()
      slot_fillers_start = datetime.now()
      for intent_name in intents:
          # We need to copy the slot filler config as it may be mutated
          if self.slot_fillers.get(intent_name) is None:
              slot_filler_config = deepcopy(
                  self.config.slot_filler_config
              )
              self.slot_fillers[intent_name] = SlotFiller.from_config(
                  slot_filler_config,
                  builtin_entity_parser=self.builtin_entity_parser,
                  custom_entity_parser=self.custom_entity_parser,
                  resources=self.resources,
                  random_state=self.random_state,
              )
          if force_retrain or not self.slot_fillers[intent_name].fitted:
              self.slot_fillers[intent_name].fit(dataset, intent_name)
      logger.debug(
          "Fitted slot fillers in %s", elapsed_since(slot_fillers_start)
      )
      return self
  
imports: from __future__ import unicode_literals
  import json
  import logging
  from builtins import str
  from copy import deepcopy
  from datetime import datetime
  from pathlib import Path
  from future.utils import iteritems, itervalues
  from snips_nlu.common.log_utils import log_elapsed_time, log_result
  from snips_nlu.common.utils import check_persisted_path, elapsed_since, fitted_required, json_string
  from snips_nlu.constants import INTENTS, RES_INTENT_NAME
  from snips_nlu.dataset import validate_and_format_dataset
  from snips_nlu.exceptions import IntentNotFoundError, LoadingError
  from snips_nlu.intent_classifier import IntentClassifier
  from snips_nlu.intent_parser.intent_parser import IntentParser
  from snips_nlu.pipeline.configs import ProbabilisticIntentParserConfig
  from snips_nlu.result import parsing_result, extraction_result
  from snips_nlu.slot_filler import SlotFiller
label_desc: Use image node_id 3 for calling the ProbabilisticIntentParser obj's underlying member method code with example usage: obj.fit(dataset, force_retrain) and returns: self