Skip to content

Commit

Permalink
Generates top k tags in database
Browse files Browse the repository at this point in the history
  • Loading branch information
nishnik committed Apr 11, 2016
1 parent 7e4571e commit 76508ef
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions scripts/top_k_tags.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import json, collections

with open('clean.json') as data_file:
a = json.load(data_file)# type(data)=dict

c = []
total = 0
for i in a:
for j in a[i]:
c.append(j)
total = total + len(a[i])
counts = collections.Counter(c)



n = 5000
for word, count in counts.most_common(n):
print("{0}".format(word))

0 comments on commit 76508ef

Please sign in to comment.