Skip to content

Commit e1c7de4

Browse files
authored
Merge pull request #1 from ilvar/relevance_wow
Better relevance
2 parents 7164f60 + bff9428 commit e1c7de4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

runner.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ def get_multigraph(articles):
2828
article_list = articles.split(",")
2929
article_str = "','".join(article_list)
3030
article_str = "'" + article_str + "'"
31-
query = 'WITH [%s] as pages MATCH ((p:Page)<-[:Link]-(o:Page)), (o) <-[:Link]-(q:Page) WHERE p.title in pages With o,count(q) as rel_count RETURN o.title as link_title, rel_count ORDER BY rel_count DESC LIMIT 10'% article_str.replace("_"," ")
31+
query = 'WITH [%s] as pages MATCH ((p:Page)<-[:Link]-(o:Page)), (o) <-[:Link]-(q:Page) ' \
32+
'WHERE p.title in pages AND size(o.title) > 4 AND NOT (o.title IN pages) ' \
33+
'WITH o,count(q) as rel_count RETURN o.title as link_title, rel_count ORDER BY rel_count DESC LIMIT 10' % article_str.replace("_"," ")
34+
3235
results = db.run(query)
3336
nodes = []
3437
rels = []

0 commit comments

Comments
 (0)