Beispiel #1
0
def get_img_pagerank(diff_img_list):
    pr_matrix = calculate_img_pr_matrix(app, diff_img_list)
    a_matrix = np.array(pr_matrix)
    M = graphMove(a_matrix)
    pr = firstPr(M)
    p = 0.8
    re = pageRank(p, M, pr)
    return re
Beispiel #2
0
def get_txt_pagerank(diff_sentence_list):
    pr_matrix = calculate_txt_pr_matrix(diff_sentence_list)

    a_matrix = np.array(pr_matrix)
    M = graphMove(a_matrix)
    pr = firstPr(M)
    p = 0.8
    re = pageRank(p, M, pr)
    return re
Beispiel #3
0
def get_pagerank(app):
    groups_pr_matrix = calculate_pr_matrix(app)
    pr_list = []
    for i, pr_matrix in enumerate(groups_pr_matrix):
        a_matrix = np.array(pr_matrix)
        M = graphMove(a_matrix)
        pr = firstPr(M)
        p = 0.8
        re = pageRank(p, M, pr)
        pr_list.append(re)
    return pr_list