class_docstr: Old segment -> revised segment.
  
  Data filtration heuristics:
    wiki_revision_max_page_size_exp:
      pages above this # of bytes are thrown out
  
    wiki_revision_revision_skip_factor:
      rate of logarithmic downsampling of revision history list
  
    wiki_revision_percent_identical_examples:
      how many identitcal examples to admit, as percent of total examples
  
    wiki_revision_introduce_errors:
      whether or not to introduce spelling-type errors on the source side
  
    wiki_revision_max_equal_to_diff_ratio:
      whether or not to introduce spelling-type errors on the source side
  
  
  Vocab size=32k
  Maximum input/target length = 1024 wordpiece tokens
class_docstr_tok: ["Old","segment","-",">","revised","segment",".","Data","filtration","heuristics",":","wiki_revision_max_page_size_exp",":","pages","above","this","#","of","bytes","are","thrown","out","wiki_revision_revision_skip_factor",":","rate","of","logarithmic","downsampling","of","revision","history","list","wiki_revision_percent_identical_examples",":","how","many","identitcal","examples","to","admit",",","as","percent","of","total","examples","wiki_revision_introduce_errors",":","whether","or","not","to","introduce","spelling-type","errors","on","the","source","side","wiki_revision_max_equal_to_diff_ratio",":","whether","or","not","to","introduce","spelling-type","errors","on","the","source","side","Vocab","size=32k","Maximum","input\/target","length","=","1024","wordpiece","tokens"]
code: def aggregate_job_stats(self):
      # Aggregate job stats for output.
      stat = []
      # Run stats.
      stat.append(
          "Flags for job:\n"
          "Dev shards: {}\n"
          "Train shards: {}\n"
          "Revision skip factor: {}\n"
          "Max page size: 2**{}\n"
          "Introduce errors: {}\n"
          "Max edit ratio: {}\n"
          "Percent Identical Examples: {}\n"
          "".format(
              FLAGS.wiki_revision_num_dev_shards,
              FLAGS.wiki_revision_num_train_shards,
              FLAGS.wiki_revision_revision_skip_factor,
              FLAGS.wiki_revision_max_page_size_exp,
              FLAGS.wiki_revision_introduce_errors,
              FLAGS.wiki_revision_max_equal_to_diff_ratio,
              FLAGS.wiki_revision_percent_identical_examples,
          )
      )
  
      # File stats.
      stat.append(
          "corpus files: {}\n"
          "\tnames: {}\n"
          "\tpages per input file: {:.1f}\n"
          "".format(
              len(self.corpus_files),
              self.corpus_files,
              (
                  0
                  if not self.corpus_files
                  else self.num_pages / len(self.corpus_files)
              ),
          )
      )
      # Page stats.
      stat.append(
          "pages processed: {}\n"
          "\trevisions per page: {:.2f}, total: {}\n"
          "\trevisions admitted per page: {:.2f}, percent of total: {:.2f}\n"
          "".format(
              self.num_pages,
              (
                  0
                  if not self.num_pages
                  else self.num_revisions_total / self.num_pages
              ),
              self.num_revisions_total,
              (
                  0
                  if not self.num_pages
                  else self.num_revisions_admitted / self.num_pages
              ),
              (
                  0
                  if not self.num_revisions_total
                  else 100
                  * self.num_revisions_admitted
                  / self.num_revisions_total
              ),
          )
      )
      # Revision stats.
      stat.append(
          "revisions admitted: {}\n"
          "\texamples generated per revision: {:.2f}\n"
          "".format(
              self.num_revisions_admitted,
              (
                  0
                  if not self.num_revisions_admitted
                  else self.num_total_examples
                  / self.num_revisions_admitted
              ),
          )
      )
      # Example stats.
      stat.append(
          "examples generated: {}\n"
          "\twith error introduced: {}, percent of total: {:.2f}\n"
          "\ttotal errors introduced: {}, errors per errorred example: {:.2f}\n"
          "\texamples thrown out: {}\n"
          "\t\ttoo long: {}\n"
          "\t\tidentity: {}\n"
          "\t\tedit distance: {}\n"
          "\tremaining identity examples: {}\n"
          "\tratio identity (actual, desired): {:.3f}, {}\n"
          "".format(
              self.num_total_examples,
              self.num_examples_with_introduced_error,
              (
                  0
                  if not self.num_total_examples
                  else 100
                  * self.num_examples_with_introduced_error
                  / self.num_total_examples
              ),
              self.num_introduced_errors,
              (
                  0
                  if not self.num_examples_with_introduced_error
                  else self.num_introduced_errors
                  / self.num_examples_with_introduced_error
              ),
              self.num_examples_thrown_out_too_long
              + self.num_examples_thrown_out_identity
              + self.num_examples_thrown_out_edit_distance,
              self.num_examples_thrown_out_too_long,
              self.num_examples_thrown_out_identity,
              self.num_examples_thrown_out_edit_distance,
              self.num_identity_examples,
              (
                  0
                  if not self.num_total_examples
                  else self.num_identity_examples
                  / self.num_total_examples
              ),
              FLAGS.wiki_revision_percent_identical_examples,
          )
      )
      # Token stats.
      stat.append(
          "tokens generated: {}\n"
          "\tsource: {}\n"
          "\ttarget: {}\n"
          "\tper example: {:.2f}\n"
          "\t\tsource: {:.2f}\n"
          "\t\ttarget: {:.2f}\n"
          "".format(
              self.num_source_tokens + self.num_target_tokens,
              self.num_source_tokens,
              self.num_target_tokens,
              (
                  0
                  if not self.num_total_examples
                  else (self.num_source_tokens + self.num_target_tokens)
                  / self.num_total_examples
              ),
              (
                  0
                  if not self.num_total_examples
                  else self.num_source_tokens / self.num_total_examples
              ),
              (
                  0
                  if not self.num_total_examples
                  else self.num_target_tokens / self.num_total_examples
              ),
          )
      )
      return "\n".join(stat)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import math
  import random
  from absl import flags
  from tensor2tensor.data_generators import generator_utils
  from tensor2tensor.data_generators import text_encoder
  from tensor2tensor.data_generators import text_problems
  from tensor2tensor.data_generators import wiki_revision_utils
  from tensor2tensor.utils import metrics
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 6 for calling the WikiRevision obj's underlying member method code with example usage: obj.aggregate_job_stats() and returns: str