I looked through part of your source code, and I happened to notice the following at question2sparql.py line 47:
sorted_dict = sorted(queries_dict.iteritems(), key=lambda item: item[1]),
which would sort the iterator in the ascending order of the query strings.
According to the comment above this line, I guess you might be thinking of the following instead:
sorted_dict = sorted(queries_dict.iteritems(), key = lambda item: item[0], reverse = True),
which would sort the iterator in the descending order of the number of key words matched.
I looked through part of your source code, and I happened to notice the following at question2sparql.py line 47:
sorted_dict = sorted(queries_dict.iteritems(), key=lambda item: item[1])
, which would sort the iterator in the ascending order of the query strings. According to the comment above this line, I guess you might be thinking of the following instead:sorted_dict = sorted(queries_dict.iteritems(), key = lambda item: item[0], reverse = True)
, which would sort the iterator in the descending order of the number of key words matched.