Article order of cmix-neif-1.0 as plain numbers =============================================== Files ----- article_order_pages.txt 243,425 lines. The pages in the order in which cmix-neif-1.0 writes them to .main_reordered: first the 71,148 unlisted pages (71,110 redirects and 38 pages excluded by the residual) by ascending index, then the 172,277 listed pages. article_order_pages_fx2.txt The same pages in the order fx2-cmix writes them with new_article_order_fx2format.txt: listed pages first, unlisted pages at the end by ascending index. new_article_order_fx2format.txt 172,277 lines. The listed part as unit numbers, in the format of fx2-cmix src/readalike_prepr/data/new_article_order; usable in place of that file. It lists the same 172,277 units as the fx2-cmix file, in another order. derive_order.sh, derive_order.cpp Regenerate the three lists from the cmix-neif-1.0 source tarball and enwik9. order_steps.py Builds the order step by step from the fx2-cmix order (see "How the order and the residual were built"). encode_order.sh, encode_order.cpp Encoder of the residual: writes src/readalike_prepr/data/new_article_order of cmix-neif-1.0 from enwik9 and the order of step 3. SHA256SUMS Checksums of all files above. Numbering (0-based) ------------------- page index position among the elements of enwik9 in file order (0 = "AaA", page id 1). enwik9 has 243,426 elements; the last one (index 243425, "Hyperbaric oxygen therapy", cut off by the 10^9 byte limit) is not reordered and is not in the lists. unit number position among the non-redirect pages (172,315, units 0 to 172314). A page is a redirect if a line of it starts with ' ' followed by #REDIRECT, #redirect, #Redirect, #REdirect or {{softredirect (rule of fx2-cmix article_remap.cpp and article_reorder.h). Relation to cmix-neif-1.0 and fx2-cmix -------------------------------------- cmix-neif-1.0 ships the order as rule plus residual (src/readalike_prepr/order_codec.h, src/readalike_prepr/data/new_article_order) and rebuilds it from enwik9 when compressing; README of cmix-neif-1.0, section 4.5, describes the rule. The unit numbers it decodes are mapped to pages as in fx2-cmix; fx2-cmix appends the unlisted pages at the end, cmix-neif-1.0 puts them in front (redirect block). The order is tuned for the cmix-neif-1.0 ensemble with its transformer. The redirect block is in front because later pages reuse the redirect links as context (redirect and synonym prompts, alias rows, link context of every later article). In a full run of an earlier configuration without the transformer and without these prompts, moving the redirect block from the end to the front cost about +91.5 KB of S (108,334,908 against 108,243,400 B, same settings, only the order differs). With the transformer the block is reused as context; that gain was not measured separately. For a test in cmix-lex or fx2-cmix without these models, use new_article_order_fx2format.txt or article_order_pages_fx2.txt (unlisted pages at the end, as in fx2-cmix). How the order and the residual were built ----------------------------------------- All lists below are unit numbers in the fx2-cmix format. order_steps.py writes one file per step and checks its sha256. 0 fx2-cmix order: src/readalike_prepr/data/new_article_order of https://github.com/kaitz/fx2-cmix, built by Byron Knoll (fx2-cmix README, "Article order": embeddings, t-SNE to one dimension, k-means, reversed, manual sort of image, disambiguation and other special pages to the end). sha256 4d0fa5313c753c1ecf71e91a83e285894cdde20049711456e6514c07eb85c581 1 step1_wikipedia_last.txt: the 907 pages titled "Wikipedia:..." move to the end in their order (904 from the normal part, 3 from the disambiguation block). The result is the order file of Kaido Orav's fxcm_v26 archive, used by cmix-lex. sha256 eecd462c29319bab185b48229c4d09ab52f16ca9c582e8e32eff9a7c2a7de39e 2 step2_classes_by_id.txt: classes with the detection strings of the manual sort step (census, image, disambiguation, geographic and personal-name disambiguation; the same classes as ord::Extractor of cmix-neif-1.0 for all 172,315 units). The normal pages keep their order, the five class blocks follow, each by descending unit number (= descending page id). sha256 ea1e64b0afd72fea3604f3eb5f21265b4c27fb80b5d41c0ad61def66f65a6ce4 3 step3_project_pages.txt: the 907 normal pages titled "Wikipedia:...", "Help:..." or "MediaWiki:..." move in their order between the image block and the disambiguation block. This is the input of encode_order. sha256 57a05c998d9a868e59129df5be72a1302a3f65571f266872e0a7abce03a17b57 4 step4_calendar_block.txt: the 3,417 normal pages with a calendar title (year, decade, century, millennium, day, month, month of a year, deaths or births in a year; ord::KalKey) form one block sorted by the key of the title, in front of remaining normal page 72,079 (0-based; the number of remaining normal pages in front of the first day page that is directly followed by another day page in step 3). Equal to new_article_order_fx2format.txt and to the order decoded from the residual. sha256 c5170101aae4e99702af64c84c51c2801aa2fb0b65fe94028d6bf67d9ed98318 5 Residual: encode_order.sh with step 3 writes src/readalike_prepr/data/new_article_order of cmix-neif-1.0, 115,870 B. sha256 c9f8b1001bfbc041a087eab65e5caa609eb87bb8ecf297cfcdbcdaffa7a1dd19 6 Pages: derive_order.sh decodes the residual and maps units to pages; reorder() of cmix-neif-1.0 puts the unlisted pages in front. Residual (encode_order.cpp, rule and parameters of src/readalike_prepr/order_codec.h): - Header: 38 excluded units (not in the fx2-cmix file), 0 class corrections, n_split 109,601 (remaining normal pages in front of the census block), n_kal 72,079 (remaining normal pages in front of the calendar block), 1,728 clusters as their sequence in the target order; then 110,508 symbols, one per remaining normal page in ascending unit order, and the form tag 0x1FFFFF. - Clusters: maximal runs of descending unit numbers among the normal pages of step 3; the calendar pages are then removed from the runs. Two cluster borders of 1.0 are not visible in the final order (the runs on both sides continue to descend once the calendar pages are out), so the encoder reads step 3, not step 4. - Features of a page: title tokens; links and words of at least 5 letters (at most 160) in the first 600 characters of the text; categories; templates; links (at most 200). Features in more than 175 of the n remaining normal pages are dropped; weight round(256 * ln(n / df)) in integer arithmetic. - Vote: each earlier page (ascending unit order) adds the weights of the features it shares with the page to the score of its cluster; each cluster passes 2/16 of its score to its 8 neighbours per side in the cluster sequence that are already seen, halved per step; score * 64 / (pages in the cluster so far + 16); the clusters of the two previous pages (in ascending unit order) get 3/16 and 2/16 of the best score added. - Symbol: rank of the cluster of the page (1 = best, ties by cluster number), 0 for the first page of a cluster, 4096 + cluster number if the cluster has no vote or a rank above 4095. Clusters are numbered by their first page in ascending unit order. - The same order with the earlier parameters of the rule (4,000 characters instead of 600, 150 pages instead of 175, + 32 instead of + 16, no bonus for the previous pages, no form tag) gives a residual of 116,207 B. Regenerating ------------ sh derive_order.sh cmix-neif-1.0.tar.gz enwik9 outdir Inputs: cmix-neif-1.0.tar.gz (https://marwoelk.de/cmix-neif-1.0/, sha256 0716703f4e658ca3a671455677e0f196823ef504a80a4ebb0fcb3b8580104d6c), enwik9 (md5 e206c3450ac99950df65bf70ef61a12d), a C++17 compiler (CXX, default g++). The driver is compiled against the unmodified source tree of the tarball and calls its functions: preprocessing up to .main, order decoding, mapping of units to pages; it then runs the 1.0 reorder() and checks that its .main_reordered has the derived page sequence. About 90 s, 1.4 GB RAM, 3 GB disk below outdir. Output is identical with g++ 13.3 and clang++ 18 (Ubuntu 24.04). Check: applying article_order_pages.txt to the .main written by the published comp9 (sha256 8b07d85f0a374b55688fd08d1a464222f766efbb5bfefc2bc94d6abb201133d7, "comp9 -e enwik9 archive9") gives its .main_reordered byte for byte (sha256 b30426195038b77c57dd207db613232c1058523176399f7b4800647f6ed28d7e). From the fx2-cmix order to the residual: python3 order_steps.py enwik9 new_article_order steps sh encode_order.sh cmix-neif-1.0.tar.gz enwik9 steps/step3_project_pages.txt outdir new_article_order is the fx2-cmix file (sha256 above). order_steps.py needs Python 3, about 1 GB RAM and 15 s. encode_order.sh builds the encoder against the unmodified source tree of the tarball, writes the residual and the order decoded from it (new_article_order_fx2format.txt) and checks the residual against the one in the tarball. About 60 s, 0.7 GB RAM, 3 GB disk below outdir. Output is identical with g++ 13.3 and clang++ 18 (Ubuntu 24.04). Origin ------ Base order: fx2-cmix article order (Kaido Orav and Byron Knoll; built by Byron Knoll with an embedding pipeline), in the revision of Kaido Orav's fxcm_v26 archive (Wikipedia: pages at the end), inherited through cmix-lex. Reordering of the articles and sorting back by page id: STARLIT (Artemiy Margaritov). Changes in cmix-neif-1.0 (Marcus Wölk): order coded as rule plus residual, classes at the end sorted by descending page id, block of Wikipedia:, Help: and MediaWiki: pages between the image and the disambiguation pages, calendar block, redirect block in front. derive_order.cpp, encode_order.cpp and order_steps.py are licensed under the GNU GPL version 3, like cmix-neif-1.0.