class_docstr: Find samples that contain tokens unsupported by your tokenizer.
  
  Parameters
  ----------
  tokenizer: t.Any , default: None
      Tokenizer from the HuggingFace transformers library to use for tokenization. If None,
      AutoTokenizer.from_pretrained('bert-base-uncased') will be used.
  group_singleton_words: bool, default: False
      If True, group all words that appear only once in the data into the "Other" category in the display.
  n_most_common : int , default: 5
      Number of most common words with unknown tokens to show in the display.
  n_samples: int, default: 1_000_000
      number of samples to use for this check.
  random_state : int, default: 42
      random seed for all check internals.
  {max_text_length_for_display_param:1*indent}
class_docstr_tok: ["Find","samples","that","contain","tokens","unsupported","by","your","tokenizer",".","Parameters","--","--","--","--","--","tokenizer",":","t.Any",",","default",":","None","Tokenizer","from","the","HuggingFace","transformers","library","to","use","for","tokenization",".","If","None",",","AutoTokenizer.from_pretrained","(","'bert-base-uncased","'",")","will","be","used",".","group_singleton_words",":","bool",",","default",":","False","If","True",",","group","all","words","that","appear","only","once","in","the","data","into","the","``","Other","''","category","in","the","display",".","n_most_common",":","int",",","default",":","5","Number","of","most","common","words","with","unknown","tokens","to","show","in","the","display",".","n_samples",":","int",",","default",":","1_000_000","number","of","samples","to","use","for","this","check",".","random_state",":","int",",","default",":","42","random","seed","for","all","check","internals",".","{","max_text_length_for_display_param:1","*","indent","}"]
docstr: Run check.
docstr_tok: ["Run","check","."]
code: def run_logic(self, context: Context, dataset_kind) -> CheckResult:
      """Run check."""
      dataset = context.get_data_by_kind(dataset_kind).sample(
          self.n_samples, random_state=self.random_state
      )
      dataset = t.cast(TextData, dataset)
      samples = dataset.text
      if len(samples) == 0:
          raise DeepchecksValueError("Dataset cannot be empty")
  
      indices = dataset.get_original_text_indexes()
  
      (
          all_unknown_words_counter,
          total_words,
          unknown_word_indexes,
      ) = self.find_unknown_words(samples, indices)
      if len(all_unknown_words_counter) == 0:
          display = None
          value = {"unknown_word_ratio": 0, "unknown_word_details": {}}
      else:
          fig = self.create_pie_chart(
              all_unknown_words_counter, total_words
          )
          percent_explanation = (
              '<p style="font-size:0.9em;line-height:1;"><i>'
              "Percents shown above are the percent of each word (or group of words) out of all words in the data."
          )
          display = [fig, percent_explanation]
  
          # The value contains two fields - unknown_word_percent and unknown_word_details.
          # The latter contains a dict, in which for each word we have its ratio of the data and the list of indexes
          # of the samples that contain it.
          unknown_word_details = {}
          for word, indexes in unknown_word_indexes.items():
              unknown_word_details[word] = {
                  "ratio": all_unknown_words_counter[word]
                  / total_words,
                  "indexes": indexes,
              }
          value = {
              "unknown_word_ratio": sum(
                  all_unknown_words_counter.values()
              )
              / total_words,
              "unknown_word_details": unknown_word_details,
          }
  
      return CheckResult(value, display=display)
  
imports: import contextlib
  import copy
  import sys
  import typing
  import warnings
  from collections import Counter
  import nltk
  import plotly.graph_objects
  from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.core.errors import DeepchecksProcessError, DeepchecksValueError
  from deepchecks.nlp import Context, SingleDatasetCheck
  from deepchecks.nlp._shared_docs import docstrings
  from deepchecks.nlp.text_data import TextData
  from deepchecks.utils.numbers import round_sig
  from deepchecks.utils.strings import format_list, format_percent, truncate_string
label_desc: Use image node_id 3 for calling the UnknownTokens obj's underlying member method code with example usage: obj.run_logic(context, dataset_kind) and returns: CheckResult