def loglinear_rule_weight(feature_dict, feature_weights_dict):
    """
    Compute log linear feature weight of a rule by summing the products of feature values and feature weights.
    :param feature_dict: Dictionary of features and their values
    :param feature_weights_dict: Dictionary of features and their weights
    :return: Rule weight
    """

    rule_weight = 0.0

    # Only the features present in both dictionaries affect the score
    for feature_name in feature_dict:
        if feature_name in feature_weights_dict:
            rule_weight += feature_dict[feature_name] * feature_weights_dict[feature_name]

    return rule_weight