Ranking Medical Subject Headings using a factor graph model