from typing import List


def bert_preprocess(texts: List[str]) -> List[str]:
    """
    Apply preprocessing appropriate for a BERT (or BERT-based) model to a set of texts.

    Args:
      texts: Texts to preprocess.

    Returns:
      List of preprocessed texts.
    """
    # BERT truncates input, so don't pass in more than is needed
    return [text[:512] for text in texts]