algorithm for Wikipedia topic extraction (corrected)