Score.html 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. <!DOCTYPE html>
  2. <html dir="ltr">
  3. <head>
  4. <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
  5. <title>App/Search/Score - XOWA</title>
  6. <link rel="shortcut icon" href="https://gnosygnu.github.io/xowa/xowa_logo.png" />
  7. <link rel="stylesheet" href="https://gnosygnu.github.io/xowa/xowa_common.css" type="text/css">
  8. </head>
  9. <body class="mediawiki ltr sitedir-ltr ns-0 ns-subject skin-vector action-submit vector-animateLayout" spellcheck="false">
  10. <div id="mw-page-base" class="noprint"></div>
  11. <div id="mw-head-base" class="noprint"></div>
  12. <div id="content" class="mw-body">
  13. <h1 id="firstHeading" class="firstHeading"><span>App/Search/Score</span></h1>
  14. <div id="bodyContent" class="mw-body-content">
  15. <div id="siteSub">From XOWA: the free, open-source, offline wiki application</div>
  16. <div id="contentSub"></div>
  17. <div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr">
  18. <p>
  19. XOWA calculates a score to every page for the purpose of ranking search results.
  20. </p>
  21. <div id="toc" class="toc">
  22. <div id="toctitle">
  23. <h2>
  24. Contents
  25. </h2>
  26. </div>
  27. <ul>
  28. <li class="toclevel-1 tocsection-1">
  29. <a href="#Overview"><span class="tocnumber">1</span> <span class="toctext">Overview</span></a>
  30. </li>
  31. <li class="toclevel-1 tocsection-2">
  32. <a href="#Scaling_.2F_Ranking"><span class="tocnumber">2</span> <span class="toctext">Scaling / Ranking</span></a>
  33. <ul>
  34. <li class="toclevel-2 tocsection-3">
  35. <a href="#Scaling"><span class="tocnumber">2.1</span> <span class="toctext">Scaling</span></a>
  36. </li>
  37. <li class="toclevel-2 tocsection-4">
  38. <a href="#Ranking"><span class="tocnumber">2.2</span> <span class="toctext">Ranking</span></a>
  39. </li>
  40. </ul>
  41. </li>
  42. <li class="toclevel-1 tocsection-5">
  43. <a href="#Calculation"><span class="tocnumber">3</span> <span class="toctext">Calculation</span></a>
  44. <ul>
  45. <li class="toclevel-2 tocsection-6">
  46. <a href="#PageRank"><span class="tocnumber">3.1</span> <span class="toctext">PageRank</span></a>
  47. </li>
  48. <li class="toclevel-2 tocsection-7">
  49. <a href="#Short_pages_are_penalized"><span class="tocnumber">3.2</span> <span class="toctext">Short pages are penalized</span></a>
  50. </li>
  51. <li class="toclevel-2 tocsection-8">
  52. <a href="#Scores_are_re-scaled"><span class="tocnumber">3.3</span> <span class="toctext">Scores are re-scaled</span></a>
  53. </li>
  54. </ul>
  55. </li>
  56. </ul>
  57. </div>
  58. <h2>
  59. <span class="mw-headline" id="Overview">Overview</span>
  60. </h2>
  61. <p>
  62. From a broad perspective, the following happens:
  63. </p>
  64. <ul>
  65. <li>
  66. A <a href="https://en.wikipedia.org/wiki/PageRank" rel="nofollow" class="external text">PageRank</a> score is calculated for a page. This score is <a href="https://en.wikipedia.org/wiki/Feature_scaling" rel="nofollow" class="external text">scaled</a> from 0 to 1,000,000
  67. </li>
  68. <li>
  69. A page-length score is then calculated for the page. This score is <a href="https://en.wikipedia.org/wiki/Percentile_rank" rel="nofollow" class="external text">ranked</a> from 0 to 1,000,000
  70. </li>
  71. <li>
  72. The PageRank score is then multiplied by a ratio if it has a low page-length score
  73. </li>
  74. <li>
  75. The resulting PageRank score is then ranked from 0 to 1,000,000.
  76. </li>
  77. </ul>
  78. <p>
  79. <br>
  80. </p>
  81. <h2>
  82. <span class="mw-headline" id="Scaling_.2F_Ranking">Scaling / Ranking</span>
  83. </h2>
  84. <p>
  85. XOWA uses "scaling" and "ranking" at various stages to calculate the score.
  86. </p>
  87. <h3>
  88. <span class="mw-headline" id="Scaling">Scaling</span>
  89. </h3>
  90. <p>
  91. A simplified definition of scaling is converting a number from one range to another range based on proportion. For a more thorough definition, see <a href="https://en.wikipedia.org/wiki/Feature_scaling" rel="nofollow" class="external text">the Wikipedia page on feature scaling</a>
  92. </p>
  93. <p>
  94. For example, let's say you have a score of 100 in a range of 0 to 400 and want to scale it to 0 to 1000. The following steps would be involved:
  95. </p>
  96. <ul>
  97. <li>
  98. Take 100 and divide it by 400. This yields .25
  99. </li>
  100. <li>
  101. Take .25 and multiply it by 1000. This yields 250.
  102. </li>
  103. </ul>
  104. <p>
  105. The following formula is the basis for scaling:
  106. </p>
  107. <p>
  108. <span id='xowa_math_txt_0'>newScore = \frac{oldScore - \text{min}(oldRange)} {\text{max}(oldRange)-\text{min}(oldRange)} \cdot (\text{max}(newRange)-\text{min}(newRange))</span>
  109. </p>
  110. <p>
  111. Or, to use the example from above:
  112. </p>
  113. <p>
  114. <span id='xowa_math_txt_0'>250 = \frac{100 - 0} {400-0} \cdot (1000-0)</span>
  115. </p>
  116. <h3>
  117. <span class="mw-headline" id="Ranking">Ranking</span>
  118. </h3>
  119. <p>
  120. A simplified definition of ranking is assigning a number based on its order in a population of numbers. For those familiar with a school setting, this is "grading on a curve". For a more thorough definition, see <a href="https://en.wikipedia.org/wiki/Percentile_rank" rel="nofollow" class="external text">the Wikipedia page on percentile ranks</a>
  121. </p>
  122. <p>
  123. For example, let's say you have the following:
  124. </p>
  125. <ul>
  126. <li>
  127. A minimum score of 0
  128. </li>
  129. <li>
  130. A maximum score of 100
  131. </li>
  132. <li>
  133. 5 entities with the following scores
  134. <ul>
  135. <li>
  136. A : 99
  137. </li>
  138. <li>
  139. B : 10
  140. </li>
  141. <li>
  142. C : 42
  143. </li>
  144. <li>
  145. D : 71
  146. </li>
  147. <li>
  148. E : 56
  149. </li>
  150. </ul>
  151. </li>
  152. </ul>
  153. <p>
  154. Ranking would do the following:
  155. </p>
  156. <ul>
  157. <li>
  158. Sort the scores
  159. <ul>
  160. <li>
  161. A : 99
  162. </li>
  163. <li>
  164. D : 71
  165. </li>
  166. <li>
  167. E : 56
  168. </li>
  169. <li>
  170. C : 42
  171. </li>
  172. <li>
  173. B : 10
  174. </li>
  175. </ul>
  176. </li>
  177. <li>
  178. Calculate the "interval" for each score by taking the maximum and dividing by the number of scores.
  179. <ul>
  180. <li>
  181. In this case, this would be 20: 100 / 5
  182. </li>
  183. </ul>
  184. </li>
  185. <li>
  186. Assign each score a new score based on its proportionate position in the sort.
  187. <ul>
  188. <li>
  189. A : 100
  190. </li>
  191. <li>
  192. D : 80
  193. </li>
  194. <li>
  195. E : 60
  196. </li>
  197. <li>
  198. C : 40
  199. </li>
  200. <li>
  201. B : 20
  202. </li>
  203. </ul>
  204. </li>
  205. </ul>
  206. <p>
  207. <br>
  208. </p>
  209. <h2>
  210. <span class="mw-headline" id="Calculation">Calculation</span>
  211. </h2>
  212. <h3>
  213. <span class="mw-headline" id="PageRank">PageRank</span>
  214. </h3>
  215. <p>
  216. The basis of XOWA's page score is <a href="https://en.wikipedia.org/wiki/PageRank" rel="nofollow" class="external text">PageRank</a>.
  217. </p>
  218. <p>
  219. In brief, PageRank will give high scores to pages which are:
  220. </p>
  221. <ol>
  222. <li>
  223. linked to by many pages
  224. </li>
  225. <li>
  226. linked to by pages which have a high score.
  227. </li>
  228. </ol>
  229. <p>
  230. Note that #2 is recursive (a page will have a high score only if it is linked to by many pages). For more info, a good starting point is <a href="https://en.wikipedia.org/wiki/PageRank" rel="nofollow" class="external text">the Wikipedia page on PageRank</a>.
  231. </p>
  232. <p>
  233. After XOWA calculates the PageRank, XOWA then scales this score in a range of 0 to 1,000,000
  234. </p>
  235. <h3>
  236. <span class="mw-headline" id="Short_pages_are_penalized">Short pages are penalized</span>
  237. </h3>
  238. <p>
  239. XOWA penalizes short pages. This reduces the effect of small stub pages which are linked to by many articles, but mostly from boilerplate navigation boxes.
  240. </p>
  241. <p>
  242. XOWA ranks pages based on page-length. The generated score is in a range from 0 to 1,000,000
  243. </p>
  244. <p>
  245. Currently the method is:
  246. </p>
  247. <ul>
  248. <li>
  249. If the page is in the bottom 60% of page lengths...
  250. </li>
  251. <li>
  252. Then multiply the page score by that percentage.
  253. </li>
  254. </ul>
  255. <p>
  256. For example, a page that has a length in the bottom 10% and a score of 1000, will have a score of 100 (1000 * 10%). In contrast, a page that has a length in the top 65% with a score of 9,000 will still have a score of 9,000.
  257. </p>
  258. <p>
  259. Note that this calculation is an ad-hoc creation and will probably change in the future.
  260. </p>
  261. <h3>
  262. <span class="mw-headline" id="Scores_are_re-scaled">Scores are re-scaled</span>
  263. </h3>
  264. <p>
  265. The final step is to take the modified score and rank it from 0 to 1,000,000. Note that this final score is an integer (not a decimal / float)
  266. </p>
  267. </div>
  268. </div>
  269. </div>
  270. <div id="mw-head" class="noprint">
  271. <div id="left-navigation">
  272. <div id="p-namespaces" class="vectorTabs">
  273. <h3>Namespaces</h3>
  274. <ul>
  275. <li id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
  276. </ul>
  277. </div>
  278. </div>
  279. </div>
  280. <div id='mw-panel' class='noprint'>
  281. <div id='p-logo'>
  282. <a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
  283. </div>
  284. <div class="portal" id='xowa-portal-home'>
  285. <h3>XOWA</h3>
  286. <div class="body">
  287. <ul>
  288. <li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
  289. <li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
  290. <li><a href="http://xowa.org/wiki/home/page/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
  291. <li><a href="http://xowa.org/wiki/home/page/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
  292. </ul>
  293. </div>
  294. </div>
  295. <div class="portal" id='xowa-portal-stargin'>
  296. <h3>Getting started</h3>
  297. <div class="body">
  298. <ul>
  299. <li><a href="http://xowa.org/wiki/home/page/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
  300. <li><a href="http://xowa.org/wiki/home/page/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
  301. <li><a href="http://xowa.org/wiki/home/page/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
  302. <li><a href="http://xowa.org/wiki/home/page/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
  303. <li><a href="http://xowa.org/wiki/home/page/App/Import/Other_wikis.html" title='Learn how to set up other Wikipedias'>Other Wikipedias</a></li>
  304. </ul>
  305. </div>
  306. </div>
  307. <div class="portal" id='xowa-portal-help'>
  308. <h3>Help</h3>
  309. <div class="body">
  310. <ul>
  311. <li><a href="http://xowa.org/wiki/home/page/Help/About.html" title='Get more information about XOWA'>About</a></li>
  312. <li><a href="http://xowa.org/wiki/home/page/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
  313. <li><a href="http://xowa.org/wiki/home/page/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
  314. <li><a href="http://xowa.org/wiki/home/page/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
  315. </ul>
  316. </div>
  317. </div>
  318. <div class="portal" id='xowa-portal-blog'>
  319. <h3>Blog</h3>
  320. <div class="body">
  321. <ul>
  322. <li><a href="http://xowa.org/wiki/home/page/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
  323. </ul>
  324. </div>
  325. </div>
  326. <div class="portal" id='xowa-portal-links'>
  327. <h3>Links</h3>
  328. <div class="body">
  329. <ul>
  330. <li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
  331. <li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
  332. <li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
  333. </ul>
  334. </div>
  335. </div>
  336. <div class="portal" id='xowa-portal-donate'>
  337. <h3>Donate</h3>
  338. <div class="body">
  339. <ul>
  340. <li><a href="https://archive.org/donate/index.php" title="Support archive.org!">archive.org</a></li><!-- listed first due to recent fire damages: http://blog.archive.org/2013/11/06/scanning-center-fire-please-help-rebuild/ -->
  341. <li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
  342. <!-- <li><a href="" title="Support XOWA! (but only after you've supported archive.org and Wikipedia)">XOWA</a></li> -->
  343. </ul>
  344. </div>
  345. </div>
  346. </div>
  347. </body>
  348. </html>