





"""simple docstring"""




from dataclasses import dataclass, field
from typing import ClassVar, Dict

from ..features import Features, Sequence, Value
from .base import TaskTemplate
@dataclass(frozen=__lowercase				)
class     SCREAMING_SNAKE_CASE       (__lowercase				):
   _UpperCamelCase   :		str			 =	field(default='question-answering-extractive'      ,     metadata={'include_in_asdict_even_if_is_default': True}				)
   _UpperCamelCase   :		ClassVar[Features]			 =	Features({'question': Value('string'				), 'context': Value('string'				)}				)
   _UpperCamelCase   :		ClassVar[Features]			 =	Features(
       {
           'answers': Sequence(
               {
                   'text': Value('string'				),
                   'answer_start': Value('int32'				),
               }				)
       }				)
   _UpperCamelCase   :		str			 =	"question"
   _UpperCamelCase   :		str			 =	"context"
   _UpperCamelCase   :		str			 =	"answers"


   @property
   def 	SCREAMING_SNAKE_CASE_							(   self      :    int	)->       Dict[str, str]:





     """simple docstring"""







     return {self.question_column: "question", self.context_column: "context", self.answers_column: "answers"}









from typing import Callable, Optional

from .. import Features
from ..packaged_modules.generator.generator import Generator
from .abc import AbstractDatasetInputStream
class     SCREAMING_SNAKE_CASE       (UpperCAmelCase				):


   def __init__(   self      :    List[str]      ,					a      :    Callable      ,					a      :    Optional[Features] = None      ,					a      :    str = None      ,					a      :    bool = False      ,					a      :    bool = False      ,					a      :    Optional[dict] = None      ,					a      :    Optional[int] = None      ,					**a      :    str      ,					)->       Tuple:





     """simple docstring"""







     super().__init__(
         features=a      ,					cache_dir=a      ,					keep_in_memory=a      ,					streaming=a      ,					num_proc=a      ,					**a      ,					)
     lowercase__           =  Generator(
         cache_dir=a      ,					features=a      ,					generator=a      ,					gen_kwargs=a      ,					**a      ,					)


   def 	SCREAMING_SNAKE_CASE_							(   self      :    Any	)->       Dict:





     """simple docstring"""







     if self.streaming:
       lowercase__           =  self.builder.as_streaming_dataset(split='train'	)
     # Build regular (map-style) dataset
     else:
       lowercase__           =  None
       lowercase__           =  None
       lowercase__           =  None
       lowercase__           =  None

       self.builder.download_and_prepare(
           download_config=a      ,					download_mode=a      ,					verification_mode=a      ,					base_path=a      ,					num_proc=self.num_proc      ,					)
       lowercase__           =  self.builder.as_dataset(
           split='train'      ,					verification_mode=a      ,					in_memory=self.keep_in_memory	)
     return dataset


