class_docstr: Main class to use for intent parsing
  
  A :class:`SnipsNLUEngine` relies on a list of :class:`.IntentParser`
  object to parse intents, by calling them successively using the first
  positive output.
  
  With the default parameters, it will use the two following intent parsers
  in this order:
  
  - a :class:`.DeterministicIntentParser`
  - a :class:`.ProbabilisticIntentParser`
  
  The logic behind is to first use a conservative parser which has a very
  good precision while its recall is modest, so simple patterns will be
  caught, and then fallback on a second parser which is machine-learning
  based and will be able to parse unseen utterances while ensuring a good
  precision and recall.
class_docstr_tok: ["Main","class","to","use","for","intent","parsing","A",":","class",":","`","SnipsNLUEngine","`","relies","on","a","list","of",":","class",":","`",".IntentParser","`","object","to","parse","intents",",","by","calling","them","successively","using","the","first","positive","output",".","With","the","default","parameters",",","it","will","use","the","two","following","intent","parsers","in","this","order",":","-","a",":","class",":","`",".DeterministicIntentParser","`","-","a",":","class",":","`",".ProbabilisticIntentParser","`","The","logic","behind","is","to","first","use","a","conservative","parser","which","has","a","very","good","precision","while","its","recall","is","modest",",","so","simple","patterns","will","be","caught",",","and","then","fallback","on","a","second","parser","which","is","machine-learning","based","and","will","be","able","to","parse","unseen","utterances","while","ensuring","a","good","precision","and","recall","."]
docstr: Fits the NLU engine
  
  Args:
      dataset (dict): A valid Snips dataset
      force_retrain (bool, optional): If *False*, will not retrain intent
          parsers when they are already fitted. Default to *True*.
  
  Returns:
      The same object, trained.
docstr_tok: ["Fits","the","NLU","engine","Args",":","dataset","(","dict",")",":","A","valid","Snips","dataset","force_retrain","(","bool",",","optional",")",":","If","*","False","*",",","will","not","retrain","intent","parsers","when","they","are","already","fitted",".","Default","to","*","True","*",".","Returns",":","The","same","object",",","trained","."]
code: def fit(self, dataset, force_retrain=True):
      """Fits the NLU engine
  
      Args:
          dataset (dict): A valid Snips dataset
          force_retrain (bool, optional): If *False*, will not retrain intent
              parsers when they are already fitted. Default to *True*.
  
      Returns:
          The same object, trained.
      """
      dataset = validate_and_format_dataset(dataset)
      if self.config is None:
          language = dataset[LANGUAGE]
          default_config = DEFAULT_CONFIGS.get(language)
          if default_config is not None:
              self.config = self.config_type.from_dict(default_config)
          else:
              self.config = self.config_type()
  
      self.load_resources_if_needed(dataset[LANGUAGE])
      self.fit_builtin_entity_parser_if_needed(dataset)
      self.fit_custom_entity_parser_if_needed(dataset)
  
      parsers = []
      for parser_config in self.config.intent_parsers_configs:
          # Re-use existing parsers to allow pre-training
          recycled_parser = None
          for parser in self.intent_parsers:
              if parser.unit_name == parser_config.unit_name:
                  recycled_parser = parser
                  break
          if recycled_parser is None:
              recycled_parser = IntentParser.from_config(
                  parser_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 recycled_parser.fitted:
              recycled_parser.fit(dataset, force_retrain)
          parsers.append(recycled_parser)
  
      self.intent_parsers = parsers
      self.dataset_metadata = _get_dataset_metadata(dataset)
      return self
  
imports: from __future__ import unicode_literals
  import json
  import logging
  from builtins import str
  from collections import defaultdict
  from pathlib import Path
  from future.utils import iteritems, itervalues
  from snips_nlu.__about__ import __model_version__, __version__
  from snips_nlu.common.dataset_utils import get_slot_name_mappings
  from snips_nlu.common.log_utils import log_elapsed_time
  from snips_nlu.common.utils import check_persisted_path, fitted_required, json_string
  from snips_nlu.constants import AUTOMATICALLY_EXTENSIBLE, BUILTIN_ENTITY_PARSER, CUSTOM_ENTITY_PARSER, ENTITIES, ENTITY_KIND, LANGUAGE, RESOLVED_VALUE, RES_ENTITY, RES_INTENT, RES_INTENT_NAME, RES_MATCH_RANGE, RES_PROBA, RES_SLOTS, RES_VALUE, RESOURCES, BYPASS_VERSION_CHECK
  from snips_nlu.dataset import validate_and_format_dataset
  from snips_nlu.default_configs import DEFAULT_CONFIGS
  from snips_nlu.entity_parser import CustomEntityParser
  from snips_nlu.entity_parser.builtin_entity_parser import BuiltinEntityParser, is_builtin_entity
  from snips_nlu.exceptions import InvalidInputError, IntentNotFoundError, LoadingError, IncompatibleModelError
  from snips_nlu.intent_parser import IntentParser
  from snips_nlu.pipeline.configs import NLUEngineConfig
  from snips_nlu.pipeline.processing_unit import ProcessingUnit
  from snips_nlu.resources import load_resources_from_dir, persist_resources
  from snips_nlu.result import builtin_slot, custom_slot, empty_result, extraction_result, is_empty, parsing_result
label_desc: Use image node_id 4 for calling the SnipsNLUEngine obj's underlying member method code with example usage: obj.fit(dataset, force_retrain) and returns: self