code: def get_natural_language_statistics_dataframes(
      lhs_statistics: statistics_pb2.DatasetFeatureStatisticsList,
      rhs_statistics: Optional[
          statistics_pb2.DatasetFeatureStatisticsList
      ] = None,
      lhs_name: Text = "lhs_statistics",
      rhs_name: Text = "rhs_statistics",
      allowlist_features: Optional[List[types.FeaturePath]] = None,
      denylist_features: Optional[List[types.FeaturePath]] = None,
  ) -> Optional[
      Dict[
          str,
          Dict[
              Union[int, str],
              Union[Dict[str, pd.DataFrame], pd.DataFrame],
          ],
      ]
  ]:
      """Gets the `NaturalLanguageStatistics` as a dict of pandas.DataFrame.
  
      Each pd.DataFrame can be fed into a plot with little to no manipulation.
  
      For example, to plot the `token_length_histogram` in plot.ly:
      ```
      import pandas a pd
      import plotly
      import tensorflow_data_validation as tfdv
      from tensorflow_data_validation.utils import display_util as tfdv_display_util
  
      data = pd.DataFrame.from_dict({"col": [1, 2, 3]})
      statistics = tfdv.generate_statistics_from_dataframe(data)
  
      df = tfdv_display_util.get_natural_language_statistics_dataframes(statistics)
      hist, bin_edges = np.histogram(df[ds_name][feature_name][
                          'token_length_histogram']['high_values'])
      fig = plotly.graph_objs.Figure(data=[
          plotly.graph_objs.Bar(x=bin_edges, y=hist, name='Histogram'),
      ])
      ```
  
      The resulting dict contains `token_length_histogram` and each token name as
      its keys. For each token, the data frame represents a list of stats as well
      as the token's positions histogram.
  
      Args:
        lhs_statistics: A DatasetFeatureStatisticsList protocol buffer.
        rhs_statistics: An optional DatasetFeatureStatisticsList protocol buffer to
          compare with lhs_statistics.
        lhs_name: Name of the lhs_statistics dataset.
        rhs_name: Name of the rhs_statistics dataset.
        allowlist_features: Set of features to be visualized.
        denylist_features: Set of features to ignore for visualization.
  
      Returns:
        A dict of pandas data frames. Returns None if natural language statistics
        does not exist in the statistics proto.
      """
      combined_statistics = _get_combined_statistics(
          lhs_statistics,
          rhs_statistics,
          lhs_name,
          rhs_name,
          allowlist_features,
          denylist_features,
      )
      nlp_stats = _get_natural_language_statistics(combined_statistics)
      if not nlp_stats:
          return None
  
      result = {}
      for ds_name, features_dict in nlp_stats.items():
          result[ds_name] = {}
          for feature_name, nlp_stat in features_dict.items():
              result[ds_name][feature_name] = {
                  "token_length_histogram": _get_histogram_dataframe(
                      nlp_stat.token_length_histogram
                  ),
                  "token_statistics": _get_token_statistics(
                      list(nlp_stat.token_statistics)
                  ),
              }
      return result
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import base64
  import collections
  import sys
  from typing import Dict, Iterable, List, Optional, Text, Tuple, Union
  import pandas
  from tensorflow_data_validation import types
  from tensorflow_data_validation.skew.protos import feature_skew_results_pb2
  from tensorflow_data_validation.utils import stats_util
  from tensorflow_metadata.proto.v0 import anomalies_pb2
  from tensorflow_metadata.proto.v0 import schema_pb2
  from tensorflow_metadata.proto.v0 import statistics_pb2
label_desc: Use image node_id 13 for calling a global function with example usage: get_natural_language_statistics_dataframes(lhs_statistics, rhs_statistics, lhs_name, rhs_name, allowlist_features, denylist_features) and returns: result, None