from typing import Optional


def compute_sif_weights(words_counter: dict, alpha: Optional[float] = 0.001) -> dict:

    """

    A function that computes smooth inverse frequency (SIF) weights based on word frequencies.
    (See "Arora, S., Liang, Y., & Ma, T. (2016). A simple but tough-to-beat baseline for sentence embeddings.")

    Args:
        words_counter: a dictionary {"word": frequency}
        alpha: regularization parameter

    Returns:
        A dictionary {"word": SIF weight}

    """

    sif_dict = {}

    for word, count in words_counter.items():
        sif_dict[word] = alpha / (alpha + count)

    return sif_dict