class_docstr: A constraint on BERT-Score difference.
  
  Args:
      min_bert_score (float), minimum threshold value for BERT-Score
      model_name (str), name of model to use for scoring
      num_layers (int), number of hidden layers in the model
      score_type (str), Pick one of following three choices
  
          -(1) ``precision`` : match words from candidate text to reference text
          -(2) ``recall`` :  match words from reference text to candidate text
          -(3) ``f1``: harmonic mean of precision and recall (recommended)
  
      compare_against_original (bool):
          If ``True``, compare new ``x_adv`` against the original ``x``.
          Otherwise, compare it against the previous ``x_adv``.
code: def __init__(
      self,
      min_bert_score,
      model_name="bert-base-uncased",
      num_layers=None,
      score_type="f1",
      compare_against_original=True,
  ):
      super().__init__(compare_against_original)
      if not isinstance(min_bert_score, float):
          raise TypeError("max_bert_score must be a float")
      if min_bert_score < 0.0 or min_bert_score > 1.0:
          raise ValueError(
              "max_bert_score must be a value between 0.0 and 1.0"
          )
  
      self.min_bert_score = min_bert_score
      self.model = model_name
      self.score_type = score_type
      # Turn off idf-weighting scheme b/c reference sentence set is small
      self._bert_scorer = bert_score.BERTScorer(
          model_type=model_name,
          idf=False,
          device=utils.device,
          num_layers=num_layers,
      )
  
file_path: TextAttack/textattack/constraints/semantics/bert_score.py
imports: import bert_score
  from textattack.constraints import Constraint
  from textattack.shared import utils
label_desc: Use image node_id 1 to create a new BERTScore object from inherited base classes: Constraint with example: obj = BERTScore(min_bert_score, model_name, num_layers, score_type, compare_against_original)