From e8871f823eee7ff863b0ea8147c422854cf6a957 Mon Sep 17 00:00:00 2001 From: Dominik Roth Date: Fri, 11 Feb 2022 12:28:03 +0100 Subject: [PATCH] Also cache, if a wikipage does not exist --- caliGraph.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/caliGraph.py b/caliGraph.py index ae3459e..5317418 100755 --- a/caliGraph.py +++ b/caliGraph.py @@ -789,11 +789,13 @@ def genScores(G, books, calcPagerank=True): def addImageToNode(node, cache, shape='circularImage'): name = node['label'].split(' (')[0] - if not name in cache: + if not name in cache or (cache[name]==False and random.random()<0.05): term = name img = getWikiImage(term) if img: cache[name] = img + else: + cache[name] = False else: img = cache[name] if img: