'Calculate the relevance score of a channel from the database.
The algorithm used is a very stripped-down version of BM25 where only the matching terms are counted.'

@staticmethod
def calculate_score_channel(keywords, channel_name, channel_description):

    values = [channel_name, channel_description]
    scores = []
    for col_ind in xrange(2):
        score = 0
        for keyword in keywords:
            term_freq = values[col_ind].lower().count(keyword)
            right_side = ((term_freq * (1.2 + 1)) / (term_freq + 1.2))
            score += right_side
        scores.append(score)
    return ((0.8 * scores[0]) + (0.2 * scores[1]))
