code: def _create_hmm_tagger(states, symbols, A, B, pi):
      def pd(values, samples):
          d = dict(zip(samples, values))
          return DictionaryProbDist(d)
  
      def cpd(array, conditions, samples):
          d = {}
          for values, condition in zip(array, conditions):
              d[condition] = pd(values, samples)
          return DictionaryConditionalProbDist(d)
  
      A = cpd(A, states, states)
      B = cpd(B, states, symbols)
      pi = pd(pi, states)
      return HiddenMarkovModelTagger(
          symbols=symbols,
          states=states,
          transitions=A,
          outputs=B,
          priors=pi,
      )
  
imports: import itertools
  import re
  from nltk.metrics import accuracy
  from nltk.probability import ConditionalFreqDist, ConditionalProbDist, DictionaryConditionalProbDist, DictionaryProbDist, FreqDist, LidstoneProbDist, MLEProbDist, MutableProbDist, RandomProbDist
  from nltk.tag.api import TaggerI
  from nltk.util import LazyMap, unique_list
label_desc: Use image node_id 5 for calling a global function with example usage: _create_hmm_tagger(states, symbols, A, B, pi) and returns: HiddenMarkovModelTagger, DictionaryProbDist, DictionaryConditionalProbDist