code: def _generate_categorical_distribution_plot(data, property_name):
      dist_counts = data.value_counts(normalize=True).to_dict()
      counts = list(dist_counts.values())
      categories_list = list(dist_counts.keys())
      cat_df = pd.DataFrame(
          {property_name: counts},
          index=[un_numpy(cat) for cat in categories_list],
      )
      trace = go.Bar(
          x=cat_df.index,
          y=cat_df[property_name],
          showlegend=False,
          marker={"color": feature_distribution_colors["feature"]},
          hovertemplate="<b>Value:</b> %{x}<br><b>Frequency:</b> %{y}<extra></extra>",
      )
      yaxis_layout = dict(type="log", title="Frequency (Log Scale)")
      xaxis_layout = dict(title=property_name)
      return trace, xaxis_layout, yaxis_layout
  
file_path: deepchecks/deepchecks/nlp/utils/text_data_plot.py
imports: from typing import List, Optional
  import numpy
  import pandas
  import plotly.graph_objs
  from plotly.subplots import make_subplots
  from deepchecks.nlp.task_type import TaskType, TTextLabel
  from deepchecks.nlp.utils.text import break_to_lines_and_trim
  from deepchecks.nlp.utils.text_properties import TEXT_PROPERTIES_DESCRIPTION
  from deepchecks.utils.dataframes import un_numpy
  from deepchecks.utils.distribution.plot import get_density
  from deepchecks.utils.plot import feature_distribution_colors
  from deepchecks.utils.strings import format_percent, get_docs_link
label_desc: Use image node_id 4 for calling a global function with example usage: _generate_categorical_distribution_plot(data, property_name) and returns: trace,  xaxis_layout,  yaxis_layout