Update dataset.py
Browse files5 unmodified lines678910111213141516171819202122232425262728293031323319 unmodified lines535455565758596061625 unmodified linesclass M3Retrieve(datasets.GeneratorBasedBuilder):VERSION = datasets.Version("1.0.0")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",]]def _info(self):19 unmodified lines)def _split_generators(self, dl_manager):"""Returns SplitGenerators."""dataset_name = self.config.name # Get the selected dataset folder namedata_dir = os.path.join(self.config.data_dir, dataset_name) # Set path to selected datasetreturn [datasets.SplitGenerator(name="queries",5 unmodified lines6789101112131415161718192021222324252627282930313233343536373839404119 unmodified lines6162636465666768695 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 subfolderBUILDER_CONFIGS = [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 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