code: def entity_labels(
      name: str,
      query: Optional[str] = None,
      compute_for: Union[str, ComputeFor] = Predictions,
      labels: int = 50,
  ) -> MetricSummary:
      """Computes the entity labels distribution
  
      Args:
          name: The dataset name.
          query: An ElasticSearch query with the
              `query string syntax <https://docs.argilla.io/en/latest/practical_guides/filter_dataset.html>`_
          compute_for: Metric can be computed for annotations or predictions. Accepted values are
              ``Annotations`` and ``Predictions``. Default to ``Predictions``
          labels: The number of top entities to retrieve. Lower numbers will be better performants
  
      Returns:
          The summary for entity tags distribution
  
      Examples:
          >>> from argilla.metrics.token_classification import entity_labels
          >>> summary = entity_labels(name="example-dataset", labels=20)
          >>> summary.visualize() # will plot a bar chart with results
          >>> summary.data # The top-20 entity tags
      """
      metric = singleton.active_api().compute_metric(
          name,
          metric=f"{_check_compute_for(compute_for)}_entity_labels",
          query=query,
          size=labels,
      )
  
      return MetricSummary.new_summary(
          data=metric.results,
          visualization=lambda: helpers.bar(
              metric.results,
              title=metric.description,
          ),
      )
  
imports: import warnings
  from enum import Enum
  from typing import Optional, Set, Union
  import deprecated
  from argilla.client import singleton
  from argilla.metrics import helpers
  from argilla.metrics.models import MetricSummary
label_desc: Use image node_id 7 for calling a global function with example usage: entity_labels(name, query, compute_for, labels) and returns: MetricSummary