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 folding a batch of inputs into accumulator.
  
  Args:
    accumulator: The current accumulator.
    feature_path: The path of the feature.
    feature_array: An arrow Array representing a batch of feature values which
      should be added to the accumulator.
  
  Returns:
    The accumulator after updating the statistics for the batch of inputs.
docstr_tok: ["Return","result","of","folding","a","batch","of","inputs","into","accumulator",".","Args",":","accumulator",":","The","current","accumulator",".","feature_path",":","The","path","of","the","feature",".","feature_array",":","An","arrow","Array","representing","a","batch","of","feature","values","which","should","be","added","to","the","accumulator",".","Returns",":","The","accumulator","after","updating","the","statistics","for","the","batch","of","inputs","."]
code: def add_input(
      self,
      accumulator: _PartialNLStats,
      feature_path: types.FeaturePath,
      feature_array: pa.Array,
  ) -> _PartialNLStats:
      """Return result of folding a batch of inputs into accumulator.
  
      Args:
        accumulator: The current accumulator.
        feature_path: The path of the feature.
        feature_array: An arrow Array representing a batch of feature values which
          should be added to the accumulator.
  
      Returns:
        The accumulator after updating the statistics for the batch of inputs.
      """
      if feature_path not in self._valid_feature_paths:
          accumulator.invalidate = True
          return accumulator
  
      feature_type = stats_util.get_feature_type_from_arrow_type(
          feature_path, feature_array.type
      )
      # Ignore null array.
      if feature_type is None:
          return accumulator
  
      if feature_type not in self._feature_type_fns:
          accumulator.invalidate = True
          return accumulator
  
      feature_type_fn = self._feature_type_fns[feature_type]
  
      vocab = None
      rvocab = None
      if self._nld_vocabularies[feature_path]:
          vocab_name = self._nld_vocabularies[feature_path]
          vocab = self._vocabs[vocab_name]
          rvocab = self._rvocabs[vocab_name]
  
      excluded_string_tokens = self._nld_excluded_string_tokens[
          feature_path
      ]
      excluded_int_tokens = self._nld_excluded_int_tokens[feature_path]
      oov_string_tokens = self._nld_oov_string_tokens[feature_path]
      int_tokens = self._nld_specified_int_tokens[feature_path]
      string_tokens = self._nld_specified_str_tokens[feature_path]
      sequence_length_excluded_int_tokens = (
          self._nld_sequence_length_excluded_int_tokens[feature_path]
      )
      sequence_length_excluded_string_tokens = (
          self._nld_sequence_length_excluded_string_tokens[feature_path]
      )
  
      # TODO(b/175875824): Benchmark and optimize performance.
      for row in feature_array.to_pylist():
          if row is not None:
              feature_type_fn(
                  row,
                  accumulator,
                  excluded_string_tokens,
                  excluded_int_tokens,
                  oov_string_tokens,
                  vocab,
                  rvocab,
                  int_tokens,
                  string_tokens,
                  sequence_length_excluded_int_tokens,
                  sequence_length_excluded_string_tokens,
                  self._num_histogram_buckets,
              )
      return accumulator
  
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 4 for calling the NLStatsGenerator obj's underlying member method code with example usage: obj.add_input(accumulator, feature_path, feature_array) and returns: accumulator, accumulator, accumulator, accumulator