Score.html 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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" class="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_/_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_/_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'>
  109. newScore = \frac{oldScore - \text{min}(oldRange)} {\text{max}(oldRange)-\text{min}(oldRange)} \cdot (\text{max}(newRange)-\text{min}(newRange))
  110. </span>
  111. </p>
  112. <p>
  113. Or, to use the example from above:
  114. </p>
  115. <p>
  116. <span id='xowa_math_txt_1'>
  117. 250 = \frac{100 - 0} {400-0} \cdot (1000-0)
  118. </span>
  119. </p>
  120. <h3>
  121. <span class="mw-headline" id="Ranking">Ranking</span>
  122. </h3>
  123. <p>
  124. 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>
  125. </p>
  126. <p>
  127. For example, let's say you have the following:
  128. </p>
  129. <ul>
  130. <li>
  131. A minimum score of 0
  132. </li>
  133. <li>
  134. A maximum score of 100
  135. </li>
  136. <li>
  137. 5 entities with the following scores
  138. <ul>
  139. <li>
  140. A : 99
  141. </li>
  142. <li>
  143. B : 10
  144. </li>
  145. <li>
  146. C : 42
  147. </li>
  148. <li>
  149. D : 71
  150. </li>
  151. <li>
  152. E : 56
  153. </li>
  154. </ul>
  155. </li>
  156. </ul>
  157. <p>
  158. Ranking would do the following:
  159. </p>
  160. <ul>
  161. <li>
  162. Sort the scores
  163. <ul>
  164. <li>
  165. A : 99
  166. </li>
  167. <li>
  168. D : 71
  169. </li>
  170. <li>
  171. E : 56
  172. </li>
  173. <li>
  174. C : 42
  175. </li>
  176. <li>
  177. B : 10
  178. </li>
  179. </ul>
  180. </li>
  181. <li>
  182. Calculate the "interval" for each score by taking the maximum and dividing by the number of scores.
  183. <ul>
  184. <li>
  185. In this case, this would be 20: 100 / 5
  186. </li>
  187. </ul>
  188. </li>
  189. <li>
  190. Assign each score a new score based on its proportionate position in the sort.
  191. <ul>
  192. <li>
  193. A : 100
  194. </li>
  195. <li>
  196. D : 80
  197. </li>
  198. <li>
  199. E : 60
  200. </li>
  201. <li>
  202. C : 40
  203. </li>
  204. <li>
  205. B : 20
  206. </li>
  207. </ul>
  208. </li>
  209. </ul>
  210. <p>
  211. <br>
  212. </p>
  213. <h2>
  214. <span class="mw-headline" id="Calculation">Calculation</span>
  215. </h2>
  216. <h3>
  217. <span class="mw-headline" id="PageRank">PageRank</span>
  218. </h3>
  219. <p>
  220. The basis of XOWA's page score is <a href="https://en.wikipedia.org/wiki/PageRank" rel="nofollow" class="external text">PageRank</a>.
  221. </p>
  222. <p>
  223. In brief, PageRank will give high scores to pages which are:
  224. </p>
  225. <ol>
  226. <li>
  227. linked to by many pages
  228. </li>
  229. <li>
  230. linked to by pages which have a high score.
  231. </li>
  232. </ol>
  233. <p>
  234. 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>.
  235. </p>
  236. <p>
  237. After XOWA calculates the PageRank, XOWA then scales this score in a range of 0 to 1,000,000
  238. </p>
  239. <h3>
  240. <span class="mw-headline" id="Short_pages_are_penalized">Short pages are penalized</span>
  241. </h3>
  242. <p>
  243. 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.
  244. </p>
  245. <p>
  246. XOWA ranks pages based on page-length. The generated score is in a range from 0 to 1,000,000
  247. </p>
  248. <p>
  249. Currently the method is:
  250. </p>
  251. <ul>
  252. <li>
  253. If the page is in the bottom 60% of page lengths...
  254. </li>
  255. <li>
  256. Then multiply the page score by that percentage.
  257. </li>
  258. </ul>
  259. <p>
  260. 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.
  261. </p>
  262. <p>
  263. Note that this calculation is an ad-hoc creation and will probably change in the future.
  264. </p>
  265. <h3>
  266. <span class="mw-headline" id="Scores_are_re-scaled">Scores are re-scaled</span>
  267. </h3>
  268. <p>
  269. 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)
  270. </p>
  271. </div>
  272. </div>
  273. </div>
  274. <div id="mw-head" class="noprint">
  275. <div id="left-navigation">
  276. <div id="p-namespaces" class="vectorTabs">
  277. <h3>Namespaces</h3>
  278. <ul>
  279. <li id="ca-nstab-main" class="selected"><span><a id="ca-nstab-main-href" href="index.html">Page</a></span></li>
  280. </ul>
  281. </div>
  282. </div>
  283. </div>
  284. <div id='mw-panel' class='noprint'>
  285. <div id='p-logo'>
  286. <a style="background-image: url(https://gnosygnu.github.io/xowa/xowa_logo.png);" href="http://xowa.org/" title="Visit the main page"></a>
  287. </div>
  288. <div class="portal" id='xowa-portal-home'>
  289. <h3>XOWA</h3>
  290. <div class="body">
  291. <ul>
  292. <li><a href="http://xowa.org/index.html" title='Visit the main page'>Main page</a></li>
  293. <li><a href="http://xowa.org/screenshots.html" title='See screenshots of XOWA'>Screenshots</a></li>
  294. <li><a href="https://www.youtube.com/watch?v=q0qbXYXEH6M" title="See a video of XOWA Desktop in action">Video</a></li>
  295. <li><a href="http://xowa.org/home/wiki/Help/Download_XOWA.html" title='Download the XOWA application'>Download XOWA</a></li>
  296. <li><a href="http://xowa.org/home/wiki/Dashboard/Image_databases.html" title='Download offline wikis and image databases'>Download wikis</a></li>
  297. </ul>
  298. </div>
  299. </div>
  300. <div class="portal" id='xowa-portal-started'>
  301. <h3>Getting started</h3>
  302. <div class="body">
  303. <ul>
  304. <li><a href="http://xowa.org/home/wiki/App/Setup/System_requirements.html" title='Get XOWA&apos;s system requirements'>Requirements</a></li>
  305. <li><a href="http://xowa.org/home/wiki/App/Setup/Installation.html" title='Get instructions for installing XOWA'>Installation</a></li>
  306. <li><a href="http://xowa.org/home/wiki/App/Import/Simple_Wikipedia.html" title='Learn how to set up Simple Wikipedia'>Simple Wikipedia</a></li>
  307. <li><a href="http://xowa.org/home/wiki/App/Import/English_Wikipedia.html" title='Learn how to set up English Wikipedia'>English Wikipedia</a></li>
  308. <li><a href="http://xowa.org/home/wiki/App/Import/Other_wikis.html" title='Learn how to set up other Wikipedias'>Other Wikipedias</a></li>
  309. </ul>
  310. </div>
  311. </div>
  312. <div class="portal" id='xowa-portal-android'>
  313. <h3>Android</h3>
  314. <div class="body">
  315. <ul>
  316. <li><a href="http://xowa.org/home/wiki/Android/Setup.html" title='Setup XOWA on your Android device'>Setup</a></li>
  317. <li><a href="https://www.youtube.com/watch?v=jsMTBxGweUw" title="See a video of XOWA Android in action">Video</a></li>
  318. </ul>
  319. </div>
  320. </div>
  321. <div class="portal" id='xowa-portal-help'>
  322. <h3>Help</h3>
  323. <div class="body">
  324. <ul>
  325. <li><a href="http://xowa.org/home/wiki/Help/About.html" title='Get more information about XOWA'>About</a></li>
  326. <li><a href="http://xowa.org/home/wiki/Help/Contents.html" title='View a list of help topics'>Contents</a></li>
  327. <li><a href="http://xowa.org/home/wiki/Help/Media.html" title='Read what others have written about XOWA'>Media</a></li>
  328. <li><a href="http://xowa.org/home/wiki/Help/Feedback.html" title='Questions? Comments? Leave feedback for XOWA'>Feedback</a></li>
  329. </ul>
  330. </div>
  331. </div>
  332. <div class="portal" id='xowa-portal-blog'>
  333. <h3>Blog</h3>
  334. <div class="body">
  335. <ul>
  336. <li><a href="http://xowa.org/home/wiki/Blog.html" title='Follow XOWA''s development process'>Current</a></li>
  337. </ul>
  338. </div>
  339. </div>
  340. <div class="portal" id='xowa-portal-links'>
  341. <h3>Links</h3>
  342. <div class="body">
  343. <ul>
  344. <li><a href="http://dumps.wikimedia.org/backup-index.html" title="Get wiki datababase dumps directly from Wikimedia">Wikimedia dumps</a></li>
  345. <li><a href="https://archive.org/search.php?query=xowa" title="Search archive.org for XOWA files">XOWA @ archive.org</a></li>
  346. <li><a href="http://en.wikipedia.org" title="Visit Wikipedia (and compare to XOWA!)">English Wikipedia</a></li>
  347. </ul>
  348. </div>
  349. </div>
  350. <div class="portal" id='xowa-portal-donate'>
  351. <h3>Donate</h3>
  352. <div class="body">
  353. <ul>
  354. <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/ -->
  355. <li><a href="https://donate.wikimedia.org/wiki/Special:FundraiserRedirector" title="Support Wikipedia!">Wikipedia</a></li>
  356. <li><a href="http://xowa.org/home/wiki/Help/Donate.html" title="Support XOWA!">XOWA</a></li>
  357. </ul>
  358. </div>
  359. </div>
  360. </div>
  361. </body>
  362. </html>