matjojo / tagrank

TagRank is a Hydrus API script that uses MS TrueSkill to figure out which tags you like best.
9 stars 1 forks source link
hydrus

TagRank

is a hydrus API script that uses trueskill to figure out which tags you like best. By making you choose which of two files you like more, over and over again, the trueskill system will figure out which tags you like most. It does this by employing the same ranking algorithm that Microsoft uses for its Xbox online games.

TagRank will show you pairs of files, over and over again. The more comparisons you make the more it learns your preferences. You can stop at any time by pressing the ESCape key, your progress will be saved. Press the left arrow or A key if you prefer the left image, the right arrow or D key for the right, and the down arrow or S key if there is no clear winner. To go back one image pair, press Backspace or the R key. If you need to open the files externally to zoom in or pan you can press the O key. This will open the two files in the default program you have for that file.

TrueSkill uses these comparisons to create normal distributions for the "quality" of each tag, and a confidence score that says how sure it is of these results. TagRank that uses these results to create a representation of this data.

When you are done rating games TagRank will show you the top 20 tags and their skill distributions. The more to the right the distribution for a tag is the better, and the higher it is the more sure TagRank is of that ranking.

Sorting files with your ranked tags

TagRank can also create a sort order for all your images based on the tag rankings that you have created. The more images you rank the better this sort order will be. To do this, run main.py --create_image_ranking.

Using the tag-ranks in your own code

If you want to do more with this data you can read it from the ratings.json file that TagRank creates. This is a json list of [tag_name, [mu, sigma]] objects. mu and sigma are the parameters for the normal distribution of that tags ranking.

TagRank stores a list of your previous comparisons in the comparisons.json file. It contains a list of lists with two file ids. First the winning id, then the losing id. It is possible that some pairs are in this list multiple times, and even in different orders. Since the list is in-order the last comparison between two file ids is the most recent.

Installation

Post-installation setup