class_docstr: Check for under annotated data segments.
docstr: Add condition - check that the in all segments annotation ratio is above the provided threshold.
  
  Parameters
  ----------
  threshold : float , default: 0.20
      maximal ratio of change allowed between the average score and the score of the weakest segment.
docstr_tok: ["Add","condition","-","check","that","the","in","all","segments","annotation","ratio","is","above","the","provided","threshold",".","Parameters","--","--","--","--","--","threshold",":","float",",","default",":","0.20","maximal","ratio","of","change","allowed","between","the","average","score","and","the","score","of","the","weakest","segment","."]
code: def add_condition_segments_annotation_ratio_greater_than(
      self, threshold: float = 0.70
  ):
      """Add condition - check that the in all segments annotation ratio is above the provided threshold.
  
      Parameters
      ----------
      threshold : float , default: 0.20
          maximal ratio of change allowed between the average score and the score of the weakest segment.
      """
  
      def condition(result: Dict) -> ConditionResult:
          weakest_segment_score = result["weak_segments_list"].iloc[
              0, 0
          ]
          msg = f"Most under annotated segment has annotation ratio of {format_percent(weakest_segment_score)}."
          if weakest_segment_score > threshold:
              return ConditionResult(ConditionCategory.PASS, msg)
          else:
              return ConditionResult(ConditionCategory.FAIL, msg)
  
      return self.add_condition(
          f"In all segments annotation ratio should be greater than "
          f"{format_percent(threshold)}.",
          condition,
      )
  
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 5 for calling the UnderAnnotatedSegments obj's underlying member method code with example usage: obj.add_condition_segments_annotation_ratio_greater_than(threshold) and returns: self, ConditionResult, ConditionResult