Blame view

LDA/03-order_by_perp.py 312 Bytes
b6d0165d1   Killian   Initial commit
1
2
3
4
5
6
7
8
9
10
11
  from tinydb import TinyDB
  import sys 
  def getKey(x):
      return x["asr"]
  
  db = TinyDB(sys.argv[1])
  out_dir=sys.argv[2]
  sorted_model = sorted(db.all(),key=getKey,reverse=True)
  with open("{}/ordered_model.txt".format(out_dir),"w") as out_file:
      for model in sorted_model:
          print >>out_file,model["name"]