def METHOD_NAME(df, labels_dict):
    # text element fields are extracted from the dataframe, with the exception of the labels, which are stored elsewhere
    element_data_columns = list(TextElement.get_field_names() - {'category_to_label'})
    element_dicts = map(lambda row: dict(zip(element_data_columns, row)), df[element_data_columns].values)
    text_elements = [LabeledTextElement(**d, category_to_label=labels_dict.get(d['uri'], {}).copy())
                     for d in element_dicts]
    return text_elements