Fix phantom exclusion in bottom pageranks
This commit is contained in:
parent
c125bdbe69
commit
6f51bde2cc
10
src/build.py
10
src/build.py
|
@ -259,13 +259,9 @@ def build_statistics_page(page, articles):
|
||||||
content += "</div>\n"
|
content += "</div>\n"
|
||||||
|
|
||||||
# Lowest pagerank of written articles
|
# Lowest pagerank of written articles
|
||||||
G = networkx.Graph()
|
exclude = [a.title for a in articles if a.player is None]
|
||||||
for article in articles:
|
rank_by_written_only = {k:v for k,v in rank_by_article.items() if k in exclude}
|
||||||
for citation in article.citations:
|
pageranks = reverse_statistics_dict(rank_by_written_only)
|
||||||
if citation.article.player is not None:
|
|
||||||
G.add_edge(article.title, citation.target)
|
|
||||||
rank_by_article = networkx.pagerank(G)
|
|
||||||
pageranks = reverse_statistics_dict(rank_by_article)
|
|
||||||
bot_ranked = list(enumerate(map(lambda x: x[1], pageranks), start=1))[-10:]
|
bot_ranked = list(enumerate(map(lambda x: x[1], pageranks), start=1))[-10:]
|
||||||
# Format the ranks into strings
|
# Format the ranks into strings
|
||||||
bot_ranked_items = itemize(bot_ranked)
|
bot_ranked_items = itemize(bot_ranked)
|
||||||
|
|
Loading…
Reference in New Issue