Update dataset.py
Browse files5 unmodified lines6789101112131415161718192021222324252627282930313210111213141516171819202122232425262728293033343536373839404119 unmodified lines616263565758596465666768695 unmodified linesclass M3Retrieve(datasets.GeneratorBasedBuilder): VERSION = datasets.Version("1.0.0")
# Define available subfolders (datasets) SUBFOLDERS = [ "Anatomy_and_Physiology", "Cardiology", "Dermatology", "Endocrinology_and_Diabetes", "Gastroenterology", "Hematology", "Microbiology_and_Cell_Biology", "Miscellaneous", "Neurology_and_Neuroscience", "Ophthalmology_and_Sensory_Systems", "Orthopedics_and_Musculoskeletal", "Pharmacology", "Psychiatry_and_Mental_Health", "Pubmed", "Radiology_and_Imaging", "Reproductive_System", "Respiratory_and_Pulmonology", "Surgical_Specialties", ]
# Define Builder Configs for each subfolder BUILDER_CONFIGS = [ datasets.BuilderConfig(name=subfolder, version=VERSION, description=f"Dataset for {subfolder}") for subfolder in [ "Anatomy and Physiology", "Cardiology", "Dermatology", "Endocrinology_and_Diabetes", "Gastroenterology", "Hematology", "Microbiology_and_Cell_Biology", "Miscellaneous", "Neurology_and_Neuroscience", "Ophthalmology_and_Sensory_Systems", "Orthopedics_and_Musculoskeletal", "Pharmacology", "Psychiatry_and_Mental_Health", "Pubmed", "Radiology_and_Imaging", "Reproductive_System", "Respiratory_and_Pulmonology", "Surgical_Specialties", ] datasets.BuilderConfig( name=subfolder, version=VERSION, description=f"Dataset for {subfolder.replace('_', ' ')}" ) for subfolder in SUBFOLDERS ]
def _info(self):19 unmodified lines )
def _split_generators(self, dl_manager): """Returns SplitGenerators.""" dataset_name = self.config.name # Get the selected dataset folder name data_dir = os.path.join(self.config.data_dir, dataset_name) # Set path to selected dataset """Returns SplitGenerators for the selected subfolder""" data_dir = os.path.join(dl_manager.download_and_extract(self.config.data_dir), self.config.name)
return [ datasets.SplitGenerator( name="queries",dataset.py+32-25