class_docstr: A deterministic Intent parser implementation based on a dictionary
  
  This intent parser is very strict by nature, and tends to have a very good
  precision but a low recall. For this reason, it is interesting to use it
  first before potentially falling back to another parser.
class_docstr_tok: ["A","deterministic","Intent","parser","implementation","based","on","a","dictionary","This","intent","parser","is","very","strict","by","nature",",","and","tends","to","have","a","very","good","precision","but","a","low","recall",".","For","this","reason",",","it","is","interesting","to","use","it","first","before","potentially","falling","back","to","another","parser","."]
code: def _parse_top_intents(self, text, top_n, intents=None):
      if isinstance(intents, str):
          intents = {intents}
      elif isinstance(intents, list):
          intents = set(intents)
  
      if top_n < 1:
          raise ValueError(
              "top_n argument must be greater or equal to 1, but got: %s"
              % top_n
          )
  
      results_per_intent = defaultdict(list)
      for text_candidate, entities in self._get_candidates(
          text, intents
      ):
          val = self._map.get(hash_str(text_candidate))
          if val is not None:
              result = self._parse_map_output(
                  text, val, entities, intents
              )
              if result:
                  intent_name = result[RES_INTENT][RES_INTENT_NAME]
                  results_per_intent[intent_name].append(result)
  
      results = []
      for intent_results in itervalues(results_per_intent):
          sorted_results = sorted(
              intent_results, key=lambda res: len(res[RES_SLOTS])
          )
          results.append(sorted_results[0])
  
      # In some rare cases there can be multiple ambiguous intents
      # In such cases, priority is given to results containing fewer slots
      weights = [1.0 / (1.0 + len(res[RES_SLOTS])) for res in results]
      total_weight = sum(weights)
  
      for res, weight in zip(results, weights):
          res[RES_INTENT][RES_PROBA] = weight / total_weight
  
      results = sorted(results, key=lambda r: -r[RES_INTENT][RES_PROBA])
      return results[:top_n]
  
imports: from __future__ import unicode_literals
  import json
  import logging
  from builtins import str
  from collections import defaultdict
  from itertools import combinations
  from pathlib import Path
  from future.utils import iteritems, itervalues
  from snips_nlu_utils import normalize, hash_str
  from snips_nlu.common.log_utils import log_elapsed_time, log_result
  from snips_nlu.common.utils import check_persisted_path, deduplicate_overlapping_entities, fitted_required, json_string
  from snips_nlu.constants import DATA, END, ENTITIES, ENTITY, ENTITY_KIND, INTENTS, LANGUAGE, RES_INTENT, RES_INTENT_NAME, RES_MATCH_RANGE, RES_SLOTS, SLOT_NAME, START, TEXT, UTTERANCES, RES_PROBA
  from snips_nlu.dataset import validate_and_format_dataset, extract_intent_entities
  from snips_nlu.dataset.utils import get_stop_words_whitelist
  from snips_nlu.entity_parser.builtin_entity_parser import is_builtin_entity
  from snips_nlu.exceptions import IntentNotFoundError, LoadingError
  from snips_nlu.intent_parser.intent_parser import IntentParser
  from snips_nlu.pipeline.configs import LookupIntentParserConfig
  from snips_nlu.preprocessing import tokenize_light
  from snips_nlu.resources import get_stop_words
  from snips_nlu.result import empty_result, intent_classification_result, parsing_result, unresolved_slot, extraction_result
label_desc: Use image node_id 7 for calling the LookupIntentParser obj's underlying member method code with example usage: obj._parse_top_intents(text, top_n, intents) and returns: results