def _compute_metrics(tp, fp, fn):
    """Computes precision, recall and f1-score from count of TP, TN and FN.
    
    Args:
        tp (int): The number of true positives.
        fp (int): The number of false positives.
        fn (int): The number of false negatives.
        
    Returns:
        dict (str -> float): Dictionary including 'precision', 'recall' and 
            'f1_score'.
    """
    res = {}
    res['precision']=tp/(tp+fp)
    res['recall']=tp/(tp+fn)
    res['f1_score']=2*res['precision']*res['recall']/(res['precision']+res['recall'])
    return res