class_docstr: Scientific Papers.
docstr: Yields examples.
code: def _generate_examples(self, path=None):
      """Yields examples."""
      with epath.Path(path).open() as f:
          for line in f:
              # Possible keys are:
              # "article_id": str
              # "article_text": list[str] article (list of paragraphs).
              # "abstract_text": list[str], abstract (list of paragraphs).
              # "section_names": list[str], list of section names.
              # "sections": list[list[str]], list of sections (list of paragraphs)
              d = json.loads(line)
              summary = "\n".join(d["abstract_text"])
              # In original paper, <S> and </S> are not used in vocab during training
              # or during decoding.
              # https://github.com/armancohan/long-summarization/blob/master/data.py#L27
              summary = summary.replace("<S>", "").replace("</S>", "")
              yield d["article_id"], {
                  _DOCUMENT: "\n".join(d["article_text"]),
                  _SUMMARY: summary,
                  "section_names": "\n".join(d["section_names"]),
              }
  
file_path: datasets/tensorflow_datasets/datasets/scientific_papers/scientific_papers_dataset_builder.py
imports: import json
  import os
  from etils import epath
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the Builder obj's underlying member method code with example usage: obj._generate_examples(path) without return types