class_docstr: A single QA candidate answer.
docstr: :param answer_type: The category that this answer falls into e.g. "no_answer", "yes", "no" or "span"
  :param score: The score representing the model's confidence of this answer
  :param offset_answer_start: The index of the start of the answer span (whether it is char or tok is stated in self.offset_unit)
  :param offset_answer_end: The index of the start of the answer span (whether it is char or tok is stated in self.offset_unit)
  :param offset_unit: States whether the offsets refer to character or token indices
  :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 probability: The probability the model assigns to the answer
  :param n_passages_in_doc: Number of passages that make up the document
  :param passage_id: The id of the passage which contains this candidate answer
  :param confidence: The (calibrated) confidence score representing the model's predicted accuracy of the index of the start of the answer span
docstr_tok: [":","param","answer_type",":","The","category","that","this","answer","falls","into","e.g",".","``","no_answer","''",",","``","yes","''",",","``","no","''","or","``","span","''",":","param","score",":","The","score","representing","the","model","'s","confidence","of","this","answer",":","param","offset_answer_start",":","The","index","of","the","start","of","the","answer","span","(","whether","it","is","char","or","tok","is","stated","in","self.offset_unit",")",":","param","offset_answer_end",":","The","index","of","the","start","of","the","answer","span","(","whether","it","is","char","or","tok","is","stated","in","self.offset_unit",")",":","param","offset_unit",":","States","whether","the","offsets","refer","to","character","or","token","indices",":","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","probability",":","The","probability","the","model","assigns","to","the","answer",":","param","n_passages_in_doc",":","Number","of","passages","that","make","up","the","document",":","param","passage_id",":","The","id","of","the","passage","which","contains","this","candidate","answer",":","param","confidence",":","The","(","calibrated",")","confidence","score","representing","the","model","'s","predicted","accuracy","of","the","index","of","the","start","of","the","answer","span"]
code: def __init__(
      self,
      answer_type: str,
      score: str,
      offset_answer_start: int,
      offset_answer_end: int,
      offset_unit: str,
      aggregation_level: str,
      probability: float = None,
      n_passages_in_doc: int = None,
      passage_id: str = None,
      confidence: float = None,
  ):
      """
      :param answer_type: The category that this answer falls into e.g. "no_answer", "yes", "no" or "span"
      :param score: The score representing the model's confidence of this answer
      :param offset_answer_start: The index of the start of the answer span (whether it is char or tok is stated in self.offset_unit)
      :param offset_answer_end: The index of the start of the answer span (whether it is char or tok is stated in self.offset_unit)
      :param offset_unit: States whether the offsets refer to character or token indices
      :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 probability: The probability the model assigns to the answer
      :param n_passages_in_doc: Number of passages that make up the document
      :param passage_id: The id of the passage which contains this candidate answer
      :param confidence: The (calibrated) confidence score representing the model's predicted accuracy of the index of the start of the answer span
      """
  
      # self.answer_type can be "no_answer", "yes", "no" or "span"
      self.answer_type = answer_type
      self.score = score
      self.probability = probability
  
      # If self.answer_type is "span", self.answer is a string answer (generated by self.span_to_string())
      # Otherwise, it is None
      self.answer = None
      self.offset_answer_start = offset_answer_start
      self.offset_answer_end = offset_answer_end
  
      # If self.answer_type is in ["yes", "no"] then self.answer_support is a text string
      # If self.answer is a string answer span or self.answer_type is "no_answer", answer_support is None
      self.answer_support = None
      self.offset_answer_support_start = None
      self.offset_answer_support_end = None
  
      # self.context is the document or passage where the answer is found
      self.context_window = None
      self.offset_context_window_start = None
      self.offset_context_window_end = None
  
      # Offset unit is either "token" or "char"
      # Aggregation level is either "doc" or "passage"
      self.offset_unit = offset_unit
      self.aggregation_level = aggregation_level
  
      self.n_passages_in_doc = n_passages_in_doc
      self.passage_id = passage_id
      self.confidence = confidence
  
      # This attribute is used by Haystack to store sample metadata
      self.meta = None
  
imports: from typing import List, Any
  from abc import ABC
  import logging
label_desc: Use image node_id 1 to create a new QACandidate object  with example: obj = QACandidate(answer_type, score, offset_answer_start, offset_answer_end, offset_unit, aggregation_level, probability, n_passages_in_doc, passage_id, confidence)