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: Performs intent parsing on the provided *text* by first classifying
  the intent and then using the correspond slot filler to extract slots
  
  Args:
      text (str): input
      intents (str or list of str): if provided, reduces the scope of
          intent parsing to the provided list of intents
      top_n (int, optional): when provided, this method will return a
          list of at most top_n most likely intents, instead of a single
          parsing result.
          Note that the returned list can contain less than ``top_n``
          elements, for instance when the parameter ``intents`` is not
          None, or when ``top_n`` is greater than the total number of
          intents.
  
  Returns:
      dict or list: the most likely intent(s) along with the extracted
      slots. See :func:`.parsing_result` and :func:`.extraction_result`
      for the output format.
  
  Raises:
      NotTrained: when the intent parser is not fitted
docstr_tok: ["Performs","intent","parsing","on","the","provided","*","text","*","by","first","classifying","the","intent","and","then","using","the","correspond","slot","filler","to","extract","slots","Args",":","text","(","str",")",":","input","intents","(","str","or","list","of","str",")",":","if","provided",",","reduces","the","scope","of","intent","parsing","to","the","provided","list","of","intents","top_n","(","int",",","optional",")",":","when","provided",",","this","method","will","return","a","list","of","at","most","top_n","most","likely","intents",",","instead","of","a","single","parsing","result",".","Note","that","the","returned","list","can","contain","less","than","``","top_n","``","elements",",","for","instance","when","the","parameter","``","intents","``","is","not","None",",","or","when","``","top_n","``","is","greater","than","the","total","number","of","intents",".","Returns",":","dict","or","list",":","the","most","likely","intent","(","s",")","along","with","the","extracted","slots",".","See",":","func",":","`",".parsing_result","`","and",":","func",":","`",".extraction_result","`","for","the","output","format",".","Raises",":","NotTrained",":","when","the","intent","parser","is","not","fitted"]
code: def parse(self, text, intents=None, top_n=None):
      """Performs intent parsing on the provided *text* by first classifying
      the intent and then using the correspond slot filler to extract slots
  
      Args:
          text (str): input
          intents (str or list of str): if provided, reduces the scope of
              intent parsing to the provided list of intents
          top_n (int, optional): when provided, this method will return a
              list of at most top_n most likely intents, instead of a single
              parsing result.
              Note that the returned list can contain less than ``top_n``
              elements, for instance when the parameter ``intents`` is not
              None, or when ``top_n`` is greater than the total number of
              intents.
  
      Returns:
          dict or list: the most likely intent(s) along with the extracted
          slots. See :func:`.parsing_result` and :func:`.extraction_result`
          for the output format.
  
      Raises:
          NotTrained: when the intent parser is not fitted
      """
      if isinstance(intents, str):
          intents = {intents}
      elif isinstance(intents, list):
          intents = list(intents)
  
      if top_n is None:
          intent_result = self.intent_classifier.get_intent(
              text, intents
          )
          intent_name = intent_result[RES_INTENT_NAME]
          if intent_name is not None:
              slots = self.slot_fillers[intent_name].get_slots(text)
          else:
              slots = []
          return parsing_result(text, intent_result, slots)
  
      results = []
      intents_results = self.intent_classifier.get_intents(text)
      for intent_result in intents_results[:top_n]:
          intent_name = intent_result[RES_INTENT_NAME]
          if intent_name is not None:
              slots = self.slot_fillers[intent_name].get_slots(text)
          else:
              slots = []
          results.append(extraction_result(intent_result, slots))
      return results
  
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 4 for calling the ProbabilisticIntentParser obj's underlying member method code with example usage: obj.parse(text, intents, top_n) and returns: results, parsing_result