def count_target_words(tokens):
    """
    Utility function to count the total number of tokens in a dataset.

    Parameters
    ----------
    tokens : list of lists
        List of sentences, where each sentence is a list of tokens. Usually
        returned from ``data.loader.load_data``

    Returns
    -------
    count : int
        Total number of tokens in the given ``tokens`` structure
    """
    return sum([len(t) for t in tokens["target"]])