class_docstr: Generates feature level statistics for natural language stats.
  
  A combiner that computes statistics based on the specified
  natural_language_domain.
class_docstr_tok: ["Generates","feature","level","statistics","for","natural","language","stats",".","A","combiner","that","computes","statistics","based","on","the","specified","natural_language_domain","."]
docstr: Return result of converting accumulator into the output value.
  
  Args:
    accumulator: The final accumulator value.
  
  Returns:
    A proto representing the result of this stats generator.
docstr_tok: ["Return","result","of","converting","accumulator","into","the","output","value",".","Args",":","accumulator",":","The","final","accumulator","value",".","Returns",":","A","proto","representing","the","result","of","this","stats","generator","."]
code: def extract_output(
      self, accumulator: _PartialNLStats
  ) -> statistics_pb2.FeatureNameStatistics:
      """Return result of converting accumulator into the output value.
  
      Args:
        accumulator: The final accumulator value.
  
      Returns:
        A proto representing the result of this stats generator.
      """
      result = statistics_pb2.FeatureNameStatistics()
      if accumulator.invalidate:
          return result
  
      nls = statistics_pb2.NaturalLanguageStatistics()
      if accumulator.total_num_tokens:
          nls.feature_coverage = (
              float(accumulator.num_in_vocab_tokens)
              / accumulator.total_num_tokens
          )
      if accumulator.num_in_vocab_tokens:
          nls.avg_token_length = (
              float(accumulator.sum_in_vocab_token_lengths)
              / accumulator.num_in_vocab_tokens
          )
      if accumulator.min_sequence_length:
          nls.min_sequence_length = accumulator.min_sequence_length
      if accumulator.max_sequence_length:
          nls.max_sequence_length = accumulator.max_sequence_length
      if self._num_quantiles_histogram_buckets:
          _populate_token_length_histogram(
              nls, accumulator, self._num_quantiles_histogram_buckets
          )
          _populate_sequence_length_histogram(
              nls, accumulator, self._num_quantiles_histogram_buckets
          )
      if self._num_rank_histogram_buckets:
          _populate_token_rank_histogram(
              nls, accumulator, self._num_rank_histogram_buckets
          )
      if accumulator.token_statistics:
          for name, stats in accumulator.token_statistics.items():
              _populate_token_statistics(
                  name,
                  self._num_histogram_buckets,
                  accumulator.num_examples,
                  nls.token_statistics.add(),
                  stats,
              )
  
      for r in (
          accumulator.reported_sequences_coverage
          + accumulator.reported_sequences_avg_token_length
      ):
          str_seq = str(r[0])
          nls.reported_sequences.append(str_seq)
      custom_nl_stats = result.custom_stats.add(name="nl_statistics")
      custom_nl_stats.any.Pack(nls)
      return result
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  from typing import Dict, Iterable, List, Optional, Set, Text, Union
  import pyarrow
  import six
  from tensorflow_data_validation import types
  from tensorflow_data_validation.statistics.generators import stats_generator
  from tensorflow_data_validation.utils import quantiles_util
  from tensorflow_data_validation.utils import schema_util
  from tensorflow_data_validation.utils import stats_util
  from tensorflow_data_validation.utils import vocab_util
  from tfx_bsl import sketches
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
  from tfx_bsl.types import tfx_namedtuple
label_desc: Use image node_id 7 for calling the NLStatsGenerator obj's underlying member method code with example usage: obj.extract_output(accumulator) and returns: result, result