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: Persists the NLU engine at the given directory path
  
  Args:
      path (str or pathlib.Path): the location at which the nlu engine
          must be persisted. This path must not exist when calling this
          function.
  
  Raises:
      PersistingError: when persisting to a path which already exists
docstr_tok: ["Persists","the","NLU","engine","at","the","given","directory","path","Args",":","path","(","str","or","pathlib.Path",")",":","the","location","at","which","the","nlu","engine","must","be","persisted",".","This","path","must","not","exist","when","calling","this","function",".","Raises",":","PersistingError",":","when","persisting","to","a","path","which","already","exists"]
code: def persist(self, path):
      """Persists the NLU engine at the given directory path
  
      Args:
          path (str or pathlib.Path): the location at which the nlu engine
              must be persisted. This path must not exist when calling this
              function.
  
      Raises:
          PersistingError: when persisting to a path which already exists
      """
      path.mkdir()
  
      parsers_count = defaultdict(int)
      intent_parsers = []
      for parser in self.intent_parsers:
          parser_name = parser.unit_name
          parsers_count[parser_name] += 1
          count = parsers_count[parser_name]
          if count > 1:
              parser_name = "{n}_{c}".format(n=parser_name, c=count)
          parser_path = path / parser_name
          parser.persist(parser_path)
          intent_parsers.append(parser_name)
  
      config = None
      if self.config is not None:
          config = self.config.to_dict()
  
      builtin_entity_parser = None
      if self.builtin_entity_parser is not None:
          builtin_entity_parser = "builtin_entity_parser"
          builtin_entity_parser_path = path / builtin_entity_parser
          self.builtin_entity_parser.persist(builtin_entity_parser_path)
  
      custom_entity_parser = None
      if self.custom_entity_parser is not None:
          custom_entity_parser = "custom_entity_parser"
          custom_entity_parser_path = path / custom_entity_parser
          self.custom_entity_parser.persist(custom_entity_parser_path)
  
      model = {
          "unit_name": self.unit_name,
          "dataset_metadata": self.dataset_metadata,
          "intent_parsers": intent_parsers,
          "custom_entity_parser": custom_entity_parser,
          "builtin_entity_parser": builtin_entity_parser,
          "config": config,
          "model_version": __model_version__,
          "training_package_version": __version__,
      }
  
      model_json = json_string(model)
      model_path = path / "nlu_engine.json"
      with model_path.open(mode="w", encoding="utf8") as f:
          f.write(model_json)
  
      if self.fitted:
          required_resources = self.config.get_required_resources()
          language = self.dataset_metadata["language_code"]
          resources_path = path / "resources"
          resources_path.mkdir()
          persist_resources(
              self.resources,
              resources_path / language,
              required_resources,
          )
  
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 8 for calling the SnipsNLUEngine obj's underlying member method code with example usage: obj.persist(path) without return types