from typing import List
from typing import Counter


def remove_rare(sentences: List[List[str]]) -> List[List[str]]:
    """
    Remove rare words (those that appear at most once) from sentences.

    Parameters
    ----------
    sentences:
        List of tokenized sentences.
    """
    counts: Counter = Counter()
    for sentence in sentences:
        counts.update(sentence)
    return [[word for word in sentence if counts[word] > 1] for sentence in sentences]