def split_datasets(data):
    """Split the dataset into train, valid, test sets.

    Args:
        data: A list of titles, abstracts, dates, sorted by dates.

    Returns:
        Train, valid, test sets.
    """
    train_text = data[:-9880]
    eval_text = data[-9880:]
    valid_test_ratio = 0.5
    valid_text = eval_text[: int(len(eval_text) * valid_test_ratio)]
    test_text = eval_text[int(len(eval_text) * valid_test_ratio) :]
    assert len(train_text) == 90000
    assert len(valid_text) == 4940
    assert len(test_text) == 4940
    return (train_text, valid_text, test_text)