class_docstr: Check for under annotated data segments.
docstr: Run check.
docstr_tok: ["Run","check","."]
code: def run_logic(self, context: Context, dataset_kind) -> CheckResult:
      """Run check."""
      text_data = context.get_data_by_kind(dataset_kind)
      text_data = text_data.sample(
          self.n_samples, random_state=context.random_state
      )
  
      features, cat_features = get_relevant_data_table(
          text_data,
          data_type=self.segment_by,
          columns=self.columns,
          ignore_columns=self.ignore_columns,
          n_top_features=self.n_top_features,
      )
  
      score_per_sample = pd.Series(
          [1 - is_label_none(x) for x in text_data.label],
          index=features.index,
      )
      annotation_ratio = round(
          score_per_sample.sum() * 100 / text_data.n_samples, 2
      )
      if annotation_ratio > self.annotation_ratio_threshold:
          display_msg = (
              f"Under annotated {self.segment_by} segments check is skipped since your data "
              f"annotation ratio is > {self.annotation_ratio_threshold}%. Try increasing the "
              "annotation_ratio_threshold parameter."
          )
          return CheckResult(
              value={"message": display_msg}, display=[display_msg]
          )
  
      if text_data.n_samples < MIN_TEXT_SAMPLES:
          raise NotEnoughSamplesError(
              f"Not enough samples to calculate under annotated {self.segment_by} "
              "segments. Minimum 10 samples required."
          )
  
      encoded_dataset = (
          self._target_encode_categorical_features_fill_na(
              features, score_per_sample, cat_features
          )
      )
  
      avg_score = round(score_per_sample.mean(), 3)
      weak_segments = self._weak_segments_search(
          data=encoded_dataset.features_columns,
          score_per_sample=score_per_sample,
          scorer_name="Annotation Ratio",
          multiple_segments_per_feature=self.multiple_segments_per_feature,
      )
  
      if len(weak_segments) == 0:
          display_msg = (
              "Check was unable to find under annotated segments. Try "
              f"supplying more {self.segment_by}."
          )
          return CheckResult(
              value={"message": display_msg}, display=[display_msg]
          )
  
      check_result_value = self._generate_check_result_value(
          weak_segments, cat_features, avg_score
      )
      display_msg = (
          f"Showcasing intersections of {self.segment_by} that result in the most "
          f"under annotated segments.<br> The "
          "full list of under annotated segments can be observed in the check result value. "
      )
      display_fig = self._generate_scatter_plot_display(
          encoded_dataset.features_columns,
          score_per_sample,
          text_data.text,
          weak_segments,
          avg_score,
      )
      return CheckResult(
          value=check_result_value, display=[display_msg, display_fig]
      )
  
imports: from typing import Dict, List, Optional, Tuple, Union
  import numpy
  import pandas
  import plotly.graph_objects
  from deepchecks import ConditionCategory, ConditionResult
  from deepchecks.core import CheckResult
  from deepchecks.core.check_result import DisplayMap
  from deepchecks.core.errors import NotEnoughSamplesError
  from deepchecks.nlp import Context, SingleDatasetCheck
  from deepchecks.nlp.utils.text import break_to_lines_and_trim
  from deepchecks.nlp.utils.weak_segments import get_relevant_data_table
  from deepchecks.utils.abstracts.weak_segment_abstract import WeakSegmentAbstract
  from deepchecks.utils.metrics import is_label_none
  from deepchecks.utils.strings import format_percent
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 2 for calling the UnderAnnotatedSegments obj's underlying member method code with example usage: obj.run_logic(context, dataset_kind) and returns: CheckResult, CheckResult, CheckResult