Gemini需要的數據集格式

step1:

Laboratory for Web Algorihmics下載wordassociation-2011.graph和wordassociation-2011.propertices兩個文件:

wordassociation-2011.graph裏的數據類型如下:

8ba7 a1d3 f18e 0175 81a4 dafc 254d e414
e524 220d 456a 4928 a2d8 af40 91da fcbe
8bb8 8461 6117 4fa0 a21d 8da6 9468 5394
60c0 4308 fd39 8a78 ac51 e518 c949 a98e
d579 0186 458f f254 835e 5861 a644 b620
d420 5388 2b29 58dd 15c1 8ce0 8c12 d2bb
04af 2a0a 6a9a 9ffc 3141 02dc 15b2 3421
4bd5 e1a1 0154 6311 b377 3812 0e5d e609
c553 542b d235 9010 10be 369b 1941 1b04
1746 1e00 6121 1fc2 f4cf d209 b02b 617d
1102 2410 56d8 204a 3992 dfff 0953 e415
e112 4454 c9a1 6004 11b5 350b 12b9 f8af
2540 86de 3d42 2328 b7a7 e13a 11b8 39d2
84e7 1aca 5880 1e4a 6158 3080 e662 138b
f254 82ba 0362 e282 cd25 59f1 9d5c 14db
1096 2b84 908e 843d f162 d482 1323 7f50
dca0 4bcf ff09 50c7 720a 6714 3ad8 40a5
8207 cc5e 70c5 3320 3271 f531 3042 8782
d742 022c 8b96 e265 a469 3ff0 a754 8ef4
5eec f58a 805f e864 a4a0 dc89 d155 0af4
9b03 315b 9776 244d 517f 50cc b0b2 d89a

wordassociation-2011.propertices裏是配置文件:

#BVGraph properties
#Tue Nov 08 15:39:23 CET 2011
compratio=0.883
bitsforblocks=37011
residualarcs=61314
version=0
zetak=3
residualexpstats=5117,4870,4366,4020,3550,3302,3208,3877,5799,6964,7015,4839,2091,1797,499
avgref=0.31
residualavggap=1333.624
avgbitsforoutdegrees=4.227
windowsize=7
bitsforintervals=9308
copiedarcs=8890
avgbitsforblocks=3.486
bitsperlink=10.646
bitsforresiduals=666674
bitsforreferences=10480
avgdist=0.514
successoravgloggap=6.56046819690199
avgbitsforreferences=0.987
successoravggap=1178.816
maxrefcount=3
successorexpstats=8520,6838,5282,4754,4130,3669,3620,4359,6347,7702,7581,4944,2049,1844,533
nodes=10617
compressionflags=
intervalisedarcs=1968
bitspernode=72.37
arcs=72172
bitsforoutdegrees=44875
avgbitsforintervals=0.877
minintervallength=4
graphclass=it.unimi.dsi.webgraph.BVGraph
avgbitsforresiduals=62.793
residualavgloggap=7.024087393160478

step2:

轉成鄰接表的格式,這裏對於大數據集得到的結果會非常大,要注意內存是否夠用。

wordassociation-2011-edgelist.txt如下:

1   0
1   2
1   3
1   4
1   5
1   3391
1   5663
1   7543
1   10180
1   10182
8   6
8   7
8   9
8   10
8   11
8   12
8   13
8   14
8   1260
8   1357
8   1922
8   3371
8   3472
8   4587
8   6099
8   6896
8   6898
15  17
15  1922
15  7576
15  8274
16  15
16  8748
18  19

amazon-2008-edgelist.txt如下:

0 1 63599 63670 389305 536016 536102 598597
1 0 63670 389305 452950 536102 592883
2 3 4 5 63610 184001 411660 504483 592273 592274 606073
3 2 4 5
4 2 3 5 390818 556156 598610 606024
5 2 3 4 6 13777 324264 614774
6 5 7 605884 713528
7 6
8 9 10 13 13064 63618 465029 467750 489647 556443 572834
9 8 13 5824 14872 58923 411719 514771
10 8 11
11 10
12 13
13 8 9 12 14 15 16 183888 183889 573028 602430

以上這兩種格式均可以通過txt轉bin代碼

step3:

這一步是Gemini外加的,由txt轉成bin格式所需時間非常長,我們實現的時候考慮省略這一步,並把它作爲減少預處理時間的一處優化。

wordassociation-2011.bin如下:
以8位表示一個點(id),16位表示一條邊(src和dst的id)

疑問:以598597爲例,轉成16進制後是92245,一個點有8位,所以應該是0009 2245,但是amazon-2008.bin裏面卻是4522 0900 爲什麼會這樣?

0100 0000 0000 0000 0100 0000 0200 0000
0100 0000 0300 0000 0100 0000 0400 0000
0100 0000 0500 0000 0100 0000 3f0d 0000
0100 0000 1f16 0000 0100 0000 771d 0000
0100 0000 c427 0000 0100 0000 c627 0000
0800 0000 0600 0000 0800 0000 0700 0000
0800 0000 0900 0000 0800 0000 0a00 0000
0800 0000 0b00 0000 0800 0000 0c00 0000
0800 0000 0d00 0000 0800 0000 0e00 0000
0800 0000 ec04 0000 0800 0000 4d05 0000
0800 0000 8207 0000 0800 0000 2b0d 0000
0800 0000 900d 0000 0800 0000 eb11 0000
0800 0000 d317 0000 0800 0000 f01a 0000
0800 0000 f21a 0000 0f00 0000 1100 0000
0f00 0000 8207 0000 0f00 0000 981d 0000
0f00 0000 5220 0000 1000 0000 0f00 0000
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章