def gen_ngrams(tokens: list[str], min_n: int, max_n: int) -> list[str]:
    """
    Create all ngrams from `tokens` where n is between `min_n`, `max_n`, inclusive.
    """
    return [
        "_".join(tokens[i : i + n])
        for n in range(min_n, max_n + 1)
        for i in range(len(tokens) - n + 1)
    ]