import csv


def load_documents(filename, text_field='text', url_field='url'):
    """
    Load documents from CSV.

    The CSV file should have a column header containing url and text.
    """
    with open(filename) as f:
        reader = csv.DictReader(f)
        raw_documents = list(reader)

    return [{'base_path': doc[url_field], 'text': doc[text_field]} for doc in raw_documents if doc[text_field] != '']