class_docstr: A single QA candidate answer.
docstr: Adjust the final QA prediction depending on the prediction of the classification head (e.g. for binary answers in NQ)
  Currently designed so that the QA head's prediction will always be preferred over the Classification head
  
  :param predicted_class: The predicted class e.g. "yes", "no", "no_answer", "span"
docstr_tok: ["Adjust","the","final","QA","prediction","depending","on","the","prediction","of","the","classification","head","(","e.g",".","for","binary","answers","in","NQ",")","Currently","designed","so","that","the","QA","head","'s","prediction","will","always","be","preferred","over","the","Classification","head",":","param","predicted_class",":","The","predicted","class","e.g",".","``","yes","''",",","``","no","''",",","``","no_answer","''",",","``","span","''"]
code: def add_cls(self, predicted_class: str):
      """
      Adjust the final QA prediction depending on the prediction of the classification head (e.g. for binary answers in NQ)
      Currently designed so that the QA head's prediction will always be preferred over the Classification head
  
      :param predicted_class: The predicted class e.g. "yes", "no", "no_answer", "span"
      """
  
      if (
          predicted_class in ["yes", "no"]
          and self.answer != "no_answer"
      ):
          self.answer_support = self.answer
          self.answer = predicted_class
          self.answer_type = predicted_class
          self.offset_answer_support_start = self.offset_answer_start
          self.offset_answer_support_end = self.offset_answer_end
  
imports: from typing import List, Any
  from abc import ABC
  import logging
label_desc: Use image node_id 7 for calling the QACandidate obj's underlying member method code with example usage: obj.add_cls(predicted_class) without return types