import csv


def create_idf_dict() -> dict:
    """Returns the idf_dict from tstar_idf.txt"""
    with open("climate_keywords/tstar_idf.txt", "r", encoding='utf-8', errors='ignore') as f:
        reader = csv.reader(f)
        idf_dict = {}
        for term, idf in reader:
            idf_dict[term] = float(idf)
    return idf_dict