from typing import Dict
import ast


def read_labels(filepath: str = "") -> Dict[str, int]:
    """
    Read the file with labels into a dictionary.

    Parameters
    ----------
    filepath : str, optional
        File path, by default ""

    Returns
    -------
    Dict[str, int]
        Labels dictionary, e.g. {"cat": 0, "dog": 1}
    """
    labels = {}

    if filepath != "":
        with open(filepath, "r") as content:
            labels = ast.literal_eval(content.read())

    return labels