class_docstr: A component that locates and extract answers to a given query from Documents. It's used for performing extractive
  QA. The Reader assigns a score to every possible answer span independently of other answer spans.
  This fixes a common issue of other implementations which make comparisons across documents harder by normalizing
  each document's answers independently.
  
  Example usage:
  ```python
  p = Pipeline()
  p.add_component(instance=InMemoryBM25Retriever(document_store=InMemoryDocumentStore()), name="retriever")
  p.add_component(instance=ExtractiveReader(), name="reader")
  p.connect("retriever", "reader")
  question = "Who lives in Berlin?"
  p.run({"retriever": {"query": question}, "reader": {"query": question}})
  ```
docstr: Deserialize this component from a dictionary.
docstr_tok: ["Deserialize","this","component","from","a","dictionary","."]
code: def from_dict(cls, data: Dict[str, Any]) -> "ExtractiveReader":
      """
      Deserialize this component from a dictionary.
      """
      torch_and_transformers_import.check()
      init_params = data.get("init_parameters", {})
      model_kwargs = init_params.get("model_kwargs", {})
      # convert string to torch.dtype
      # 1. torch_dtype and bnb_4bit_compute_dtype can be specified in model_kwargs
      for key, value in model_kwargs.items():
          if key in [
              "torch_dtype",
              "bnb_4bit_compute_dtype",
          ] and value.startswith("torch."):
              data["init_parameters"]["model_kwargs"][key] = getattr(
                  torch, value.strip("torch.")
              )
      # 2. bnb_4bit_compute_dtype can be specified in model_kwargs["quantization_config"]
      quantization_config = model_kwargs.get("quantization_config", {})
      bnb_4bit_compute_dtype = quantization_config.get(
          "bnb_4bit_compute_dtype", None
      )
      if isinstance(
          bnb_4bit_compute_dtype, str
      ) and bnb_4bit_compute_dtype.startswith("torch."):
          data["init_parameters"]["model_kwargs"][
              "quantization_config"
          ]["bnb_4bit_compute_dtype"] = getattr(
              torch, bnb_4bit_compute_dtype.strip("torch.")
          )
  
      return default_from_dict(cls, data)
  
imports: from pathlib import Path
  from typing import Any, Dict, List, Optional, Tuple, Union
  import math
  import warnings
  import logging
  from haystack import component, default_to_dict, default_from_dict, ComponentError, Document, ExtractedAnswer
  from haystack.lazy_imports import LazyImport
  from haystack.utils import get_device
label_desc: Use image node_id 4 for calling the ExtractiveReader obj's underlying member method code with example usage: obj.from_dict(cls, data) and returns: default_from_dict