class_docstr: Set of triples subject-predicate-object to text.
class_docstr_tok: ["Set","of","triples","subject-predicate-object","to","text","."]
docstr: Yields examples.
docstr_tok: ["Yields","examples","."]
code: def _generate_examples(self, list_files, set_name):
      """Yields examples."""
      for file_path in list_files:
          with tf.io.gfile.GFile(file_path, "r") as f:
              xml_file = etree.parse(f)
              xml_root = xml_file.getroot()
              for entry in list(xml_root)[0]:
                  category = entry.attrib["category"]
                  entry_id = "{}_{}".format(
                      os.path.basename(file_path), entry.attrib["eid"]
                  )
                  triples_set = []
                  target_text_i = 0
                  for child_element in entry:
                      if child_element.tag == "modifiedtripleset":
                          for i, triple in enumerate(child_element):
                              text = triple.text
                              if not text:
                                  continue
                              for header, content in zip(
                                  ["subject", "predicate", "object"],
                                  text.split(" | "),
                              ):
                                  triples_set.append(
                                      {
                                          "column_header": header,
                                          "row_number": i,
                                          "content": content,
                                      }
                                  )
                      elif child_element.tag == "lex":
                          if not triples_set:
                              raise UnexpectedFormatError(
                                  "Found language expresion with no previous triplesets."
                              )
                          yield "{}_#{}".format(
                              entry_id, target_text_i
                          ), {
                              "input_text": {
                                  "table": triples_set,
                                  "context": category,
                              },
                              "target_text": child_element.text,
                          }
                          target_text_i += 1
  
file_path: datasets/tensorflow_datasets/structured/web_nlg/web_nlg.py
imports: from __future__ import annotations
  import os
  import xml.etree.ElementTree
  import numpy
  from tensorflow_datasets.core.utils.lazy_imports_utils import tensorflow
  import tensorflow_datasets.public_api
label_desc: Use image node_id 3 for calling the WebNlg obj's underlying member method code with example usage: obj._generate_examples(list_files, set_name) without return types