class_docstr: A set of QA predictions for a passage or a document. The candidates are stored in QAPred.prediction which is a
  list of QACandidate objects. Also contains all attributes needed to convert the object into json format and also
  to create a context window for a UI
docstr: :param id: The id of the passage or document
  :param prediction: A list of QACandidate objects for the given question and document
  :param context: The text passage from which the answer can be extracted
  :param question: The question being posed
  :param token_offsets: A list of ints indicating the start char index of each token
  :param context_window_size: The number of chars in the text window around the answer
  :param aggregation_level: States whether this candidate and its indices are on a passage level (pre aggregation) or on a document level (post aggregation)
  :param no_answer_gap: How much the QuestionAnsweringHead.no_ans_boost needs to change to turn a no_answer to a positive answer
  :param ground_truth_answer: Ground truth answers
  :param answer_types: List of answer_types supported by this task e.g. ["span", "yes_no", "no_answer"]
docstr_tok: [":","param","id",":","The","id","of","the","passage","or","document",":","param","prediction",":","A","list","of","QACandidate","objects","for","the","given","question","and","document",":","param","context",":","The","text","passage","from","which","the","answer","can","be","extracted",":","param","question",":","The","question","being","posed",":","param","token_offsets",":","A","list","of","ints","indicating","the","start","char","index","of","each","token",":","param","context_window_size",":","The","number","of","chars","in","the","text","window","around","the","answer",":","param","aggregation_level",":","States","whether","this","candidate","and","its","indices","are","on","a","passage","level","(","pre","aggregation",")","or","on","a","document","level","(","post","aggregation",")",":","param","no_answer_gap",":","How","much","the","QuestionAnsweringHead.no_ans_boost","needs","to","change","to","turn","a","no_answer","to","a","positive","answer",":","param","ground_truth_answer",":","Ground","truth","answers",":","param","answer_types",":","List","of","answer_types","supported","by","this","task","e.g",".","[","``","span","''",",","``","yes_no","''",",","``","no_answer","''","]"]
code: def __init__(
      self,
      id: str,
      prediction: List[QACandidate],
      context: str,
      question: str,
      token_offsets: List[int],
      context_window_size: int,
      aggregation_level: str,
      no_answer_gap: float,
      ground_truth_answer: str = None,
      answer_types: List[str] = [],
  ):
      """
      :param id: The id of the passage or document
      :param prediction: A list of QACandidate objects for the given question and document
      :param context: The text passage from which the answer can be extracted
      :param question: The question being posed
      :param token_offsets: A list of ints indicating the start char index of each token
      :param context_window_size: The number of chars in the text window around the answer
      :param aggregation_level: States whether this candidate and its indices are on a passage level (pre aggregation) or on a document level (post aggregation)
      :param no_answer_gap: How much the QuestionAnsweringHead.no_ans_boost needs to change to turn a no_answer to a positive answer
      :param ground_truth_answer: Ground truth answers
      :param answer_types: List of answer_types supported by this task e.g. ["span", "yes_no", "no_answer"]
      """
      super().__init__(id, prediction, context)
      self.question = question
      self.token_offsets = token_offsets
      self.context_window_size = context_window_size
      self.aggregation_level = aggregation_level
      self.answer_types = answer_types
      self.ground_truth_answer = ground_truth_answer
      self.no_answer_gap = no_answer_gap
      self.n_passages = self.prediction[0].n_passages_in_doc
      for qa_candidate in self.prediction:
          qa_candidate.set_answer_string(token_offsets, self.context)
          qa_candidate.set_context_window(
              self.context_window_size, self.context
          )
  
imports: from typing import List, Any
  from abc import ABC
  import logging
label_desc: Use image node_id 1 to create a new QAPred object from inherited base classes: Pred with example: obj = QAPred(id, prediction, context, question, token_offsets, context_window_size, aggregation_level, no_answer_gap, ground_truth_answer, answer_types)