class_docstr: DatasetBuilder for beir dataset.
class_docstr_tok: ["DatasetBuilder","for","beir","dataset","."]
docstr: Returns SplitGenerators.
docstr_tok: ["Returns","SplitGenerators","."]
code: def _split_generators(
      self, dl_manager: tfds.download.DownloadManager, pipeline
  ):
      """Returns SplitGenerators."""
      beam = tfds.core.lazy_imports.apache_beam
      # Downloads the data and defines the splits.
      builder_config = self.builder_config
      root = dl_manager.download_and_extract(
          builder_config.download_url
      )
      basename = os.path.basename(builder_config.download_url)
      unzip_dir_name = os.path.splitext(basename)[0]
      subdir = builder_config.subdir if builder_config.subdir else ""
      data_dir = os.path.join(root, unzip_dir_name, subdir)
  
      query_pipeline = (
          pipeline
          | "ReadQueryData"
          >> beam.io.textio.ReadFromText(
              os.path.join(data_dir, "queries.jsonl")
          )
          | "ParseQueryJson" >> beam.Map(_parse_query_json)
      )
  
      passage_pipeline = (
          pipeline
          | "ReadPassageData"
          >> beam.io.textio.ReadFromText(
              os.path.join(data_dir, "corpus.jsonl")
          )
          | "ParsePassageJson" >> beam.Map(_parse_passage_json)
      )
  
      splits = {
          "query": (
              query_pipeline
              | "Query"
              >> beam.ptransform_fn(self._generate_query_examples)()
          ),
          "passage": (
              passage_pipeline
              | "Passage"
              >> beam.ptransform_fn(self._generate_passage_examples)()
          ),
      }
  
      # Creates splits for (query, document) pairs.
      for qrel_split, tsv_file in builder_config.qrel_splits.items():
          splits[
              qrel_split
          ] = pipeline | qrel_split.capitalize() >> beam.ptransform_fn(
              self._generate_qrel_examples
          )(
              qrel_path=os.path.join(data_dir, "qrels", tsv_file),
              query_pipeline=query_pipeline,
              passage_pipeline=passage_pipeline,
          )
  
      return splits
  
imports: from __future__ import annotations
  import functools
  import json
  import os
  from typing import Mapping
  import numpy
  import tensorflow_datasets.public_api
label_desc: Use image node_id 2 for calling the Builder obj's underlying member method code with example usage: obj._split_generators(dl_manager, pipeline) and returns: splits