def keywords(name: str, query: Optional[str] = None, size: int = 20) -> MetricSummary:
    """Computes the keywords occurrence distribution in dataset

    Args:
        name:
            The dataset name.
        query:
            An ElasticSearch query with the [query string syntax](https://docs.v1.argilla.io/en/latest/practical_guides/filter_dataset.html)
        size:
            The number of keywords to retrieve. Default to `20`

    Returns:
        The dataset keywords occurrence distribution

    Examples:
        >>> from argilla_v1.metrics.commons import keywords
        >>> summary = keywords(name="example-dataset")
        >>> summary.visualize() # will plot an histogram with results
        >>> summary.data # returns the raw result data
    """
    assert size > 0, ValueError("size must be greater than 0")
    metric = singleton.active_api().compute_metric(
        name,
        metric="words_cloud",
        query=query,
        size=size,
    )

    return MetricSummary.new_summary(
        data=metric.results,
        visualization=lambda: helpers.bar(
            data=metric.results,
            title=metric.description,
        ),
    )
Computes the keywords occurrence distribution in dataset

    Args:
        name:
            The dataset name.
        query:
            An ElasticSearch query with the [query string syntax](https://docs.v1.argilla.io/en/latest/practical_guides/filter_dataset.html)
        size:
            The number of keywords to retrieve. Default to `20`

    Returns:
        The dataset keywords occurrence distribution

    Examples:
        >>> from argilla_v1.metrics.commons import keywords
        >>> summary = keywords(name="example-dataset")
        >>> summary.visualize() # will plot an histogram with results
        >>> summary.data # returns the raw result data
    
argilla-v1/src/argilla_v1/metrics/commons.py