docstr: Spawns a jupyter visualization for masked language model suggestions
  
  Parameters
  ----------
  templates : str, list, tuple, or dict
      On leaves: templates with {tags}, which will be substituted for mapping in **kwargs
      Must have at least one {mask}. Cannot have {mask} and {mask1}, but can have multiple {mask}s
  **kwargs : type
      See documentation for function 'template'
  
  Returns
  -------
  TemplateEditor
      visualization. Selected suggestions will be in self.selected_suggestions
docstr_tok: ["Spawns","a","jupyter","visualization","for","masked","language","model","suggestions","Parameters","--","--","--","--","--","templates",":","str",",","list",",","tuple",",","or","dict","On","leaves",":","templates","with","{","tags","}",",","which","will","be","substituted","for","mapping","in","*","*","kwargs","Must","have","at","least","one","{","mask","}",".","Can","not","have","{","mask","}","and","{","mask1","}",",","but","can","have","multiple","{","mask","}","s","*","*","kwargs",":","type","See","documentation","for","function","'template'","Returns","--","--","--","-","TemplateEditor","visualization",".","Selected","suggestions","will","be","in","self.selected_suggestions"]
code: def visual_suggest(self, templates, **kwargs):
      """Spawns a jupyter visualization for masked language model suggestions
  
      Parameters
      ----------
      templates : str, list, tuple, or dict
          On leaves: templates with {tags}, which will be substituted for mapping in **kwargs
          Must have at least one {mask}. Cannot have {mask} and {mask1}, but can have multiple {mask}s
      **kwargs : type
          See documentation for function 'template'
  
      Returns
      -------
      TemplateEditor
          visualization. Selected suggestions will be in self.selected_suggestions
  
      """
      tagged_keys = find_all_keys(templates)
      template_strs = get_all_strings_ordered(templates)
      items = self._get_fillin_items(tagged_keys, max_count=5, **kwargs)
  
      kwargs["verbose"] = False
      mask_suggests = self.suggest(templates, **kwargs)
      if not mask_suggests:
          raise Exception(
              "No valid suggestions for the given template!"
          )
      self.selected_suggestions = []
      return TemplateEditor(
          template_strs=template_strs,
          tagged_keys=tagged_keys,
          tag_dict=items,
          mask_suggests=mask_suggests[:50],
          format_fn=recursive_format,
          select_suggests_fn=self._set_selected_suggestions,
          tokenizer=self.tg.tokenizer,
      )
  
imports: import collections
  import itertools
  import string
  import numpy
  import re
  import copy
  import os
  import json
  import munch
  import pickle
  import csv
  from .viewer.template_editor import TemplateEditor
  from .multilingual import multilingual_params, get_language_code
label_desc: Use image node_id 13 for calling the Editor obj's underlying member method code with example usage: obj.visual_suggest(templates) and returns: TemplateEditor