def METHOD_NAME(workspace_id, dataset_name, data_access, labels_df_to_import: pd.DataFrame,
                             apply_labels_to_duplicate_texts=False) -> Tuple[Dict[str, Dict[str, Dict[str, Label]]],
                                                                             Dict[str, List[str]]]:
    logging.warning("Currently label metadata is ignored")
    if DisplayFields.doc_id in labels_df_to_import.columns:
        labels_df_to_import[DisplayFields.doc_id] = labels_df_to_import[DisplayFields.doc_id].apply(
            lambda x: str(x).replace(URI_SEP, '_'))
    labels_df_to_import[DisplayFields.category_name] = labels_df_to_import[DisplayFields.category_name].apply(str)
    # convert binary labels in dataframe to boolean
    positive_indicators = {LABEL_POSITIVE, str(LABEL_POSITIVE), str(LABEL_POSITIVE).upper(),
                           str(LABEL_POSITIVE).lower(), 1, "1"}
    labels_df_to_import[DisplayFields.label] = labels_df_to_import[DisplayFields.label].apply(
        lambda x: True if x in positive_indicators else False)
    if DisplayFields.label_type not in labels_df_to_import.columns:
        labels_df_to_import[DisplayFields.label_type] = LabelType.Standard.name
    # calling get_element_group_by_texts is the most expensive call on this function and,
    # removing duplicates from the texts iterable significantly reduces its runtime
    texts = labels_df_to_import[DisplayFields.text].unique()
    elements = get_element_group_by_texts(texts, workspace_id, dataset_name, data_access, remove_duplicates=False)   
    # convert Element list into a DataFrame in order to perform the join operation
    query_elements_df = pd.DataFrame(
            [[e.text, e.uri.split('-')[1], e.uri] for e in elements],
            columns=[DisplayFields.text, DisplayFields.doc_id, DisplayFields.uri]
        )
    def has_contradicting_labels(df: pd.DataFrame):
        return df[DisplayFields.label].unique().shape[0] > 1
    # check if the user uploaded contradicting labels
    group_by_cols = [DisplayFields.category_name, DisplayFields.text]
    if not apply_labels_to_duplicate_texts:
        group_by_cols.append(DisplayFields.doc_id)
    contradicting_labels_df = labels_df_to_import.groupby(group_by_cols).filter(has_contradicting_labels)
    contradicting_labels_texts = contradicting_labels_df.reset_index()[DisplayFields.text].unique().tolist()
    contradicting_labels_info = {
        'elements': contradicting_labels_texts
    }
    if apply_labels_to_duplicate_texts:
        # duplicates are dropped because if not too many duplicates will be present on the joined DataFrame
        labels_df_to_import.drop_duplicates(subset=[DisplayFields.category_name, DisplayFields.text], inplace=True)
        df = merge_and_rename_dfs(
                labels_df_to_import, 
                query_elements_df, 
                DisplayFields.text
            )
    else:
        df = merge_and_rename_dfs(
                labels_df_to_import, 
                query_elements_df, 
                [DisplayFields.doc_id, DisplayFields.text]
            )
    category_to_uri_to_label = {}
    for category_name, category_df in df.groupby(DisplayFields.category_name):
        uri_to_label = {row[DisplayFields.uri]:
                            {category_name: Label(label=bool(row[DisplayFields.label]),
                                                  label_type=LabelType[row[DisplayFields.label_type]],
                                                  metadata={} if DisplayFields.label_metadata not in row
                                                  else ast.literal_eval(row[DisplayFields.label_metadata]))}
                        for row in category_df.to_dict("records")}
        category_to_uri_to_label[category_name] = uri_to_label
    return category_to_uri_to_label, contradicting_labels_info