├── LICENSE ├── .gitignore ├── README.md ├── nfold ├── RNNtestSet_Twitter160_tree.txt ├── RNNtestSet_Twitter161_tree.txt ├── RNNtestSet_Twitter162_tree.txt ├── RNNtestSet_Twitter163_tree.txt ├── RNNtestSet_Twitter164_tree.txt ├── RNNtestSet_Twitter152_tree.txt ├── RNNtestSet_Twitter153_tree.txt ├── RNNtestSet_Twitter150_tree.txt ├── RNNtestSet_Twitter151_tree.txt ├── RNNtestSet_Twitter154_tree.txt ├── RNNtrainSet_Twitter160_tree.txt ├── RNNtrainSet_Twitter161_tree.txt ├── RNNtrainSet_Twitter162_tree.txt ├── RNNtrainSet_Twitter163_tree.txt └── RNNtrainSet_Twitter164_tree.txt └── model ├── evaluate.py ├── Main_BU_RvNN.py ├── Main_TD_RvNN.py ├── BU_RvNN.py └── TD_RvNN.py /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 majingCUHK 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | # PyInstaller 29 | # Usually these files are written by a python script from a template 30 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 31 | *.manifest 32 | *.spec 33 | 34 | # Installer logs 35 | pip-log.txt 36 | pip-delete-this-directory.txt 37 | 38 | # Unit test / coverage reports 39 | htmlcov/ 40 | .tox/ 41 | .coverage 42 | .coverage.* 43 | .cache 44 | nosetests.xml 45 | coverage.xml 46 | *.cover 47 | .hypothesis/ 48 | 49 | # Translations 50 | *.mo 51 | *.pot 52 | 53 | # Django stuff: 54 | *.log 55 | local_settings.py 56 | 57 | # Flask stuff: 58 | instance/ 59 | .webassets-cache 60 | 61 | # Scrapy stuff: 62 | .scrapy 63 | 64 | # Sphinx documentation 65 | docs/_build/ 66 | 67 | # PyBuilder 68 | target/ 69 | 70 | # Jupyter Notebook 71 | .ipynb_checkpoints 72 | 73 | # pyenv 74 | .python-version 75 | 76 | # celery beat schedule file 77 | celerybeat-schedule 78 | 79 | # SageMath parsed files 80 | *.sage.py 81 | 82 | # dotenv 83 | .env 84 | 85 | # virtualenv 86 | .venv 87 | venv/ 88 | ENV/ 89 | 90 | # Spyder project settings 91 | .spyderproject 92 | .spyproject 93 | 94 | # Rope project settings 95 | .ropeproject 96 | 97 | # mkdocs documentation 98 | /site 99 | 100 | # mypy 101 | .mypy_cache/ 102 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Paper of the source codes released: 2 | 3 | Jing Ma, Wei Gao, Kam-Fai Wong. Rumor Detection on Twitter with Tree-structured Recursive Neural Networks. In Proceedings of the 56th Annual Meeting of the Association for Computational Linguistics, ACL 2018. 4 | 5 | # Datasets: 6 | 7 | The datasets used in the experiments were based on the two publicly available Twitter datasets released by Ma et al. (2017): 8 | 9 | Jing Ma, Wei Gao, Kam-Fai Wong. Detect Rumors in Microblog Posts Using Propagation Structure via Kernel Learning. ACL 2017. 10 | 11 | In the 'resource' folder we provide the pre-processed data files used for our experiments. The raw datasets can be downloaded from https://www.dropbox.com/s/7ewzdrbelpmrnxu/rumdetect2017.zip?dl=0. For details about the datasets please contact Jing at: majing at se dot cuhk dot edu dot hk. 12 | 13 | The datafile is in a tab-sepreted column format, where each row corresponds to a tweet. Consecutive columns correspond to the following pieces of information: 14 | 15 | 1: root-id -- an unique identifier describing the tree (tweetid of the root); 16 | 17 | 2: index-of-parent-tweet -- an index number of the parent tweet for the current tweet; 18 | 19 | 3: index-of-the-current-tweet -- an index number of the current tweet; 20 | 21 | 4: parent-number -- the total number of the parent node in the tree that the current tweet is belong to; 22 | 23 | 5: text-length -- the maximum length of all the texts from the tree that the current tweet is belong to; 24 | 25 | 6: list-of-index-and-counts -- the rest of the line contains space separated index-count pairs, where a index-count pair is in format of "index:count", E.g., "index1:count1 index2:count2" (extracted from the "text" field in the json format from Twitter) 26 | 27 | 28 | # Dependencies: 29 | Please install the following python libraries: 30 | 31 | numpy version 1.11.2 32 | 33 | theano version 0.8.2 34 | 35 | # Reproduce the experimental results 36 | Run script "model/Main_BU_RvNN.py" for bottom-up recursive model or "model/Main_TD_RvNN.py" for up-down recursive model. 37 | 38 | Alternatively, you can change the "obj" parameter and "fold" parameter to set the dataset and each fold. 39 | 40 | #If you find this code useful, please let us know and cite our paper. 41 | -------------------------------------------------------------------------------- /nfold/RNNtestSet_Twitter160_tree.txt: -------------------------------------------------------------------------------- 1 | 693196937172951040 2 | 767803368081358848 3 | 693935557009801218 4 | 693691456222052352 5 | 693827886021767169 6 | 690969315470868480 7 | 688755462783782912 8 | 692368829368918017 9 | 767561970182598657 10 | 693840291992838147 11 | 689915847939219456 12 | 689890946683576322 13 | 672102358516670465 14 | 693128224960856064 15 | 693761289601060864 16 | 687274510643511296 17 | 689641419825242112 18 | 688004802245214208 19 | 693141729529184256 20 | 692023855926374400 21 | 688751061503442944 22 | 690650123358093312 23 | 693087220459270144 24 | 693897857376632832 25 | 692498490249891842 26 | 665309822208729088 27 | 676955015265837056 28 | 693071538896162816 29 | 693167683701968896 30 | 692701223326056449 31 | 693185853867294721 32 | 692393375891361794 33 | 692691444046372865 34 | 693939356390653952 35 | 693555965019492352 36 | 692163879909064704 37 | 676491949524713473 38 | 693606934050684928 39 | 693804277031157761 40 | 692082861525078017 41 | 690580180805509121 42 | 544324444773433348 43 | 524941132237910016 44 | 544271284796784640 45 | 525028734991343617 46 | 524947674164760577 47 | 615840865815298048 48 | 614594259900080128 49 | 524936872666353664 50 | 641972184412327937 51 | 524925215235911680 52 | 524952883343925249 53 | 676367888543031296 54 | 524925050739490816 55 | 544518335019229184 56 | 524962142563610625 57 | 649903655160815616 58 | 614618682543616000 59 | 544269749405097984 60 | 614607711368519680 61 | 544512108885725184 62 | 553587303172833280 63 | 544382892378714113 64 | 544319832486064128 65 | 544358564484378624 66 | 614608936491188225 67 | 544291965513134080 68 | 641082932740947972 69 | 500378223977721856 70 | 614594667225571328 71 | 544314234541469696 72 | 544380742076088320 73 | 553590835850514433 74 | 553587672137334785 75 | 544512676643500033 76 | 675490515748425728 77 | 614609560658161664 78 | 544291804057960448 79 | 681147789653356544 80 | 615689290706595840 81 | 552802654641225728 82 | 553534838880608256 83 | 656870311057575936 84 | 672513234419638273 85 | 647169726158925824 86 | 641088973717110784 87 | 642027433693171712 88 | 626516248206135296 89 | 629209452793626624 90 | 662151653462790144 91 | 659439879701602304 92 | 640107106943766528 93 | 647168914955243520 94 | 613023744454475776 95 | 626642648179159040 96 | 615346611955183616 97 | 666810213274689537 98 | 676094756758364160 99 | 626898253900943360 100 | 647169573599449088 101 | 637873886072320001 102 | 651825062174195712 103 | 674187250792558592 104 | 675193315306905600 105 | 668872645589471232 106 | 669613420665159680 107 | 618805892222468096 108 | 645362146415525888 109 | 643103859729166337 110 | 674364257799004160 111 | 666190716448587776 112 | 634404792241143809 113 | 631388553801564160 114 | 672219174463275008 115 | 667534186450825216 116 | 676120162018451456 117 | 674229534888185856 118 | 672902686380003328 119 | 666070802924617728 120 | 674244561519161344 121 | 655080266784968705 122 | 633823543541768192 123 | 642145732435292160 124 | 714555825122107392 125 | 722885778448121857 126 | 651786568592658433 127 | 663744139666804736 128 | 748558349139058688 129 | 724320681517670400 130 | 653432261203750912 131 | 742678930516123650 132 | 727172374999666688 133 | 743126914794037248 134 | 715256242990505984 135 | 752965545528528898 136 | 752875379765968897 137 | 715254040289021952 138 | 707405809181917184 139 | 714598641827246081 140 | 707412869860696064 141 | 701872343736520704 142 | 726086935903494144 143 | 701539698452393986 144 | 707321278135463936 145 | 727966590084485120 146 | 724348906096590849 147 | 778949749156245504 148 | 755439197125767169 149 | 760120409429643266 150 | 649584608560832513 151 | 727854332188577792 152 | 748543642323783681 153 | 780436430732525569 154 | 764931593303646208 155 | 732981604826677249 156 | 714577521992343552 157 | 707420972173955072 158 | 749286768554438658 159 | 724703995147751424 160 | 714560810266132480 161 | 714503380476026880 162 | 728627623488786433 163 | 727179214546456577 164 | -------------------------------------------------------------------------------- /nfold/RNNtestSet_Twitter161_tree.txt: -------------------------------------------------------------------------------- 1 | 693265096278163456 2 | 692833140428017664 3 | 767092161716350980 4 | 767855091109863424 5 | 693060960001597440 6 | 693466451081060353 7 | 693857551620968448 8 | 693321561542127616 9 | 688366079396163584 10 | 687748306571804672 11 | 692874200927698945 12 | 692884886374318081 13 | 692410832307818497 14 | 681824512120324096 15 | 693119705469587456 16 | 693471161313816576 17 | 693129259334909952 18 | 693811101146963968 19 | 763964234774347776 20 | 691719802499432448 21 | 689938201193115648 22 | 656848877463560192 23 | 681199637387149313 24 | 766541461189832704 25 | 691608761128067072 26 | 691632238035886081 27 | 688446106943008768 28 | 687984820815851521 29 | 641666167992647681 30 | 693843042546106369 31 | 767861179951648768 32 | 767710042816602112 33 | 692748411481780224 34 | 693573781730783232 35 | 693466724822323200 36 | 689267711856263168 37 | 692753210692476928 38 | 693441093048766464 39 | 693200309955469312 40 | 693476774462820352 41 | 692796451987034113 42 | 544282005941530624 43 | 614595106906226688 44 | 544274934835707905 45 | 614610364702044164 46 | 544367462012432384 47 | 552792802309181440 48 | 614467824313106432 49 | 616421546702336000 50 | 524966904885428226 51 | 614593386188828672 52 | 614604580601597953 53 | 649881917534433280 54 | 544520273718812672 55 | 552783667052167168 56 | 552791196247269378 57 | 623599854661541888 58 | 649889459836710912 59 | 552834961762709505 60 | 544358533819420672 61 | 651018580989972480 62 | 552791578893619200 63 | 614605997953404929 64 | 525019752507658240 65 | 544277117039837184 66 | 544504183341064192 67 | 525025279803424768 68 | 524944399890124801 69 | 614610102927147008 70 | 614628865353351168 71 | 552793679082311680 72 | 553589051044151296 73 | 544350712365207552 74 | 614594195479752704 75 | 552792544132997121 76 | 544381485591982083 77 | 649985459389661184 78 | 524995771587108864 79 | 614645853291155457 80 | 615494435074363392 81 | 553587013409325058 82 | 544283772569788416 83 | 662381914842603520 84 | 676870737932742656 85 | 626770498328895488 86 | 628045645010608128 87 | 659462980476637184 88 | 672539897899577344 89 | 672433211604013057 90 | 674014933235859456 91 | 664000310856310784 92 | 657007736467525632 93 | 620971220301787136 94 | 611039775856812032 95 | 613294443878305796 96 | 675064077367005184 97 | 613362193787129860 98 | 638047610973089793 99 | 653250169752977408 100 | 669259395902152704 101 | 675005503160901632 102 | 614054616154550273 103 | 676067381299576832 104 | 672424512516964352 105 | 604642913188872192 106 | 656880145769197568 107 | 663817239896821760 108 | 672632863452299264 109 | 666051332504207360 110 | 672927317191229440 111 | 656811196218286080 112 | 652783670370115585 113 | 662430295254175744 114 | 673686233936072704 115 | 665358434351509504 116 | 604625816992002049 117 | 656595123590012928 118 | 613016993692798977 119 | 647464349611589632 120 | 613404935003217920 121 | 658259426172891136 122 | 674301413040758785 123 | 676718762830221312 124 | 707308274270539777 125 | 716461257025581056 126 | 650975967146602496 127 | 760928376668454912 128 | 725983128444129280 129 | 715671763808493569 130 | 730939370765754368 131 | 655812191233417216 132 | 778530869208190976 133 | 778625026144792577 134 | 707310135291416576 135 | 716092408920936448 136 | 778681502825451520 137 | 714851393861881857 138 | 714998347111669760 139 | 729647367457230850 140 | 760109079133990912 141 | 728038172270198787 142 | 701975210044497921 143 | 780882510645370880 144 | 742050150307246080 145 | 727623131494387714 146 | 751536167183613952 147 | 723477822950395904 148 | 743058135300988932 149 | 653432177632387072 150 | 765735409984806912 151 | 652300118205427716 152 | 763520953619918848 153 | 740791134146965504 154 | 697992796565741569 155 | 763738618573623297 156 | 778299287293816832 157 | 714531423273746432 158 | 743764020679741440 159 | 763896522790440960 160 | 778689027918618625 161 | 714567472712589312 162 | 748640007934590976 163 | 726442550266044416 164 | -------------------------------------------------------------------------------- /nfold/RNNtestSet_Twitter162_tree.txt: -------------------------------------------------------------------------------- 1 | 693140340367187969 2 | 690680149164085248 3 | 692071267189395457 4 | 692940257134653441 5 | 693586539562037248 6 | 692758581494599681 7 | 767709416879644672 8 | 765612862681255936 9 | 693853310479155200 10 | 691678576018657281 11 | 693648675772436480 12 | 691995324752252930 13 | 766822417712963584 14 | 692845716826300418 15 | 692082592380751874 16 | 693041285087756288 17 | 766323684076322816 18 | 691789524498845699 19 | 693171092555431936 20 | 692540218310803456 21 | 692665281362202624 22 | 692803280238419971 23 | 693135382309896192 24 | 692157602554343424 25 | 693844030589902848 26 | 692150118921957376 27 | 692929779696275456 28 | 693086478667112448 29 | 692550140754841603 30 | 692752491482615808 31 | 723025600810766336 32 | 761573188543229952 33 | 764497123530375169 34 | 767807335691653120 35 | 693826104633737217 36 | 693181857261719553 37 | 692820029159653377 38 | 692083780123783172 39 | 693080409282846720 40 | 693858804279201794 41 | 693534670428971008 42 | 524959809402331137 43 | 544517264054423552 44 | 544491151118860289 45 | 553476880339599360 46 | 544374511194632192 47 | 614620298877513729 48 | 498430783699554305 49 | 544271362022338560 50 | 553512735192141826 51 | 614650850393391104 52 | 552785375161499649 53 | 553506608203169792 54 | 614599587362414592 55 | 667487418388488192 56 | 614891047886434304 57 | 615592870540488704 58 | 614610920782888960 59 | 553160652567498752 60 | 544305540286148609 61 | 553566026030272512 62 | 553107921081749504 63 | 614604054552018944 64 | 553544694765215745 65 | 524932935137628160 66 | 544513524438155264 67 | 553586897168392192 68 | 544290258951892992 69 | 552805488631758849 70 | 553590459688570880 71 | 544329935943237632 72 | 552811386259386370 73 | 544319274072817664 74 | 668849913678209024 75 | 614671961801785344 76 | 524935485370929152 77 | 642465192408940544 78 | 614702244001382400 79 | 553535829017370625 80 | 667073349974102017 81 | 544268732046913536 82 | 544282227035869184 83 | 668144671772778497 84 | 620367840902782976 85 | 636925368927064064 86 | 673615400655970304 87 | 656830586577883136 88 | 658786161733734400 89 | 672632899921833984 90 | 666497286663503872 91 | 658065957823324160 92 | 663925546812837888 93 | 673079581520318464 94 | 651959206287908868 95 | 612646796355960832 96 | 661120256732041216 97 | 623818627054206977 98 | 654343805081157633 99 | 665575674485211136 100 | 626901072209121282 101 | 613425834301485056 102 | 656825206045020160 103 | 655986243042459648 104 | 642432477185867776 105 | 637382230394822656 106 | 640644123339431936 107 | 656818921979310081 108 | 661299012386095105 109 | 654371696195993600 110 | 666633171325353989 111 | 647193820812177408 112 | 656047932093763584 113 | 644229386149888001 114 | 665379967757324288 115 | 674301960787505153 116 | 618192748735299584 117 | 673872171341447169 118 | 672180526946656256 119 | 674314254732931072 120 | 661222523275636736 121 | 634943791934406657 122 | 665364878287224834 123 | 633961125126668288 124 | 707305999971921920 125 | 711994705333112832 126 | 728273551883534336 127 | 749039299677417472 128 | 723504069814444033 129 | 730516765525082112 130 | 723644048867774464 131 | 703234354579898368 132 | 705093513076015104 133 | 779633844680962048 134 | 656361703664451585 135 | 652982112870662144 136 | 755548076438196225 137 | 765739657908850688 138 | 716416753409081344 139 | 763524712853102596 140 | 717081129627553792 141 | 725070832494624769 142 | 763430916236640256 143 | 777710439870455808 144 | 728013148788154368 145 | 755523157700648960 146 | 732004388181434368 147 | 715268937873760256 148 | 774833492865593344 149 | 712223438698627073 150 | 724939017410727938 151 | 707786906189303808 152 | 764368020391223296 153 | 757450526153900032 154 | 757190314880884736 155 | 716424773216022530 156 | 653285570383335424 157 | 701514249269542912 158 | 731093044460683264 159 | 724044187113512960 160 | 656523458139045889 161 | 714598318333042688 162 | 706933939953344514 163 | 640182854928961536 164 | -------------------------------------------------------------------------------- /nfold/RNNtestSet_Twitter163_tree.txt: -------------------------------------------------------------------------------- 1 | 692925396292091905 2 | 693203974388895744 3 | 666335363099660288 4 | 693869818366287872 5 | 693059995013742592 6 | 766752508312166402 7 | 686657138270277634 8 | 692623941131722752 9 | 693546915892428800 10 | 693402634011701248 11 | 693456187036037123 12 | 765779159176077312 13 | 767129248045948929 14 | 682999206290829312 15 | 761999790892806144 16 | 682916727282270208 17 | 691285663522648065 18 | 692702295281262593 19 | 766715993385267201 20 | 690042063958732800 21 | 692890520960397312 22 | 687643002240679936 23 | 693528374996652032 24 | 689661418484994049 25 | 766568413418356736 26 | 692838430783332357 27 | 693281966846808064 28 | 767859423150759936 29 | 693502060545703937 30 | 689860942671130624 31 | 692735698349199360 32 | 765859710503378944 33 | 767754921403899906 34 | 764906140257837056 35 | 687537772970684417 36 | 682895395077373952 37 | 690106189951139840 38 | 693146363685642240 39 | 693315824132685824 40 | 693086218276474880 41 | 767203096472719364 42 | 524925987239120897 43 | 614593989203886080 44 | 544301453717041152 45 | 552792913910833152 46 | 619242759359037440 47 | 614601139422633984 48 | 544289311504355328 49 | 580348081100734464 50 | 616765822095261700 51 | 628319096606732290 52 | 553543369604210689 53 | 614599619310407680 54 | 614615157730357248 55 | 553508098825261056 56 | 580324027715063808 57 | 628336948810268673 58 | 525056576038518785 59 | 544289941996326912 60 | 544399927045283840 61 | 552832817089236992 62 | 553221600955621376 63 | 524969201102901248 64 | 525049639016615937 65 | 614790312955904000 66 | 544511199702822913 67 | 628681462976528384 68 | 614595181845839873 69 | 524923676484177920 70 | 616481759329427456 71 | 544352727971954690 72 | 544278335455776769 73 | 614617234942656512 74 | 623533663947517952 75 | 614628136634949632 76 | 525060425184858112 77 | 544515538383564801 78 | 544514564407427072 79 | 650037735579910145 80 | 614616994499788800 81 | 525023025792835585 82 | 524931324763992064 83 | 651321040119963648 84 | 634665777400950784 85 | 613114185505996802 86 | 638050997340893184 87 | 626897206717624320 88 | 613061089518034944 89 | 671181758692507648 90 | 675043569367982081 91 | 663904307113275392 92 | 637868242560638980 93 | 648894687542034432 94 | 656955120626880512 95 | 673984270902427650 96 | 633949800761700352 97 | 648310692794109952 98 | 661251968078221312 99 | 620916279608651776 100 | 645711628046995462 101 | 645356735545364480 102 | 667465205258051584 103 | 663515735231062016 104 | 669201837187334144 105 | 622858454949040128 106 | 643225207705075716 107 | 672906198434209792 108 | 672488384695279616 109 | 612741808125120513 110 | 660466342038867969 111 | 652992524504600576 112 | 651402689352351744 113 | 618449248179191808 114 | 643139873264812032 115 | 641430951403343872 116 | 672432930426372096 117 | 627828211003469825 118 | 663385747177775105 119 | 620835698514464768 120 | 654351281260113920 121 | 665361505303584774 122 | 677099574855639044 123 | 652882609219833856 124 | 715253497462145024 125 | 658938136299511808 126 | 726190016435728385 127 | 724603564946010112 128 | 745236050407194624 129 | 727982226290442240 130 | 705092738224525312 131 | 648993731169939456 132 | 640118021101604864 133 | 650254360727973889 134 | 742571519105077248 135 | 728101712762834944 136 | 652000523525091328 137 | 755475529294352385 138 | 724624672604610562 139 | 723915846985342976 140 | 733242244522725376 141 | 651486105628463105 142 | 775672628493357057 143 | 716448280201269248 144 | 759460236042305536 145 | 766808183696351233 146 | 707332312724283392 147 | 651044059222556674 148 | 728207861050970112 149 | 707604196812591104 150 | 727116900983934976 151 | 756690088533393409 152 | 723365789378584578 153 | 741995157969592321 154 | 724661834419048448 155 | 765887221736046592 156 | 701175292937707520 157 | 650710483289419776 158 | 652349108653551616 159 | 723511860516016128 160 | 715255507506892800 161 | 726043971911213057 162 | 728631482722308096 163 | 778572032531427332 164 | -------------------------------------------------------------------------------- /nfold/RNNtestSet_Twitter164_tree.txt: -------------------------------------------------------------------------------- 1 | 693648684857323521 2 | 693818562981421056 3 | 693893182338289664 4 | 692014905239666688 5 | 688819658057740290 6 | 693061713042771968 7 | 689867195657101312 8 | 767541796410839040 9 | 693571567377342466 10 | 693013768738115584 11 | 692743102432346113 12 | 693906624776245249 13 | 688428083540553728 14 | 688741019979001856 15 | 692516224245235712 16 | 692106491365605376 17 | 767459987476054016 18 | 693857080193761285 19 | 693651239486263296 20 | 692826642583019521 21 | 693076140278153217 22 | 688021039322894336 23 | 692078399012130816 24 | 672553813249826816 25 | 767698691205410816 26 | 723198441690636288 27 | 692758050378256388 28 | 644329878876237824 29 | 688752927381581824 30 | 767814876433571840 31 | 687409983139495939 32 | 682996350909157376 33 | 765359928361922560 34 | 692630756548591616 35 | 692797856386777089 36 | 693771953648373760 37 | 762793077509464064 38 | 692911086920667136 39 | 690376107825192960 40 | 686666933949837312 41 | 693641113693884416 42 | 614648099542204416 43 | 544512664769396736 44 | 650128194209730561 45 | 524943490887991296 46 | 544278985249550337 47 | 614638036593299456 48 | 524923462398513152 49 | 525058976376193024 50 | 674263945172119552 51 | 544289409294553088 52 | 614624331717545984 53 | 525025463648137216 54 | 616311563071434753 55 | 628604055644934144 56 | 524980744658382848 57 | 650046859537448960 58 | 640967537178472448 59 | 544391533240516608 60 | 544350567183556608 61 | 553476490315431937 62 | 524942470472548352 63 | 552806757672964097 64 | 614494460747997184 65 | 552984502063337472 66 | 524975705206304769 67 | 649974380416618496 68 | 524965775036387329 69 | 614494170590367744 70 | 614626710248534016 71 | 614614133410033664 72 | 553586860334010368 73 | 553588178687655936 74 | 524926235030589440 75 | 674358835675549696 76 | 525068915068923904 77 | 544520042810200064 78 | 524922729485848576 79 | 544476808566276097 80 | 553531413459660800 81 | 544391176137089024 82 | 553558982476828674 83 | 681767380305985536 84 | 629503919098429440 85 | 612841482823729152 86 | 661102820976930816 87 | 656202544331517952 88 | 673664899571060736 89 | 604354747357859842 90 | 613393657161510913 91 | 675065047710892033 92 | 600451916414484480 93 | 612438528803213312 94 | 661870323034431489 95 | 672169954016403456 96 | 673615263040798726 97 | 594687353937100801 98 | 656662726014599168 99 | 635632641635667968 100 | 673581371458199552 101 | 674015148382666752 102 | 667379734343471104 103 | 656834590779289600 104 | 661229627734667264 105 | 663722803489808384 106 | 672828403016429568 107 | 659428447459110912 108 | 673611867181473792 109 | 658462819667615744 110 | 656629493377990656 111 | 666107476526432256 112 | 613194145423826944 113 | 641443248909754368 114 | 622891631293935616 115 | 666640008149925893 116 | 673696115305406466 117 | 618804516578680832 118 | 674080899055546368 119 | 641050980985999360 120 | 626546123713474560 121 | 673346166822694914 122 | 641191076716417025 123 | 626739062792032256 124 | 714811995573325828 125 | 742114513726623744 126 | 757367391202471937 127 | 728625967921401856 128 | 757748522481491968 129 | 654336219447472128 130 | 740748123581087745 131 | 655815788675399680 132 | 651809229842608128 133 | 707300612862566400 134 | 747275598347837440 135 | 655432919595548672 136 | 742012307694223361 137 | 747443219487678464 138 | 751856580874960897 139 | 763428684850094080 140 | 676586804242309121 141 | 723521076446142465 142 | 756282236375277568 143 | 706665777332621314 144 | 725174535897620481 145 | 727834854931435522 146 | 716457799392342018 147 | 731166399389962242 148 | 715264793737879553 149 | 755447443009916929 150 | 727588444000526336 151 | 744390771869102080 152 | 742055437932040193 153 | 716439952922312704 154 | 650952376954650629 155 | 758825535480864769 156 | 714755546285477888 157 | 715515982584881152 158 | 732971411157880832 159 | 745365403237376000 160 | 766789709045518336 161 | 716451800581279744 162 | 658755852199927808 163 | 723772395211862016 164 | -------------------------------------------------------------------------------- /nfold/RNNtestSet_Twitter152_tree.txt: -------------------------------------------------------------------------------- 1 | 761355585724055553 2 | 692927739066740741 3 | 767355933919997952 4 | 692105324111761408 5 | 693214543615561729 6 | 692134721195786240 7 | 693465666259656705 8 | 688763099298529280 9 | 683158807959089152 10 | 693537938425171968 11 | 688110059553861634 12 | 764473554431725568 13 | 693806234026188801 14 | 690296550803636224 15 | 692405195796529152 16 | 692688891174739968 17 | 692046121250586624 18 | 693549273468764160 19 | 693355140284334081 20 | 687617735833026560 21 | 693098795022725120 22 | 693916809125351425 23 | 643807909856415744 24 | 692290126282649601 25 | 691206970074738688 26 | 690145844318834689 27 | 692098463262216192 28 | 692818857187213313 29 | 692812029611089920 30 | 764505291853627392 31 | 765631087867367426 32 | 692842124841123842 33 | 690137637810761728 34 | 692528931459694592 35 | 693925198630821889 36 | 665498651742085124 37 | 767355611277168642 38 | 761027420849745920 39 | 692566765822435328 40 | 692451275930234880 41 | 692537942439501824 42 | 693853982293254144 43 | 689719109785907200 44 | 691986377584549888 45 | 693118410444636161 46 | 767462297270968321 47 | 692854695262445568 48 | 767223774072676354 49 | 689798164287741953 50 | 767360696761905153 51 | 691351064868732928 52 | 690252631822864384 53 | 693032076543655936 54 | 691632933170450435 55 | 692792765852286977 56 | 693116426824093696 57 | 692727606718824448 58 | 766299795833102336 59 | 693533469922693120 60 | 690174644071047168 61 | 692453106622275585 62 | 767668607803359234 63 | 692748204064927745 64 | 692190570140340229 65 | 692745208421679104 66 | 693217698482933760 67 | 688751183645782016 68 | 688520025754304512 69 | 693560600471863296 70 | 693785810311778304 71 | 693629063932596224 72 | 692142338890661888 73 | 693673606279229440 74 | 692332739824095234 75 | 510918747188514816 76 | 568075025418317826 77 | 525033697045925888 78 | 536558567206420480 79 | 525005886272843776 80 | 514098833253748736 81 | 524699123971534848 82 | 407217865973329920 83 | 504387128013246465 84 | 407179055763836928 85 | 538408710084001793 86 | 517487705978966016 87 | 524928878075457536 88 | 519131101798100992 89 | 567596847330373632 90 | 407192027714322432 91 | 515717938025078784 92 | 509466295344304129 93 | 510906049549705216 94 | 507263441359613953 95 | 407290084593913856 96 | 565999191982616577 97 | 524685073979678721 98 | 407191144880439298 99 | 552615631246622721 100 | 525116411887513602 101 | 519078654635409410 102 | 500278294055768064 103 | 532231906364911616 104 | 407234399093022720 105 | 295152287901417472 106 | 407163869673443328 107 | 536540403109879809 108 | 407174474207731712 109 | 525029684095221760 110 | 407156621450571777 111 | 525024518713397249 112 | 524962676665888769 113 | 407167928313081856 114 | 562387516964491265 115 | 516729950091493376 116 | 407184707118309376 117 | 554722567224049664 118 | 517051126466625536 119 | 504131150429061121 120 | 524958128392376320 121 | 534205316620382208 122 | 524935769614331904 123 | 407188779255222273 124 | 407248574099894272 125 | 536991428694376448 126 | 407169885345943552 127 | 524961721744900097 128 | 407198255793987584 129 | 407158558158254081 130 | 552498516225179650 131 | 551097831851687938 132 | 514106939173634048 133 | 436146437530075136 134 | 514098803347951616 135 | 524970097711267841 136 | 510921017972514817 137 | 566999951449001984 138 | 523581212175392768 139 | 504304227246538752 140 | 532203605236154368 141 | 529747368087126019 142 | 532276370953752576 143 | 524941504796962816 144 | 531648145613398016 145 | 407223928084766721 146 | 427944719612915712 147 | 532197572698320896 148 | 551159366876147714 149 | 513437031020916738 150 | 490080544949276672 151 | 387220814531395584 152 | 450341615979069440 153 | 534392174876839936 154 | 91728807081426944 155 | 489836441120145408 156 | 553115168084074497 157 | 532206910796468224 158 | 369506008172740608 159 | 358591089462099968 160 | 539813330983354368 161 | 519868410599993344 162 | 552112474913136641 163 | 80084555733803009 164 | 514150992552931328 165 | 550038665653542913 166 | 489794369487380480 167 | 534337548680978432 168 | 534364937939062784 169 | 489812926828924928 170 | 518981379963777025 171 | 366205297557110784 172 | 532246457609244672 173 | 514517470238240768 174 | 549124560793374720 175 | 539658034382123008 176 | 505611045897924608 177 | 529857740059860992 178 | 554979642210549760 179 | 528389559441444864 180 | 387281927427727360 181 | 538166788484509696 182 | 491591245152935936 183 | 387353560356118528 184 | 273278761909239808 185 | 568580363339091968 186 | 518620083342835712 187 | 520244836084228096 188 | 380140114552188928 189 | 489867900296368129 190 | 505369323922522113 191 | 435998882250899456 192 | 521717368264093696 193 | 521789009576476673 194 | 436089462326849536 195 | 357299879070023680 196 | 387050178932654080 197 | 489794696013967360 198 | 501474962935648256 199 | 506118402466152449 200 | 489798219283857408 201 | 538129041539092480 202 | 570341828479725570 203 | 532851585408593920 204 | 532208816692416512 205 | 525711899359318016 206 | 501760566160289794 207 | 539833716852273152 208 | 495583434954514432 209 | 504652021601800193 210 | 524168442841010176 211 | 547803254516490240 212 | 387237225286479872 213 | 553016500492439552 214 | 569908998717243392 215 | 387233034350514176 216 | 568571403756294144 217 | 537377960471166976 218 | 428366153149194240 219 | 519867098945044480 220 | 520338188213444608 221 | 489816746405007360 222 | 513922322915282945 223 | 655432919595548672 224 | 715255507506892800 225 | 525327108520673281 226 | 728101712762834944 227 | 727116900983934976 228 | 549964632883232768 229 | 723772395211862016 230 | 525285199530455040 231 | 516705572373397504 232 | 705092738224525312 233 | 728273551883534336 234 | 553467311261503488 235 | 500279160795721728 236 | 524924619812511746 237 | 553575232867672064 238 | 755475529294352385 239 | 521882110789824512 240 | 758825535480864769 241 | 727966590084485120 242 | 716461257025581056 243 | 707321278135463936 244 | 524993533212897281 245 | 766808183696351233 246 | 714598641827246081 247 | 724320681517670400 248 | 523545090099523584 249 | 760120409429643266 250 | 500347114975944705 251 | 526757033186697216 252 | 538193964479045633 253 | 531493734358061056 254 | 580320684305416192 255 | 716424773216022530 256 | 553461741917863936 257 | 499456140044824576 258 | 712223438698627073 259 | 516435293235183617 260 | 531606992788287489 261 | 550284252672450560 262 | 707420972173955072 263 | 499612545909415938 264 | 726086935903494144 265 | 723365789378584578 266 | 516414874348298240 267 | 500290456845299714 268 | 501934077612941312 269 | 727588444000526336 270 | 651044059222556674 271 | 500280838710247424 272 | 780436430732525569 273 | 755447443009916929 274 | 553228463998783488 275 | 516345893139001346 276 | 553501357156876290 277 | 756282236375277568 278 | 531530591427391488 279 | 500371149713178625 280 | 714755546285477888 281 | 727623131494387714 282 | 726190016435728385 283 | 544514570367168512 284 | 553474188259102720 285 | 707308274270539777 286 | 550279538278543360 287 | 500394061887709184 288 | 714503380476026880 289 | 707305999971921920 290 | 707300612862566400 291 | 524970851675176960 292 | 535148463609356288 293 | 544306719686656000 294 | 714560810266132480 295 | 723644048867774464 296 | 500258409988763649 297 | -------------------------------------------------------------------------------- /nfold/RNNtestSet_Twitter153_tree.txt: -------------------------------------------------------------------------------- 1 | 692336523090509824 2 | 767737100347191297 3 | 693079616072880128 4 | 767218194385866752 5 | 693487871806689280 6 | 693873151659249669 7 | 690567125128351744 8 | 693711272014155776 9 | 689853056440221696 10 | 692506143147606016 11 | 689549346875031552 12 | 767823175480647681 13 | 693926742814281729 14 | 693452449173086210 15 | 764653644138450945 16 | 693686290408181760 17 | 685473149291479040 18 | 693722259740069889 19 | 693866093123915776 20 | 686527768327274497 21 | 688441130271289350 22 | 693554344298467328 23 | 693411834808946688 24 | 687631811560763392 25 | 691027026552229888 26 | 616686132387028992 27 | 691700082601758720 28 | 689103487880310785 29 | 692047663211085825 30 | 692217618778972161 31 | 767710245779103744 32 | 665317131597291520 33 | 692423131726749697 34 | 692391757775028228 35 | 689694470779097088 36 | 692031514943582208 37 | 693107789007339521 38 | 692113839387709444 39 | 690431187916099584 40 | 676970570160988160 41 | 767715524222578688 42 | 693459931022913536 43 | 689208632148365314 44 | 693485676881403905 45 | 693204483501887488 46 | 693139276708585472 47 | 691380138710306816 48 | 688461902821855232 49 | 689922870689009664 50 | 692382471061663744 51 | 692780496590254081 52 | 691564354567798784 53 | 692734579141185536 54 | 693476901772513280 55 | 765141361033109504 56 | 677950378785271808 57 | 692113799546048513 58 | 682629960826224646 59 | 690920430287331328 60 | 674713782778654721 61 | 693622130735484929 62 | 767845555313774593 63 | 692031224227958789 64 | 689555819059351552 65 | 764753085675761664 66 | 693122199536934912 67 | 691380348379201536 68 | 692491478619262976 69 | 693534177694609409 70 | 691006265137299456 71 | 759653274605740032 72 | 692838349036326912 73 | 767094580634202112 74 | 689529955294777344 75 | 524977992683237376 76 | 427725166127226881 77 | 524961908903149568 78 | 514039286845698048 79 | 407173794583695360 80 | 514142113601437696 81 | 407205235682050048 82 | 504267796424163328 83 | 407182466613792768 84 | 510916725953417218 85 | 524951893467234304 86 | 407232661107642368 87 | 407237676350185475 88 | 523888836456108032 89 | 551123464640536576 90 | 407211258304552960 91 | 524958992330522624 92 | 551106793959862272 93 | 508002575858561024 94 | 407189015582887936 95 | 525300042207612928 96 | 518866406512025602 97 | 554958414905094144 98 | 514106273852174337 99 | 524930671220105216 100 | 536105045545472000 101 | 523939598691741696 102 | 528495998537334785 103 | 524949828711620608 104 | 407213757048160256 105 | 509463916586762241 106 | 531129816389779456 107 | 407218583135997953 108 | 407169212428206080 109 | 552457656666185728 110 | 427780584979836929 111 | 551120768164462592 112 | 514148279601606656 113 | 515519742355185664 114 | 563117355254161408 115 | 519311120914722816 116 | 407258075502899200 117 | 529434230938284032 118 | 407279190913069056 119 | 524929106987991040 120 | 519275971758026752 121 | 518870005677826050 122 | 499683602452717569 123 | 407170443443859456 124 | 407229989902225408 125 | 524291188422356993 126 | 407236151167025152 127 | 519348106836860929 128 | 407164247768977409 129 | 527295015643394048 130 | 524946179390701568 131 | 552568163431247873 132 | 524967711492014080 133 | 407269894938718208 134 | 574062768896212992 135 | 524976980799000578 136 | 555003887753494528 137 | 552661209204260864 138 | 528357165677817856 139 | 509463933564891137 140 | 407170170533064705 141 | 538346377794031618 142 | 407192370040803329 143 | 524987184836005889 144 | 525043936331857923 145 | 517850508380618752 146 | 504131654810877952 147 | 427666815842414592 148 | 552706985087361025 149 | 514468018970034176 150 | 387010299536355328 151 | 538975342011363328 152 | 509077805296914432 153 | 489865454312099840 154 | 387021726007042051 155 | 387007120689737729 156 | 544457299667202048 157 | 519929168864497664 158 | 551117430345711616 159 | 563123548857053184 160 | 504771233557147648 161 | 372914976102834176 162 | 501774615837163521 163 | 538760398003253248 164 | 352075672543428608 165 | 534763214106820608 166 | 551942365901250560 167 | 506656271517622272 168 | 544698560655400961 169 | 351767344097398785 170 | 521821037726797824 171 | 489841070818488320 172 | 542600886653292545 173 | 547101266313089024 174 | 505657661120348163 175 | 80080680482123777 176 | 518192429153783808 177 | 542320823915536384 178 | 387006700609228801 179 | 532319110458118144 180 | 377519445578895360 181 | 561280944045576192 182 | 523123023646175233 183 | 489794593580650497 184 | 560163341524807680 185 | 543443188934250496 186 | 523123779124600833 187 | 364383457545162754 188 | 507557659206516736 189 | 489968646014246912 190 | 504453071041482753 191 | 538861627018579968 192 | 521727831307722753 193 | 524186749002473472 194 | 554655549896159233 195 | 519965814175567872 196 | 539052152602107904 197 | 489887806018183168 198 | 531900034863091712 199 | 571052823665704960 200 | 523558773345255424 201 | 376874273601630208 202 | 537378640653475841 203 | 348209998565879810 204 | 557621135320178688 205 | 489829414704648192 206 | 489796088338341888 207 | 535252460148113409 208 | 273182568298450945 209 | 511918957255991296 210 | 554343513887105024 211 | 532559937269166080 212 | 489872119158046720 213 | 560414522758799361 214 | 501785003144273921 215 | 553061846081896449 216 | 521835345059389440 217 | 334722003057647616 218 | 531607884220485632 219 | 531568534066057217 220 | 560474897013415936 221 | 524646141938647043 222 | 553008832784642048 223 | 552848620375261184 224 | 498280126254428160 225 | 531733274968989696 226 | 717081129627553792 227 | 576319832800555008 228 | 748640007934590976 229 | 550175324634619904 230 | 714851393861881857 231 | 778949749156245504 232 | 550131732805328896 233 | 500288349924782080 234 | 707412869860696064 235 | 531531382611513344 236 | 701539698452393986 237 | 549920761423863808 238 | 748558349139058688 239 | 553549686129561600 240 | 658938136299511808 241 | 765735409984806912 242 | 651786568592658433 243 | 714555825122107392 244 | 723477822950395904 245 | 531287426858487808 246 | 745236050407194624 247 | 774833492865593344 248 | 511330322831507456 249 | 731166399389962242 250 | 714811995573325828 251 | 743126914794037248 252 | 658755852199927808 253 | 522815405451407360 254 | 531498841158082562 255 | 531131094276382720 256 | 745365403237376000 257 | 553212962044149761 258 | 650975967146602496 259 | 547670441754914816 260 | 765887221736046592 261 | 728625967921401856 262 | 553505242554175489 263 | 549975297160802304 264 | 553164985460068352 265 | 742678930516123650 266 | 729647367457230850 267 | 757367391202471937 268 | 516313006427602944 269 | 516861311725342722 270 | 552810448324943872 271 | 556873675941896193 272 | 500303431928922113 273 | 549927969032916993 274 | 727172374999666688 275 | 503609826128044032 276 | 538137715293061120 277 | 728013148788154368 278 | 763430916236640256 279 | 701514249269542912 280 | 780882510645370880 281 | 521777301470871553 282 | 524932056560963584 283 | 653432177632387072 284 | 697992796565741569 285 | 516395112201736192 286 | 516371936604352513 287 | 516539137646542848 288 | 747275598347837440 289 | 516377014790782977 290 | 500354773133299713 291 | 725983128444129280 292 | 499368931367608320 293 | 522534012544638976 294 | 778689027918618625 295 | 766789709045518336 296 | 553548567420628992 297 | -------------------------------------------------------------------------------- /nfold/RNNtestSet_Twitter150_tree.txt: -------------------------------------------------------------------------------- 1 | 764158239089029120 2 | 693821069879160832 3 | 766307327922335745 4 | 691656866972209152 5 | 693729678306189313 6 | 692840850141753347 7 | 692440373449396224 8 | 693822949456007169 9 | 692709993573789701 10 | 687674548712505346 11 | 687956181646753792 12 | 766299560415223808 13 | 644321231618076673 14 | 693136527816331264 15 | 683731779342188545 16 | 693631772639145984 17 | 691600834707247104 18 | 692357775859564544 19 | 692364468442021889 20 | 689236842454106113 21 | 661184793342775296 22 | 633397936563560449 23 | 763404633217835009 24 | 761675705956655109 25 | 690954487322796032 26 | 621025025806577664 27 | 693605375803813889 28 | 693284114724700160 29 | 692946556396244992 30 | 693240976970752004 31 | 691889802724118532 32 | 693492159635443714 33 | 692735354240114688 34 | 687786822475366401 35 | 767154835993063425 36 | 692581635594694658 37 | 692765809425408000 38 | 693594331735683072 39 | 693185488644149248 40 | 766638613320859648 41 | 692745861978263552 42 | 678277910537588737 43 | 692376812022792196 44 | 690670464440504320 45 | 693239731031683072 46 | 693795905049329664 47 | 692099058811453440 48 | 693408117225299968 49 | 692082337333534720 50 | 688281442162352128 51 | 687945926774800385 52 | 766316494695305218 53 | 693554007785234432 54 | 682548344690970624 55 | 693122701569974273 56 | 693824042164436992 57 | 693162950358622208 58 | 693830499047989248 59 | 690985215691354112 60 | 690676539323740161 61 | 687911282922631168 62 | 693670046497935361 63 | 687673284436082689 64 | 693125234317086720 65 | 689650617464311813 66 | 693629498177253376 67 | 693344498953383936 68 | 693618217667928068 69 | 651858133304782848 70 | 693662456393134080 71 | 766989078294306816 72 | 692463948076093440 73 | 686493272806576128 74 | 687630364936957952 75 | 510916647373516800 76 | 531833153145823233 77 | 407163499723624449 78 | 525088864416043008 79 | 523820806917603328 80 | 528242965915779072 81 | 536547921542791170 82 | 531634492528939008 83 | 551106923601219585 84 | 524944881941495809 85 | 536835346932441088 86 | 516978780171436032 87 | 524263570985340928 88 | 524930365400821761 89 | 524586367456919552 90 | 525024066152169473 91 | 528562608463704064 92 | 524950339074523137 93 | 528312406498635777 94 | 566089610485579776 95 | 536962520477470720 96 | 524925600318754816 97 | 551082055883563008 98 | 427924694663454720 99 | 517416417164263424 100 | 531659884430106624 101 | 407217471473451008 102 | 524933380929245184 103 | 348203818741272576 104 | 524991240270807042 105 | 513749585391390720 106 | 510916464631889920 107 | 507242819623587841 108 | 525305690257379328 109 | 536808074431184896 110 | 525040767317082113 111 | 509473920060104704 112 | 531206167302012929 113 | 524998384357486592 114 | 532297096356167680 115 | 536804445678755840 116 | 499679379820412928 117 | 518827403452637184 118 | 523126268603031552 119 | 407159686786732032 120 | 407253554039386112 121 | 514395350615203841 122 | 407185422523977728 123 | 427762638274437120 124 | 531676808836833280 125 | 407212665350942720 126 | 407233172380733441 127 | 515598200796090369 128 | 532275347413544961 129 | 524925124303396864 130 | 336913656921083904 131 | 504243239084236800 132 | 538218607822770176 133 | 524941041301225472 134 | 495305620342714369 135 | 520299904934371328 136 | 407182194206322689 137 | 530943279161155584 138 | 509478961705807872 139 | 517003426832453633 140 | 509464271118688257 141 | 538256153080127489 142 | 524965786059026432 143 | 427662266993889280 144 | 531161914689482752 145 | 524976526891417600 146 | 527162170531151872 147 | 507261372313640961 148 | 528607634099015680 149 | 560873850846846978 150 | 516804849619705859 151 | 528341588867416064 152 | 489820657291911168 153 | 532239131540467712 154 | 532281981795848192 155 | 539115704285270017 156 | 560133068670140417 157 | 514535408126795776 158 | 516636338679197697 159 | 504419526998360064 160 | 489800427152879616 161 | 509084603617792001 162 | 568568737621630977 163 | 387031585834278912 164 | 514508854990999553 165 | 489836271049928704 166 | 524178388282802176 167 | 553960736964476928 168 | 521098692326350848 169 | 547807913671405568 170 | 387030572779847680 171 | 365276206381268995 172 | 495365942726381568 173 | 501768276523761666 174 | 520284654755381249 175 | 561952533942661120 176 | 489796998615547904 177 | 504448356584677377 178 | 524144369235140608 179 | 542860306603868160 180 | 552146635707666433 181 | 532259028152246272 182 | 531565935128498176 183 | 547158281005719552 184 | 510286132568150016 185 | 455525437351800832 186 | 365497016098369536 187 | 507634536176300032 188 | 532106726539939841 189 | 535507913226190849 190 | 319166636902998016 191 | 372489152903643136 192 | 534409916560461825 193 | 521533372280369152 194 | 534303066867367937 195 | 529088963420909569 196 | 365052155385749505 197 | 489802446001434625 198 | 553098571323437056 199 | 514517213022543872 200 | 531973383198887936 201 | 555072815154475008 202 | 514555852351479808 203 | 531108688749404160 204 | 514540926640087040 205 | 553040930144792576 206 | 514512849876836352 207 | 531833233143783424 208 | 518665533089406976 209 | 436001434212249600 210 | 387041762331471872 211 | 489975398151618560 212 | 534543768653807618 213 | 515918632178577408 214 | 553136604882014208 215 | 523098334421319680 216 | 514062859987595264 217 | 560207034545889281 218 | 504450741126582275 219 | 513015596879867904 220 | 489833932813516800 221 | 534678919656775680 222 | 544154048950435840 223 | 558312304753016832 224 | 550095745161134080 225 | 544523550519218176 226 | 740791134146965504 227 | 536915851233202176 228 | 522443333831262208 229 | 752965545528528898 230 | 724603564946010112 231 | 742050150307246080 232 | 744390771869102080 233 | 531524882325311488 234 | 500391222075076610 235 | 652349108653551616 236 | 733242244522725376 237 | 705093513076015104 238 | 547587399728267264 239 | 522654603675176960 240 | 533811170889568256 241 | 533734824905670656 242 | 727854332188577792 243 | 723521076446142465 244 | 535257207991205888 245 | 516727880571572225 246 | 650710483289419776 247 | 500413818368184321 248 | 503498696273965056 249 | 724703995147751424 250 | 514308277803294721 251 | 714531423273746432 252 | 520265722967375872 253 | 517712193841037312 254 | 715671763808493569 255 | 763428684850094080 256 | 728631482722308096 257 | 757450526153900032 258 | 742571519105077248 259 | 727179214546456577 260 | 655812191233417216 261 | 726043971911213057 262 | 516361247223058432 263 | 727187859367546880 264 | 707786906189303808 265 | 500286058664579072 266 | 500295393301647360 267 | 775672628493357057 268 | 742114513726623744 269 | 516358319317852160 270 | 522692223952228353 271 | 715268937873760256 272 | 757190314880884736 273 | 711994705333112832 274 | 524925730053181440 275 | 516545908813475841 276 | 524929497205055488 277 | 535282587325833216 278 | 531193369465470976 279 | 524937542131793920 280 | 500270780832174080 281 | 652300118205427716 282 | 500281131057811456 283 | 778625026144792577 284 | 525032872647065600 285 | 500307001629745152 286 | 500381163866062848 287 | 650952376954650629 288 | 525008463819464704 289 | 531526274003771392 290 | 516411927506206721 291 | 742055437932040193 292 | 716092408920936448 293 | 701975210044497921 294 | 500278045597368320 295 | 757748522481491968 296 | 755548076438196225 297 | -------------------------------------------------------------------------------- /nfold/RNNtestSet_Twitter151_tree.txt: -------------------------------------------------------------------------------- 1 | 688027085730897921 2 | 693091255685787648 3 | 692742353736568833 4 | 691616143161819136 5 | 692932696645865472 6 | 692922211338981377 7 | 693803472806760448 8 | 693272659447119873 9 | 690680310061756416 10 | 686421576904916992 11 | 689100941119848449 12 | 693083689098477568 13 | 692004901455556608 14 | 764573523713011713 15 | 693140568143220736 16 | 687617323235147776 17 | 693600369281253376 18 | 693912520923295745 19 | 693523133920342016 20 | 767515401831997440 21 | 693457310824468480 22 | 692764799315398656 23 | 767170849472405508 24 | 691667941314662400 25 | 693921710383337472 26 | 767580827513397252 27 | 692134022839955456 28 | 693804630615166977 29 | 685633217160998912 30 | 693643778033344512 31 | 684118654418419712 32 | 766719302401613825 33 | 693071700200722433 34 | 692497796956561408 35 | 688814621034213376 36 | 767482587879051265 37 | 762775964224847872 38 | 641665203046907904 39 | 692759090469212160 40 | 693068611951300608 41 | 693456340790804480 42 | 693126696132804608 43 | 690915657106526208 44 | 686701278785843200 45 | 691064699853606913 46 | 692881863644282880 47 | 693102023764492288 48 | 765863022506151937 49 | 693802524579618816 50 | 693595814401327104 51 | 687639526282498049 52 | 767463109778894848 53 | 693198912660885505 54 | 767715489485205505 55 | 693443289370882049 56 | 693696168908423168 57 | 699252269414354944 58 | 693501482721681408 59 | 692747901815119872 60 | 693484841011060737 61 | 687734662249246724 62 | 690926324903317504 63 | 693512850539683842 64 | 690522824797196288 65 | 691809004356501505 66 | 693807822971236353 67 | 691976624665919488 68 | 693216311502073856 69 | 693899062098137088 70 | 692800345274241025 71 | 765934198297362432 72 | 767300637012951040 73 | 693769968199061504 74 | 693160939802214400 75 | 532602376398462976 76 | 407197672702214144 77 | 427846006600777729 78 | 501881262240694272 79 | 527272948680622080 80 | 407193347279699968 81 | 504106473467944960 82 | 524959836778536961 83 | 551099691702956032 84 | 524952094986350592 85 | 531183173443801088 86 | 407205404075376640 87 | 535474861616148480 88 | 407264593027670016 89 | 524185876931162112 90 | 507257950868885504 91 | 524983325275197440 92 | 518924377791164420 93 | 523863683928457216 94 | 407292452060815360 95 | 509464217549021184 96 | 524934138563133440 97 | 407164597511393280 98 | 407213772328022016 99 | 427652211414274048 100 | 407176873605865472 101 | 407184730988097536 102 | 524923293711998976 103 | 525041127343550464 104 | 524976106861236226 105 | 528676615207653376 106 | 407267881131732992 107 | 407176055657484289 108 | 407162181059612672 109 | 536849906997415936 110 | 538374385665449985 111 | 517053056211357696 112 | 562090534945431552 113 | 407192126032986112 114 | 523655026485366784 115 | 445495350171013120 116 | 524294016435634178 117 | 527286846347567104 118 | 514109888138842113 119 | 567765185407234049 120 | 514100169307348992 121 | 524757333608394752 122 | 407209892013821952 123 | 427690961280696320 124 | 436160836524965891 125 | 348204426659508226 126 | 407177474788057088 127 | 407206094747209728 128 | 524935246647926784 129 | 551128385850601472 130 | 524950264303075328 131 | 519178213441167360 132 | 407262869152358400 133 | 525039784503541760 134 | 501827465032237056 135 | 525291306000846848 136 | 514420223873941504 137 | 407181813174788096 138 | 525009850104037376 139 | 514451906211893248 140 | 525301290218553344 141 | 525077806401994754 142 | 525134787778850818 143 | 528822281972498432 144 | 545271117355958272 145 | 519530210795216896 146 | 537006518118273025 147 | 427831952826449920 148 | 507918114567499776 149 | 534461459938304001 150 | 496698590153416704 151 | 523535962962280448 152 | 489970164469751808 153 | 538847758032310272 154 | 538729383662338049 155 | 538930446814703616 156 | 524211911668543488 157 | 553103772852191233 158 | 504433135036407808 159 | 528976109518721024 160 | 549599086073368576 161 | 540643709465812992 162 | 552677176873455616 163 | 482880640560271361 164 | 568905632998412288 165 | 356297080169447425 166 | 506784541696991232 167 | 386682163862986752 168 | 265953285247209472 169 | 524320261667950592 170 | 357300409292959744 171 | 489798752438583297 172 | 557885928417816576 173 | 489872500462190593 174 | 514546272972574721 175 | 524152657783820288 176 | 356310469390245888 177 | 524289058290159616 178 | 530017051025604609 179 | 387006553124896768 180 | 490141776984825856 181 | 570405783306944514 182 | 528240834660298753 183 | 553271856786968576 184 | 497073936077959169 185 | 376982539132366848 186 | 489818014364086273 187 | 521663202183348224 188 | 490136764619948032 189 | 560187970389819392 190 | 520132836594970625 191 | 356437941641416705 192 | 560442390805090307 193 | 559863517151784960 194 | 356268980211687424 195 | 295944137948151809 196 | 377002232257855488 197 | 554688527435563008 198 | 524227209976745984 199 | 516856061182345216 200 | 524206851450486785 201 | 504500863944376321 202 | 543586319168196608 203 | 532284428542681088 204 | 534445263528947712 205 | 514072132301910016 206 | 520630231531802624 207 | 553115236992290816 208 | 568589712644026368 209 | 532199717594497024 210 | 509114008587100160 211 | 537355288295518210 212 | 436074888638763008 213 | 470025166760980483 214 | 514495841600811009 215 | 514429381737852929 216 | 553190393370923008 217 | 553264892799488000 218 | 524191650420367360 219 | 501774251901198336 220 | 514081464171102208 221 | 539254751343681536 222 | 522553662996901888 223 | 553579224402235393 224 | 763738618573623297 225 | 763524712853102596 226 | 537976883150077952 227 | 724661834419048448 228 | 715515982584881152 229 | 531300385248800768 230 | 640118021101604864 231 | 751856580874960897 232 | 516475930097643520 233 | 503714147138166784 234 | 500298752469770240 235 | 510507736287961088 236 | 547525843749470208 237 | 516390549012480001 238 | 714998347111669760 239 | 716416753409081344 240 | 521922785254580225 241 | 728038172270198787 242 | 539799806039052288 243 | 730516765525082112 244 | 747443219487678464 245 | 723511860516016128 246 | 500294803402137600 247 | 707405809181917184 248 | 538010064591028224 249 | 653285570383335424 250 | 732971411157880832 251 | 763896522790440960 252 | 730939370765754368 253 | 580325090367315968 254 | 778530869208190976 255 | 755523157700648960 256 | 716448280201269248 257 | 640182854928961536 258 | 500319801344929795 259 | 532928419051622400 260 | 544287209730236416 261 | 553538058440941568 262 | 500284699546517505 263 | 778681502825451520 264 | 521788572933062657 265 | 521772674155286528 266 | 516682897864916992 267 | 516386101766782976 268 | 553550301886955520 269 | 652982112870662144 270 | 742012307694223361 271 | 544328894812549121 272 | 663744139666804736 273 | 715253497462145024 274 | 531525016794697729 275 | 500378522788315137 276 | 740748123581087745 277 | 576829262927413248 278 | 500280422295937024 279 | 499366666300846081 280 | 722885778448121857 281 | 732004388181434368 282 | 716451800581279744 283 | 552816020403269632 284 | 656361703664451585 285 | 778572032531427332 286 | 556541489388724224 287 | 676586804242309121 288 | 701175292937707520 289 | 522453569702989824 290 | 516394449065496577 291 | 527131140721623040 292 | 544333764814323713 293 | 500327106824245249 294 | 500363126294863876 295 | 522684367647559681 296 | 727982226290442240 297 | -------------------------------------------------------------------------------- /nfold/RNNtestSet_Twitter154_tree.txt: -------------------------------------------------------------------------------- 1 | 693492349142433792 2 | 688763993633107968 3 | 692510002586714113 4 | 692707593991643136 5 | 766358933296517121 6 | 692024256520179712 7 | 693236688538243074 8 | 692692529779707904 9 | 693490132440129536 10 | 693121477491757056 11 | 692023417575448576 12 | 686422922894815233 13 | 693056396250652672 14 | 693934062445187072 15 | 693087256727388161 16 | 687766167558164481 17 | 764620072228970496 18 | 692056985513123840 19 | 688096910217879554 20 | 692736398462300162 21 | 691327238353129472 22 | 693573042111270912 23 | 692925163994796033 24 | 693102420688121856 25 | 692287441168900097 26 | 693456387880402944 27 | 692924229017309184 28 | 693481256735150082 29 | 761381302260031489 30 | 692892472729415680 31 | 693792605755285504 32 | 688437279405305856 33 | 691410231549530112 34 | 693658242044542976 35 | 689833530197671936 36 | 767528171520524288 37 | 670380354822348801 38 | 688752484966363136 39 | 688147918113538049 40 | 692267960686284800 41 | 684488313512800256 42 | 675434959939756032 43 | 665302351742275584 44 | 767444114229059584 45 | 693082547664883712 46 | 691299810553384960 47 | 693676692309700609 48 | 767068504277344260 49 | 693131575261659137 50 | 693855615618322432 51 | 767330549262278658 52 | 689799953330368513 53 | 766452700049473536 54 | 693524179597955072 55 | 693718533239365633 56 | 692472216135569409 57 | 687632433483759616 58 | 692374052082708480 59 | 688502260779843587 60 | 689722724470620161 61 | 692127290998784001 62 | 684878165714563072 63 | 693234925252775936 64 | 767768054163996672 65 | 688757736310484994 66 | 692816955837804544 67 | 678733118648524800 68 | 693509689418588160 69 | 685232704774787072 70 | 767520433247809536 71 | 692746621218656258 72 | 693204708933160960 73 | 689214940679409664 74 | 764449685897568256 75 | 513779458340569088 76 | 532276693931945984 77 | 528237933661544448 78 | 407167258452971520 79 | 574004164570841088 80 | 407209131351629824 81 | 524925033626738688 82 | 407231740764508161 83 | 407205009676587009 84 | 531085761521528834 85 | 524948703850029056 86 | 510931521306243072 87 | 551103664124100608 88 | 524593547807178753 89 | 407290871856369664 90 | 524950507023245313 91 | 524947149134774272 92 | 523026678419714048 93 | 504244627680272384 94 | 436157398269849602 95 | 562313802369073153 96 | 516321020815228929 97 | 551575491430211584 98 | 525411618231169025 99 | 535474881090322432 100 | 336873759271157760 101 | 519112613800972288 102 | 510908595144519680 103 | 525408908484280321 104 | 536827853669941248 105 | 407275991610818560 106 | 536826622725218304 107 | 524991067675189250 108 | 527308173112139776 109 | 525024181218725888 110 | 536738726693847041 111 | 524929796862918656 112 | 524979548195024898 113 | 504109775358287872 114 | 536871550184869888 115 | 407231591191035904 116 | 407197113286545409 117 | 407209222850756608 118 | 407253198395555840 119 | 524923341359300608 120 | 536504515843727361 121 | 407244865018155008 122 | 524988712367955970 123 | 562093717201616896 124 | 407254590363426816 125 | 524928119955013632 126 | 407161635439013888 127 | 562256876763901953 128 | 551135925862805504 129 | 527138218505175040 130 | 407169699559247872 131 | 407198615137181696 132 | 523943647449198592 133 | 515538937058971648 134 | 509464457836511232 135 | 510922415468449792 136 | 407262953533353984 137 | 535579674152148992 138 | 527947775905103872 139 | 522321383716818944 140 | 537913349338435584 141 | 532275383430041600 142 | 514201362729828352 143 | 524312881823637504 144 | 525040836757958657 145 | 427689948398231552 146 | 407191058108256257 147 | 514057033419849728 148 | 407187197427593217 149 | 387309869080281088 150 | 524317344730869760 151 | 514483762566922240 152 | 489974591985840128 153 | 507354546041925632 154 | 553186555150749696 155 | 540333359793451008 156 | 519704006826807296 157 | 554886875303780352 158 | 366025766183514112 159 | 532255606623989760 160 | 489874311143260160 161 | 524181699043663872 162 | 380055172896272384 163 | 514550436377137152 164 | 572002458647412736 165 | 436215971272212480 166 | 489902412900343809 167 | 495366618818830336 168 | 489854703321509888 169 | 523555724807262208 170 | 491200302365040640 171 | 519921456730607616 172 | 509031495101874176 173 | 559787890402541568 174 | 436157173161144321 175 | 543319210659971073 176 | 356407105953071107 177 | 364589696573124609 178 | 519935535083565056 179 | 504441156575297536 180 | 532284831783460864 181 | 514067907475959808 182 | 553099685888790528 183 | 568452856224747520 184 | 547509900130021377 185 | 372901260183494656 186 | 519375764165509121 187 | 509152237503778816 188 | 387236601450864641 189 | 365056836476481537 190 | 542423103834296323 191 | 524176293450223616 192 | 526459255147491328 193 | 538851683141304320 194 | 504830161993609216 195 | 521790189715615744 196 | 436195672677953536 197 | 521496155310796800 198 | 523566838958284801 199 | 489798752358916096 200 | 535315394127728641 201 | 519447199164665856 202 | 538724882461097986 203 | 538412662858588160 204 | 523562674487975937 205 | 504478567062056962 206 | 548672230134382592 207 | 507454543169617920 208 | 387009577763360768 209 | 532007252677656576 210 | 370855596050108416 211 | 326137285450018817 212 | 524881688825167872 213 | 534278078105944064 214 | 554597409351671808 215 | 501781217411215360 216 | 519962130859429888 217 | 518830518792892416 218 | 386998038004113409 219 | 491241885399539712 220 | 318263294098030593 221 | 553169307824177152 222 | 544567299102244864 223 | 531543620856197121 224 | 500327120770301952 225 | 553470492565602305 226 | 706933939953344514 227 | 552821069036670976 228 | 716439952922312704 229 | 778299287293816832 230 | 516420964834611201 231 | 655815788675399680 232 | 522468118082633729 233 | 499530130487017472 234 | 703234354579898368 235 | 727834854931435522 236 | 543436472842334209 237 | 553576010898497536 238 | 500389488217309184 239 | 748543642323783681 240 | 538900739880665088 241 | 715254040289021952 242 | 538133250066366464 243 | 524972443308683264 244 | 724348906096590849 245 | 741995157969592321 246 | 760109079133990912 247 | 517034091028676608 248 | 553544252563935234 249 | 760928376668454912 250 | 547514662695469057 251 | 728207861050970112 252 | 651809229842608128 253 | 500319675797209088 254 | 500281094239817728 255 | 707332312724283392 256 | 503610065769598976 257 | 524940659778920448 258 | 546028163134808064 259 | 500377145349521411 260 | 553503184174710784 261 | 524981436252950528 262 | 500332933098385408 263 | 521769631519092736 264 | 521770744855134208 265 | 516423807394131968 266 | 550003619303788545 267 | 650254360727973889 268 | 537484793882361856 269 | 500377906305327104 270 | 716457799392342018 271 | 576513463738109954 272 | 500363740311982081 273 | 516425769560866817 274 | 553184482241814530 275 | 724624672604610562 276 | 521444489697583104 277 | 516434071631974400 278 | 524926472432410625 279 | 549998575330275330 280 | 544939287222165506 281 | 524927281048080385 282 | 500341884678836224 283 | 752875379765968897 284 | 544510450101415936 285 | 726442550266044416 286 | 500279189405433858 287 | 522782267215982592 288 | 544512910538838016 289 | 535484342785830912 290 | 743058135300988932 291 | 648993731169939456 292 | 553518472798683136 293 | 651486105628463105 294 | 533767270091087872 295 | 706665777332621314 296 | 517038566061658114 297 | -------------------------------------------------------------------------------- /model/evaluate.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | @object: weibo & twitter 4 | @task: split train & test, evaluate performance 5 | @author: majing 6 | @variable: T, 7 | @time: Tue Nov 10 16:29:42 2015 8 | """ 9 | 10 | import sys 11 | reload(sys) 12 | sys.setdefaultencoding('utf-8') 13 | 14 | import random 15 | import os 16 | import re 17 | import math 18 | import numpy as np 19 | 20 | ################## evaluation of model result ##################### 21 | def evaluation(prediction, y): ## no. of time series 22 | TP = 0 23 | TN = 0 24 | FP = 0 25 | FN = 0 26 | e = 0.000001 27 | threshhold = 0.5 28 | fout = open(outevalPath, 'w') 29 | for i in range(len(y)): 30 | fout.write(str(y[i][0])+"\t"+str(prediction[i][0])+"\n") 31 | if y[i][0] == 1 and prediction[i][0] >= threshhold: 32 | TP += 1 33 | if y[i][0] == 1 and prediction[i][0] < threshhold: 34 | FN += 1 35 | if y[i][0] == 0 and prediction[i][0] >= threshhold: 36 | FP += 1 37 | if y[i][0] == 0 and prediction[i][0] < threshhold: 38 | TN += 1 39 | fout.close() 40 | accu = float(TP+TN)/(TP+TN+FP+FN+e) 41 | prec_r = float(TP)/(TP+FP+e) ## for rumor 42 | recall_r = float(TP)/(TP+FN+e) 43 | F_r = 2 * prec_r*recall_r / (prec_r + recall_r+e) 44 | prec_f = float(TN)/(TN+FN+e) ## for fact 45 | recall_f = float(TN)/(TN+FP+e) 46 | F_f = 2 * prec_f*recall_f / (prec_f + recall_f+e) 47 | return [accu, prec_r, recall_r, F_r, prec_f, recall_f, F_f] 48 | 49 | def evaluation_2class(prediction, y): # 4 dim 50 | TP1, FP1, FN1, TN1 = 0, 0, 0, 0 51 | TP2, FP2, FN2, TN2 = 0, 0, 0, 0 52 | e, RMSE, RMSE1, RMSE2 = 0.000001, 0.0, 0.0, 0.0 53 | for i in range(len(y)): 54 | y_i, p_i = list(y[i]), list(prediction[i][0]) 55 | ##RMSE 56 | for j in range(len(y_i)): 57 | RMSE += (y_i[j]-p_i[j])**2 58 | RMSE1 += (y_i[0]-p_i[0])**2 59 | RMSE2 += (y_i[1]-p_i[1])**2 60 | ## Pre, Recall, F 61 | Act = str(y_i.index(max(y_i))+1) 62 | Pre = str(p_i.index(max(p_i))+1) 63 | 64 | ## for class 1 65 | if Act == '1' and Pre == '1': TP1 += 1 66 | if Act == '1' and Pre != '1': FN1 += 1 67 | if Act != '1' and Pre == '1': FP1 += 1 68 | if Act != '1' and Pre != '1': TN1 += 1 69 | ## for class 2 70 | if Act == '2' and Pre == '2': TP2 += 1 71 | if Act == '2' and Pre != '2': FN2 += 1 72 | if Act != '2' and Pre == '2': FP2 += 1 73 | if Act != '2' and Pre != '2': TN2 += 1 74 | 75 | ## print result 76 | Acc_all = round( float(TP1+TP2)/float(len(y)+e), 4 ) 77 | Prec1 = round( float(TP1)/float(TP1+FP1+e), 4 ) 78 | Recll1 = round( float(TP1)/float(TP1+FN1+e), 4 ) 79 | F1 = round( 2*Prec1*Recll1/(Prec1+Recll1+e), 4 ) 80 | 81 | Prec2 = round( float(TP2)/float(TP2+FP2+e), 4 ) 82 | Recll2 = round( float(TP2)/float(TP2+FN2+e), 4 ) 83 | F2 = round( 2*Prec2*Recll2/(Prec2+Recll2+e), 4 ) 84 | 85 | RMSE_all = round( ( RMSE/len(y) )**0.5, 4) 86 | RMSE_all_1 = round( ( RMSE1/len(y) )**0.5, 4) 87 | RMSE_all_2 = round( ( RMSE2/len(y) )**0.5, 4) 88 | 89 | RMSE_all_avg = round( ( RMSE_all_1+RMSE_all_2 )/2, 4) 90 | return [Acc_all, RMSE_all, RMSE_all_avg, 'C1:', Prec1, Prec1, Recll1, F1,'\n', 91 | 'C2:', Prec2, Prec2, Recll2, F2,'\n'] 92 | 93 | def evaluation_4class(prediction, y): # 4 dim 94 | TP1, FP1, FN1, TN1 = 0, 0, 0, 0 95 | TP2, FP2, FN2, TN2 = 0, 0, 0, 0 96 | TP3, FP3, FN3, TN3 = 0, 0, 0, 0 97 | TP4, FP4, FN4, TN4 = 0, 0, 0, 0 98 | e, RMSE, RMSE1, RMSE2, RMSE3, RMSE4 = 0.000001, 0.0, 0.0, 0.0, 0.0, 0.0 99 | for i in range(len(y)): 100 | y_i, p_i = list(y[i]), list(prediction[i][0]) 101 | ##RMSE 102 | for j in range(len(y_i)): 103 | RMSE += (y_i[j]-p_i[j])**2 104 | RMSE1 += (y_i[0]-p_i[0])**2 105 | RMSE2 += (y_i[1]-p_i[1])**2 106 | RMSE3 += (y_i[2]-p_i[2])**2 107 | RMSE4 += (y_i[3]-p_i[3])**2 108 | ## Pre, Recall, F 109 | Act = str(y_i.index(max(y_i))+1) 110 | Pre = str(p_i.index(max(p_i))+1) 111 | 112 | #print y_i, p_i 113 | #print Act, Pre 114 | ## for class 1 115 | if Act == '1' and Pre == '1': TP1 += 1 116 | if Act == '1' and Pre != '1': FN1 += 1 117 | if Act != '1' and Pre == '1': FP1 += 1 118 | if Act != '1' and Pre != '1': TN1 += 1 119 | ## for class 2 120 | if Act == '2' and Pre == '2': TP2 += 1 121 | if Act == '2' and Pre != '2': FN2 += 1 122 | if Act != '2' and Pre == '2': FP2 += 1 123 | if Act != '2' and Pre != '2': TN2 += 1 124 | ## for class 3 125 | if Act == '3' and Pre == '3': TP3 += 1 126 | if Act == '3' and Pre != '3': FN3 += 1 127 | if Act != '3' and Pre == '3': FP3 += 1 128 | if Act != '3' and Pre != '3': TN3 += 1 129 | ## for class 4 130 | if Act == '4' and Pre == '4': TP4 += 1 131 | if Act == '4' and Pre != '4': FN4 += 1 132 | if Act != '4' and Pre == '4': FP4 += 1 133 | if Act != '4' and Pre != '4': TN4 += 1 134 | ## print result 135 | Acc_all = round( float(TP1+TP2+TP3+TP4)/float(len(y)+e), 4 ) 136 | Acc1 = round( float(TP1+TN1)/float(TP1+TN1+FN1+FP1+e), 4 ) 137 | Prec1 = round( float(TP1)/float(TP1+FP1+e), 4 ) 138 | Recll1 = round( float(TP1)/float(TP1+FN1+e), 4 ) 139 | F1 = round( 2*Prec1*Recll1/(Prec1+Recll1+e), 4 ) 140 | 141 | Acc2 = round( float(TP2+TN2)/float(TP2+TN2+FN2+FP2+e), 4 ) 142 | Prec2 = round( float(TP2)/float(TP2+FP2+e), 4 ) 143 | Recll2 = round( float(TP2)/float(TP2+FN2+e), 4 ) 144 | F2 = round( 2*Prec2*Recll2/(Prec2+Recll2+e), 4 ) 145 | 146 | Acc3 = round( float(TP3+TN3)/float(TP3+TN3+FN3+FP3+e), 4 ) 147 | Prec3 = round( float(TP3)/float(TP3+FP3+e), 4 ) 148 | Recll3 = round( float(TP3)/float(TP3+FN3+e), 4 ) 149 | F3 = round( 2*Prec3*Recll3/(Prec3+Recll3+e), 4 ) 150 | 151 | Acc4 = round( float(TP4+TN4)/float(TP4+TN4+FN4+FP4+e), 4 ) 152 | Prec4 = round( float(TP4)/float(TP4+FP4+e), 4 ) 153 | Recll4 = round( float(TP4)/float(TP4+FN4+e), 4 ) 154 | F4 = round( 2*Prec4*Recll4/(Prec4+Recll4+e), 4 ) 155 | 156 | microF = round( (F1+F2+F3+F4)/4,5 ) 157 | RMSE_all = round( ( RMSE/len(y) )**0.5, 4) 158 | RMSE_all_1 = round( ( RMSE1/len(y) )**0.5, 4) 159 | RMSE_all_2 = round( ( RMSE2/len(y) )**0.5, 4) 160 | RMSE_all_3 = round( ( RMSE3/len(y) )**0.5, 4) 161 | RMSE_all_4 = round( ( RMSE4/len(y) )**0.5, 4) 162 | RMSE_all_avg = round( ( RMSE_all_1+RMSE_all_2+RMSE_all_3+RMSE_all_4 )/4, 4) 163 | return ['acc:', Acc_all, 'Favg:',microF, RMSE_all, RMSE_all_avg, 164 | 'C1:',Acc1, Prec1, Recll1, F1, 165 | 'C2:',Acc2, Prec2, Recll2, F2, 166 | 'C3:',Acc3, Prec3, Recll3, F3, 167 | 'C4:',Acc4, Prec4, Recll4, F4] 168 | 169 | def write2Predict_oneVSall(prediction, y, resultPath): ## no. of time series 170 | fout = open(resultPath, 'w') 171 | for i in range(len(y)): 172 | fout.write(str(prediction[i][0])+"\n") 173 | fout.close() 174 | 175 | def write2Predict_4class(prediction, y, resultPath): ## no. of time series 176 | fout = open(resultPath, 'w') 177 | for i in range(len(y)): 178 | data1 = str(y[i][0])+' '+str(y[i][1])+' '+str(y[i][2])+' '+str(y[i][3]) 179 | data2 = str(prediction[i][0])+' '+str(prediction[i][1])+' '+str(prediction[i][2])+' '+str(prediction[i][3]) 180 | fout.write(data1+'\t'+data2+"\n") 181 | fout.close() 182 | 183 | #################################### MAIN ############################################## 184 | 185 | -------------------------------------------------------------------------------- /model/Main_BU_RvNN.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | @object: Twitter 4 | @task: Main function of recursive NN (4 classes) 5 | @author: majing 6 | @structure: bottom-up recursive neural networks 7 | @variable: Nepoch, lr, obj, fold 8 | @time: Jan 24, 2018 9 | """ 10 | 11 | import sys 12 | reload(sys) 13 | sys.setdefaultencoding('utf-8') 14 | 15 | import os 16 | import BU_RvNN 17 | 18 | import theano 19 | from theano import tensor as T 20 | import numpy as np 21 | from numpy.testing import assert_array_almost_equal 22 | 23 | import time 24 | import datetime 25 | import random 26 | from evaluate import * 27 | #from Util import * 28 | 29 | obj = "Twitter15" # choose dataset, you can choose either "Twitter15" or "Twitter16" 30 | fold = "3" # fold index, choose from 0-4 31 | tag = "" 32 | vocabulary_size = 5000 33 | hidden_dim = 100 34 | Nclass = 4 35 | Nepoch = 500 36 | lr = 0.005 37 | 38 | unit="BU_RvNN-"+obj+str(fold)+'-vol.'+str(vocabulary_size)+tag 39 | #lossPath = "../loss/loss-"+unit+".txt" 40 | #modelPath = "../param/param-"+unit+".npz" 41 | 42 | treePath = '../resource/data.BU_RvNN.vol_'+str(vocabulary_size)+tag+'.txt' 43 | 44 | trainPath = "../nfold/RNNtrainSet_"+obj+str(fold)+"_tree.txt" 45 | testPath = "../nfold/RNNtestSet_"+obj+str(fold)+"_tree.txt" 46 | labelPath = "../resource/"+obj+"_label_All.txt" 47 | 48 | #floss = open(lossPath, 'a+') 49 | 50 | ################################### tools ##################################### 51 | def str2matrix(Str, MaxL): # str = index:wordfreq index:wordfreq 52 | wordFreq, wordIndex = [], [] 53 | l = 0 54 | for pair in Str.split(' '): 55 | wordFreq.append(float(pair.split(':')[1])) 56 | wordIndex.append(int(pair.split(':')[0])) 57 | l += 1 58 | ladd = [ 0 for i in range( MaxL-l ) ] 59 | wordFreq += ladd 60 | wordIndex += ladd 61 | #print MaxL, l, len(Str.split(' ')), len(wordFreq) 62 | #print Str.split(' ') 63 | return wordFreq, wordIndex 64 | 65 | def loadLabel(label, l1, l2, l3, l4): 66 | labelset_nonR, labelset_f, labelset_t, labelset_u = ['news', 'non-rumor'], ['false'], ['true'], ['unverified'] 67 | if label in labelset_nonR: 68 | y_train = [1,0,0,0] 69 | l1 += 1 70 | if label in labelset_f: 71 | y_train = [0,1,0,0] 72 | l2 += 1 73 | if label in labelset_t: 74 | y_train = [0,0,1,0] 75 | l3 += 1 76 | if label in labelset_u: 77 | y_train = [0,0,0,1] 78 | l4 += 1 79 | return y_train, l1,l2,l3,l4 80 | 81 | def constructTree(tree): 82 | ## tree: {index1:{'parent':, 'maxL':, 'vec':} 83 | ## 1. ini tree node 84 | index2node = {} 85 | for i in tree: 86 | node = BU_RvNN.Node_tweet(idx=i) 87 | index2node[i] = node 88 | ## 2. construct tree 89 | for j in tree: 90 | indexC = j 91 | indexP = tree[j]['parent'] 92 | nodeC = index2node[indexC] 93 | wordFreq, wordIndex = str2matrix( tree[j]['vec'], tree[j]['maxL'] ) 94 | #print tree[j]['maxL'] 95 | nodeC.index = wordIndex 96 | nodeC.word = wordFreq 97 | ## not root node ## 98 | if not indexP == 'None': 99 | nodeP = index2node[int(indexP)] 100 | nodeC.parent = nodeP 101 | nodeP.children.append(nodeC) 102 | ## root node ## 103 | else: 104 | root = nodeC 105 | ## 3. convert tree to DNN input 106 | degree = tree[j]['max_degree'] 107 | x_word, x_index, tree = BU_RvNN.gen_nn_inputs(root, max_degree=degree, only_leaves_have_vals=False) 108 | return x_word, x_index, tree 109 | 110 | ################################# loas data ################################### 111 | def loadData(): 112 | print "loading tree label", 113 | labelDic = {} 114 | for line in open(labelPath): 115 | line = line.rstrip() 116 | label, eid = line.split('\t')[0], line.split('\t')[2] 117 | labelDic[eid] = label.lower() 118 | print len(labelDic) 119 | 120 | print "reading tree", ## X 121 | treeDic = {} 122 | for line in open(treePath): 123 | line = line.rstrip() 124 | eid, indexP, indexC = line.split('\t')[0], line.split('\t')[1], int(line.split('\t')[2]) 125 | max_degree, maxL, Vec = int(line.split('\t')[3]), int(line.split('\t')[4]), line.split('\t')[5] 126 | if not treeDic.has_key(eid): 127 | treeDic[eid] = {} 128 | treeDic[eid][indexC] = {'parent':indexP, 'max_degree':max_degree, 'maxL':maxL, 'vec':Vec} 129 | print 'tree no:', len(treeDic) 130 | 131 | print "loading train set", 132 | tree_train, word_train, index_train, y_train, c = [], [], [], [], 0 133 | l1,l2,l3,l4 = 0,0,0,0 134 | for eid in open(trainPath): 135 | #if c > 8: break 136 | eid = eid.rstrip() 137 | if not labelDic.has_key(eid): continue 138 | if not treeDic.has_key(eid): continue 139 | if len(treeDic[eid]) < 2: continue 140 | ## 1. load label 141 | label = labelDic[eid] 142 | y, l1,l2,l3,l4 = loadLabel(label, l1, l2, l3, l4) 143 | y_train.append(y) 144 | ## 2. construct tree 145 | #print eid 146 | x_word, x_index, tree = constructTree(treeDic[eid]) 147 | tree_train.append(tree) 148 | word_train.append(x_word) 149 | index_train.append(x_index) 150 | c += 1 151 | print l1,l2,l3,l4 152 | 153 | print "loading test set", 154 | tree_test, word_test, index_test, y_test, c = [], [], [], [], 0 155 | l1,l2,l3,l4 = 0,0,0,0 156 | for eid in open(testPath): 157 | #if c > 4: break 158 | eid = eid.rstrip() 159 | if not labelDic.has_key(eid): continue 160 | if not treeDic.has_key(eid): continue 161 | if len(treeDic[eid]) < 2: continue 162 | ## 1. load label 163 | label = labelDic[eid] 164 | y, l1,l2,l3,l4 = loadLabel(label, l1, l2, l3, l4) 165 | y_test.append(y) 166 | ## 2. construct tree 167 | x_word, x_index, tree = constructTree(treeDic[eid]) 168 | tree_test.append(tree) 169 | word_test.append(x_word) 170 | index_test.append(x_index) 171 | c += 1 172 | print l1,l2,l3,l4 173 | print "train no:", len(tree_train), len(word_train), len(index_train),len(y_train) 174 | print "test no:", len(tree_test), len(word_test), len(index_test), len(y_test) 175 | print "dim1 for 0:", len(tree_train[0]), len(word_train[0]), len(index_train[0]) 176 | print "case 0:", tree_train[0][0], word_train[0][0], index_train[0][0] 177 | #exit(0) 178 | return tree_train, word_train, index_train, y_train, tree_test, word_test, index_test, y_test 179 | 180 | ##################################### MAIN #################################### 181 | ## 1. load tree & word & index & label 182 | tree_train, word_train, index_train, y_train, tree_test, word_test, index_test, y_test = loadData() 183 | 184 | ## 2. ini RNN model 185 | t0 = time.time() 186 | model = BU_RvNN.RvNN(vocabulary_size, hidden_dim, Nclass) 187 | t1 = time.time() 188 | print 'Recursive model established,', (t1-t0)/60 189 | 190 | #if os.path.isfile(modelPath): 191 | # load_model_Recursive_gruEmb(modelPath, model) 192 | ######debug here###### 193 | #print len(tree_test[121]), len(index_test[121]), len(word_test[121]) 194 | #print tree_test[121] 195 | #exit(0) 196 | #loss, pred_y = model.train_step_up(word_test[121], index_test[121], tree_test[121], y_test[121], lr) 197 | #print loss, pred_y 198 | #exit(0) 199 | ###################### 200 | 201 | ## 3. looping SGD 202 | losses_5, losses = [], [] 203 | num_examples_seen = 0 204 | for epoch in range(Nepoch): 205 | ## one SGD 206 | indexs = [i for i in range(len(y_train))] 207 | random.shuffle(indexs) 208 | for i in indexs: 209 | #print i, 210 | loss, pred_y = model.train_step_up(word_train[i], index_train[i], tree_train[i], y_train[i], lr) 211 | #print loss, pred_y 212 | losses.append(loss) 213 | num_examples_seen += 1 214 | print "epoch=%d: loss=%f" % ( epoch, np.mean(losses) ) 215 | #floss.write(str(time)+": epoch="+str(epoch)+" loss="+str(loss) +'\n') 216 | sys.stdout.flush() 217 | 218 | ## cal loss & evaluate 219 | if epoch % 5 == 0: 220 | losses_5.append((num_examples_seen, np.mean(losses))) 221 | time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') 222 | print "%s: Loss after num_examples_seen=%d epoch=%d: %f" % (time, num_examples_seen, epoch, np.mean(losses)) 223 | #floss.write(str(time)+": epoch="+str(epoch)+" loss="+str(loss) +'\n') 224 | #floss.flush() 225 | sys.stdout.flush() 226 | prediction = [] 227 | for j in range(len(y_test)): 228 | #print j 229 | prediction.append(model.predict_up(word_test[j], index_test[j], tree_test[j]) ) 230 | res = evaluation_4class(prediction, y_test) 231 | print 'results:', res 232 | #floss.write(str(res)+'\n') 233 | #floss.flush() 234 | sys.stdout.flush() 235 | ## Adjust the learning rate if loss increases 236 | if len(losses_5) > 1 and losses_5[-1][1] > losses_5[-2][1]: 237 | lr = lr * 0.5 238 | print "Setting learning rate to %f" % lr 239 | #floss.write("Setting learning rate to:"+str(lr)+'\n') 240 | #floss.flush() 241 | sys.stdout.flush() 242 | #save_model_Recursive_gruEmb(modelPath, model) 243 | sys.stdout.flush() 244 | losses = [] 245 | 246 | #floss.close() 247 | -------------------------------------------------------------------------------- /model/Main_TD_RvNN.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | """ 3 | @object: Twitter 4 | @task: Main function of recursive NN (4 classes) 5 | @author: majing 6 | @structure: Top-Down recursive Neural Networks 7 | @variable: Nepoch, lr, obj, fold 8 | @time: Jan 24, 2018 9 | """ 10 | 11 | import sys 12 | reload(sys) 13 | sys.setdefaultencoding('utf-8') 14 | 15 | import TD_RvNN 16 | import math 17 | 18 | import theano 19 | from theano import tensor as T 20 | import numpy as np 21 | from numpy.testing import assert_array_almost_equal 22 | 23 | import time 24 | import datetime 25 | import random 26 | from evaluate import * 27 | #from Util import * 28 | 29 | obj = "Twitter15" # choose dataset, you can choose either "Twitter15" or "Twitter16" 30 | fold = "2" # fold index, choose from 0-4 31 | tag = "_u2b" 32 | vocabulary_size = 5000 33 | hidden_dim = 100 34 | Nclass = 4 35 | Nepoch = 600 36 | lr = 0.005 37 | 38 | unit="TD_RvNN-"+obj+str(fold)+'-vol.'+str(vocabulary_size)+tag 39 | #lossPath = "../loss/loss-"+unit+".txt" 40 | #modelPath = "../param/param-"+unit+".npz" 41 | 42 | treePath = '../resource/data.TD_RvNN.vol_'+str(vocabulary_size)+'.txt' 43 | 44 | trainPath = "../nfold/RNNtrainSet_"+obj+str(fold)+"_tree.txt" 45 | testPath = "../nfold/RNNtestSet_"+obj+str(fold)+"_tree.txt" 46 | labelPath = "../resource/"+obj+"_label_All.txt" 47 | 48 | #floss = open(lossPath, 'a+') 49 | 50 | ################################### tools ##################################### 51 | def str2matrix(Str, MaxL): # str = index:wordfreq index:wordfreq 52 | wordFreq, wordIndex = [], [] 53 | l = 0 54 | for pair in Str.split(' '): 55 | wordFreq.append(float(pair.split(':')[1])) 56 | wordIndex.append(int(pair.split(':')[0])) 57 | l += 1 58 | ladd = [ 0 for i in range( MaxL-l ) ] 59 | wordFreq += ladd 60 | wordIndex += ladd 61 | #print MaxL, l, len(Str.split(' ')), len(wordFreq) 62 | #print Str.split(' ') 63 | return wordFreq, wordIndex 64 | 65 | def loadLabel(label, l1, l2, l3, l4): 66 | labelset_nonR, labelset_f, labelset_t, labelset_u = ['news', 'non-rumor'], ['false'], ['true'], ['unverified'] 67 | if label in labelset_nonR: 68 | y_train = [1,0,0,0] 69 | l1 += 1 70 | if label in labelset_f: 71 | y_train = [0,1,0,0] 72 | l2 += 1 73 | if label in labelset_t: 74 | y_train = [0,0,1,0] 75 | l3 += 1 76 | if label in labelset_u: 77 | y_train = [0,0,0,1] 78 | l4 += 1 79 | return y_train, l1,l2,l3,l4 80 | 81 | def constructTree(tree): 82 | ## tree: {index1:{'parent':, 'maxL':, 'vec':} 83 | ## 1. ini tree node 84 | index2node = {} 85 | for i in tree: 86 | node = TD_RvNN.Node_tweet(idx=i) 87 | index2node[i] = node 88 | ## 2. construct tree 89 | for j in tree: 90 | indexC = j 91 | indexP = tree[j]['parent'] 92 | nodeC = index2node[indexC] 93 | wordFreq, wordIndex = str2matrix( tree[j]['vec'], tree[j]['maxL'] ) 94 | #print tree[j]['maxL'] 95 | nodeC.index = wordIndex 96 | nodeC.word = wordFreq 97 | #nodeC.time = tree[j]['post_t'] 98 | ## not root node ## 99 | if not indexP == 'None': 100 | nodeP = index2node[int(indexP)] 101 | nodeC.parent = nodeP 102 | nodeP.children.append(nodeC) 103 | ## root node ## 104 | else: 105 | root = nodeC 106 | ## 3. convert tree to DNN input 107 | parent_num = tree[j]['parent_num'] 108 | ini_x, ini_index = str2matrix( "0:0", tree[j]['maxL'] ) 109 | #x_word, x_index, tree = tree_gru_u2b.gen_nn_inputs(root, ini_x, ini_index) 110 | x_word, x_index, tree = TD_RvNN.gen_nn_inputs(root, ini_x) 111 | return x_word, x_index, tree, parent_num 112 | 113 | ################################# loas data ################################### 114 | def loadData(): 115 | print "loading tree label", 116 | labelDic = {} 117 | for line in open(labelPath): 118 | line = line.rstrip() 119 | label, eid = line.split('\t')[0], line.split('\t')[2] 120 | labelDic[eid] = label.lower() 121 | print len(labelDic) 122 | 123 | print "reading tree", ## X 124 | treeDic = {} 125 | for line in open(treePath): 126 | line = line.rstrip() 127 | eid, indexP, indexC = line.split('\t')[0], line.split('\t')[1], int(line.split('\t')[2]) 128 | parent_num, maxL = int(line.split('\t')[3]), int(line.split('\t')[4]) 129 | Vec = line.split('\t')[5] 130 | if not treeDic.has_key(eid): 131 | treeDic[eid] = {} 132 | treeDic[eid][indexC] = {'parent':indexP, 'parent_num':parent_num, 'maxL':maxL, 'vec':Vec} 133 | print 'tree no:', len(treeDic) 134 | 135 | print "loading train set", 136 | tree_train, word_train, index_train, y_train, parent_num_train, c = [], [], [], [], [], 0 137 | l1,l2,l3,l4 = 0,0,0,0 138 | for eid in open(trainPath): 139 | #if c > 8: break 140 | eid = eid.rstrip() 141 | if not labelDic.has_key(eid): continue 142 | if not treeDic.has_key(eid): continue 143 | if len(treeDic[eid]) <= 0: 144 | #print labelDic[eid] 145 | continue 146 | ## 1. load label 147 | label = labelDic[eid] 148 | y, l1,l2,l3,l4 = loadLabel(label, l1, l2, l3, l4) 149 | y_train.append(y) 150 | ## 2. construct tree 151 | #print eid 152 | x_word, x_index, tree, parent_num = constructTree(treeDic[eid]) 153 | tree_train.append(tree) 154 | word_train.append(x_word) 155 | index_train.append(x_index) 156 | parent_num_train.append(parent_num) 157 | #print treeDic[eid] 158 | #print tree, child_num 159 | #exit(0) 160 | c += 1 161 | print l1,l2,l3,l4 162 | 163 | print "loading test set", 164 | tree_test, word_test, index_test, parent_num_test, y_test, c = [], [], [], [], [], 0 165 | l1,l2,l3,l4 = 0,0,0,0 166 | for eid in open(testPath): 167 | #if c > 4: break 168 | eid = eid.rstrip() 169 | if not labelDic.has_key(eid): continue 170 | if not treeDic.has_key(eid): continue 171 | if len(treeDic[eid]) <= 0: 172 | #print labelDic[eid] 173 | continue 174 | ## 1. load label 175 | label = labelDic[eid] 176 | y, l1,l2,l3,l4 = loadLabel(label, l1, l2, l3, l4) 177 | y_test.append(y) 178 | ## 2. construct tree 179 | x_word, x_index, tree, parent_num = constructTree(treeDic[eid]) 180 | tree_test.append(tree) 181 | word_test.append(x_word) 182 | index_test.append(x_index) 183 | parent_num_test.append(parent_num) 184 | c += 1 185 | print l1,l2,l3,l4 186 | print "train no:", len(tree_train), len(word_train), len(index_train),len(parent_num_train), len(y_train) 187 | print "test no:", len(tree_test), len(word_test), len(index_test), len(parent_num_test), len(y_test) 188 | print "dim1 for 0:", len(tree_train[0]), len(word_train[0]), len(index_train[0]) 189 | print "case 0:", tree_train[0][0], word_train[0][0], index_train[0][0], parent_num_train[0] 190 | #print index_train[0] 191 | #print word_train[0] 192 | #print tree_train[0] 193 | #exit(0) 194 | return tree_train, word_train, index_train, parent_num_train, y_train, tree_test, word_test, index_test, parent_num_test, y_test 195 | 196 | ##################################### MAIN #################################### 197 | ## 1. load tree & word & index & label 198 | tree_train, word_train, index_train, parent_num_train, y_train, tree_test, word_test, index_test, parent_num_test, y_test = loadData() 199 | 200 | ## 2. ini RNN model 201 | t0 = time.time() 202 | model = TD_RvNN.RvNN(vocabulary_size, hidden_dim, Nclass) 203 | t1 = time.time() 204 | print 'Recursive model established,', (t1-t0)/60 205 | 206 | #if os.path.isfile(modelPath): 207 | # load_model_Recursive_gruEmb(modelPath, model) 208 | # lr = 0.0001 209 | 210 | ######debug here###### 211 | #print len(tree_test[121]), len(index_test[121]), len(word_test[121]) 212 | #print tree_test[121] 213 | #exit(0) 214 | #loss, pred_y = model.train_step_up(word_test[121], index_test[121], tree_test[121], y_test[121], lr) 215 | #print loss, pred_y 216 | #exit(0) 217 | '''i=568 218 | loss, pred_y = model.train_step_up(word_train[i], index_train[i], parent_num_train[i], tree_train[i], y_train[i], lr) 219 | print loss, pred_y 220 | print len(tree_train[i]), len(word_train[i]), parent_num_train[i] 221 | print tree_train[i] 222 | print word_train[i] 223 | print 'final_state:',model._evaluate(word_train[i], index_train[i], parent_num_train[i], tree_train[i]) 224 | tree_states=model._evaluate2(word_train[i], index_train[i], parent_num_train[i], tree_train[i]) 225 | print 'tree_states:', tree_states 226 | print tree_states[-1:].mean(axis=0) 227 | tree_states_test=model._evaluate3(word_train[i], index_train[i], tree_train[i]) 228 | print 'l:',len(tree_states_test) 229 | print 'lo:',tree_states_test[parent_num_train[i]:]''' 230 | ###################### 231 | 232 | ## 3. looping SGD 233 | losses_5, losses = [], [] 234 | num_examples_seen = 0 235 | for epoch in range(Nepoch): 236 | ## one SGD 237 | indexs = [i for i in range(len(y_train))] 238 | #random.shuffle(indexs) 239 | for i in indexs: 240 | '''print i,":", len(tree_train[i]) 241 | print tree_train[i] 242 | tree_state = model._state(word_train[i], index_train[i], child_num_train[i], tree_train[i]) 243 | print len(tree_state) 244 | print tree_state 245 | evl = model._evaluate(word_train[i], index_train[i], child_num_train[i], tree_train[i]) 246 | print len(evl) 247 | print evl''' 248 | loss, pred_y = model.train_step_up(word_train[i], index_train[i], parent_num_train[i], tree_train[i], y_train[i], lr) 249 | #print loss, pred_y 250 | losses.append(round(loss,2)) 251 | '''if math.isnan(loss): 252 | # continue 253 | print loss, pred_y 254 | print i 255 | print len(tree_train[i]), len(word_train[i]), parent_num_train[i] 256 | print tree_train[i] 257 | print word_train[i] 258 | print 'final_state:',model._evaluate(word_train[i], index_train[i], parent_num_train[i], tree_train[i])''' 259 | num_examples_seen += 1 260 | print "epoch=%d: loss=%f" % ( epoch, np.mean(losses) ) 261 | #floss.write(str(time)+": epoch="+str(epoch)+" loss="+str(loss) +'\n') 262 | sys.stdout.flush() 263 | #print losses 264 | #exit(0) 265 | 266 | ## cal loss & evaluate 267 | if epoch % 5 == 0: 268 | losses_5.append((num_examples_seen, np.mean(losses))) 269 | time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S') 270 | print "%s: Loss after num_examples_seen=%d epoch=%d: %f" % (time, num_examples_seen, epoch, np.mean(losses)) 271 | #floss.write(str(time)+": epoch="+str(epoch)+" loss="+str(loss) +'\n') 272 | #floss.flush() 273 | sys.stdout.flush() 274 | prediction = [] 275 | for j in range(len(y_test)): 276 | #print j 277 | prediction.append(model.predict_up(word_test[j], index_test[j], parent_num_test[j], tree_test[j]) ) 278 | res = evaluation_4class(prediction, y_test) 279 | print 'results:', res 280 | #floss.write(str(res)+'\n') 281 | #floss.flush() 282 | sys.stdout.flush() 283 | ## Adjust the learning rate if loss increases 284 | if len(losses_5) > 1 and losses_5[-1][1] > losses_5[-2][1]: 285 | lr = lr * 0.5 286 | print "Setting learning rate to %f" % lr 287 | #floss.write("Setting learning rate to:"+str(lr)+'\n') 288 | #floss.flush() 289 | sys.stdout.flush() 290 | #save_model_Recursive_gruEmb(modelPath, model) 291 | #floss.flush() 292 | losses = [] 293 | 294 | #floss.close() 295 | -------------------------------------------------------------------------------- /model/BU_RvNN.py: -------------------------------------------------------------------------------- 1 | __doc__ = """Tree GRU aka Recursive Neural Networks.""" 2 | 3 | import numpy as np 4 | import theano 5 | from theano import tensor as T 6 | #from collections import OrderedDict 7 | from theano.compat.python2x import OrderedDict 8 | 9 | 10 | theano.config.floatX = 'float64' 11 | 12 | 13 | class Node_tweet(object): 14 | def __init__(self, idx=None): 15 | self.children = [] 16 | #self.index = index 17 | self.idx = idx 18 | self.word = [] 19 | self.index = [] 20 | #self.height = 1 21 | #self.size = 1 22 | #self.num_leaves = 1 23 | self.parent = None 24 | #self.label = None 25 | 26 | ################################# generate tree structure ############################## 27 | def gen_nn_inputs(root_node, max_degree=None, only_leaves_have_vals=True, with_labels=False): 28 | """Given a root node, returns the appropriate inputs to NN. 29 | 30 | The NN takes in 31 | x: the values at the leaves (e.g. word indices) 32 | tree: a (n x degree) matrix that provides the computation order. 33 | Namely, a row tree[i] = [a, b, c] in tree signifies that a 34 | and b are children of c, and that the computation 35 | f(a, b) -> c should happen on step i. 36 | 37 | """ 38 | _clear_indices(root_node) 39 | #x, leaf_labels = _get_leaf_vals(root_node) 40 | X_word, X_index = _get_leaf_vals(root_node) 41 | tree, internal_word, internal_index = _get_tree_traversal(root_node, len(X_word), max_degree) 42 | #assert all(v is not None for v in x) 43 | #if not only_leaves_have_vals: 44 | # assert all(v is not None for v in internal_x) 45 | X_word.extend(internal_word) 46 | X_index.extend(internal_index) 47 | if max_degree is not None: 48 | assert all(len(t) == max_degree + 1 for t in tree) 49 | '''if with_labels: 50 | labels = leaf_labels + internal_labels 51 | labels_exist = [l is not None for l in labels] 52 | labels = [l or 0 for l in labels] 53 | return (np.array(x, dtype='int32'), 54 | np.array(tree, dtype='int32'), 55 | np.array(labels, dtype=theano.config.floatX), 56 | np.array(labels_exist, dtype=theano.config.floatX))''' 57 | ##### debug here ##### 58 | '''ls = [] 59 | for x in X_word: 60 | l = len(x) 61 | if not l in ls: ls.append(l) 62 | print ls''' 63 | #print type(X_word) 64 | return (np.array(X_word, dtype='float64'), 65 | np.array(X_index, dtype='int32'), 66 | np.array(tree, dtype='int32')) 67 | #return (np.array(X_word), 68 | # np.array(X_index), 69 | # np.array(tree)) 70 | 71 | 72 | def _clear_indices(root_node): 73 | root_node.idx = None 74 | [_clear_indices(child) for child in root_node.children if child] 75 | 76 | 77 | def _get_leaf_vals(root_node): 78 | """Get leaf values in deep-to-shallow, left-to-right order.""" 79 | all_leaves = [] 80 | layer = [root_node] 81 | while layer: 82 | next_layer = [] 83 | for node in layer: 84 | if not node.children: 85 | all_leaves.append(node) 86 | else: 87 | next_layer.extend([child for child in node.children[::-1] if child]) 88 | layer = next_layer 89 | 90 | X_word = [] 91 | X_index = [] 92 | for idx, leaf in enumerate(reversed(all_leaves)): 93 | leaf.idx = idx 94 | X_word.append(leaf.word) 95 | X_index.append(leaf.index) 96 | #print idx, leaf 97 | #print leaf.word 98 | return X_word, X_index 99 | 100 | 101 | def _get_tree_traversal(root_node, start_idx=0, max_degree=None): 102 | """Get computation order of leaves -> root.""" 103 | if not root_node.children: 104 | return [], [], [] 105 | layers = [] 106 | layer = [root_node] 107 | while layer: 108 | layers.append(layer[:]) 109 | next_layer = [] 110 | [next_layer.extend([child for child in node.children if child]) 111 | for node in layer] 112 | layer = next_layer 113 | 114 | tree = [] 115 | internal_word = [] 116 | internal_index = [] 117 | idx = start_idx 118 | for layer in reversed(layers): 119 | for node in layer: 120 | if node.idx is not None: 121 | # must be leaf 122 | assert all(child is None for child in node.children) 123 | continue 124 | 125 | child_idxs = [(child.idx if child else -1) 126 | for child in node.children] ## idx of child node 127 | if max_degree is not None: 128 | child_idxs.extend([-1] * (max_degree - len(child_idxs))) 129 | assert not any(idx is None for idx in child_idxs) 130 | 131 | node.idx = idx 132 | tree.append(child_idxs + [node.idx]) 133 | internal_word.append(node.word if node.word is not None else -1) 134 | internal_index.append(node.index if node.index is not None else -1) 135 | idx += 1 136 | 137 | return tree, internal_word, internal_index 138 | 139 | ################################ tree rnn class ###################################### 140 | class RvNN(object): 141 | """Data is represented in a tree structure. 142 | 143 | Every leaf and internal node has a data (provided by the input) 144 | and a memory or hidden state. The hidden state is computed based 145 | on its own data and the hidden states of its children. The 146 | hidden state of leaves is given by a custom init function. 147 | 148 | The entire tree's embedding is represented by the final 149 | state computed at the root. 150 | 151 | """ 152 | def __init__(self, word_dim, hidden_dim=5, Nclass=4, 153 | degree=2, momentum=0.9, 154 | trainable_embeddings=True, 155 | labels_on_nonroot_nodes=False, 156 | irregular_tree=True): 157 | assert word_dim > 1 and hidden_dim > 1 158 | self.word_dim = word_dim 159 | self.hidden_dim = hidden_dim 160 | self.Nclass = Nclass 161 | self.degree = degree 162 | #self.learning_rate = learning_rate 163 | self.momentum = momentum 164 | self.irregular_tree = irregular_tree 165 | 166 | self.params = [] 167 | 168 | #self.x = T.ivector(name='x') # word indices 169 | #self.x_word = T.matrix(dtype=theano.config.floatX) # word frequendtype=theano.config.floatX 170 | self.x_word = T.matrix(name='x_word') # word frequent 171 | self.x_index = T.imatrix(name='x_index') # word indices 172 | self.tree = T.imatrix(name='tree') # shape [None, self.degree] 173 | self.y = T.ivector(name='y') # output shape [self.output_dim] 174 | 175 | self.num_nodes = self.x_word.shape[0] # total number of nodes (leaves + internal) in tree 176 | #emb_x = self.embeddings[self.x] 177 | #emb_x = emb_x * T.neq(self.x, -1).dimshuffle(0, 'x') # zero-out non-existent embeddings 178 | 179 | self.tree_states = self.compute_tree(self.x_word, self.x_index, self.tree) 180 | self.final_state = self.tree_states[-1] 181 | self.output_fn = self.create_output_fn() 182 | self.pred_y = self.output_fn(self.final_state) 183 | self.loss = self.loss_fn(self.y, self.pred_y) 184 | 185 | self.learning_rate = T.scalar('learning_rate') 186 | #updates = self.gradient_descent(self.loss, self.learning_rate) 187 | train_inputs = [self.x_word, self.x_index, self.tree, self.y, self.learning_rate] 188 | updates = self.gradient_descent(self.loss) 189 | 190 | #train_inputs = [self.x_word, self.x_index, self.tree, self.y] 191 | self._train = theano.function(train_inputs, 192 | [self.loss, self.pred_y], 193 | updates=updates) 194 | 195 | self._evaluate = theano.function([self.x_word, self.x_index, self.tree], self.final_state) 196 | 197 | self._predict = theano.function([self.x_word, self.x_index, self.tree], self.pred_y) 198 | 199 | 200 | def train_step_up(self, x_word, x_index, tree , y, lr): 201 | #x_word, x_index, tree = gen_nn_inputs(root_node, max_degree=self.degree, only_leaves_have_vals=False) 202 | return self._train(x_word, x_index, tree[:, :-1], y, lr) 203 | 204 | def evaluate(self, root_node): 205 | x, tree = gen_nn_inputs(root_node, max_degree=self.degree, only_leaves_have_vals=False) 206 | self._check_input(x, tree) 207 | return self._evaluate(x, tree[:, :-1]) 208 | 209 | def predict_up(self, x_word, x_index, tree): 210 | #x, tree = gen_nn_inputs(root_node, max_degree=self.degree, only_leaves_have_vals=False) 211 | #self._check_input(x, tree) 212 | return self._predict(x_word, x_index, tree[:, :-1]) 213 | 214 | def init_matrix(self, shape): 215 | return np.random.normal(scale=0.1, size=shape).astype(theano.config.floatX) 216 | 217 | def init_vector(self, shape): 218 | return np.zeros(shape, dtype=theano.config.floatX) 219 | 220 | def create_output_fn(self): 221 | self.W_out = theano.shared(self.init_matrix([self.Nclass, self.hidden_dim])) 222 | self.b_out = theano.shared(self.init_vector([self.Nclass])) 223 | self.params.extend([self.W_out, self.b_out]) 224 | 225 | def fn(final_state): 226 | return T.nnet.softmax( self.W_out.dot(final_state)+ self.b_out ) 227 | return fn 228 | 229 | '''def create_output_fn_multi(self): 230 | self.W_out = theano.shared(self.init_matrix([self.output_dim, self.hidden_dim])) 231 | self.b_out = theano.shared(self.init_vector([self.output_dim])) 232 | self.params.extend([self.W_out, self.b_out]) 233 | 234 | def fn(tree_states): 235 | return T.nnet.softmax( 236 | T.dot(tree_states, self.W_out.T) + 237 | self.b_out.dimshuffle('x', 0)) 238 | return fn''' 239 | 240 | def create_recursive_unit(self): 241 | self.E = theano.shared(self.init_matrix([self.hidden_dim, self.word_dim])) 242 | self.W_z = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 243 | self.U_z = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 244 | self.b_z = theano.shared(self.init_vector([self.hidden_dim])) 245 | self.W_r = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 246 | self.U_r = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 247 | self.b_r = theano.shared(self.init_vector([self.hidden_dim])) 248 | self.W_h = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 249 | self.U_h = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 250 | self.b_h = theano.shared(self.init_vector([self.hidden_dim])) 251 | self.params.extend([self.E, self.W_z, self.U_z, self.b_z, self.W_r, self.U_r, self.b_r, self.W_h, self.U_h, self.b_h]) 252 | def unit(parent_word, parent_index, child_h, child_exists): 253 | h_tilde = T.sum(child_h, axis=0) 254 | parent_xe = self.E[:,parent_index].dot(parent_word) 255 | z = T.nnet.hard_sigmoid(self.W_z.dot(parent_xe)+self.U_z.dot(h_tilde)+self.b_z) 256 | r = T.nnet.hard_sigmoid(self.W_r.dot(parent_xe)+self.U_r.dot(h_tilde)+self.b_r) 257 | c = T.tanh(self.W_h.dot(parent_xe)+self.U_h.dot(h_tilde * r)+self.b_h) 258 | h = z*h_tilde + (1-z)*c 259 | return h 260 | return unit 261 | 262 | def create_leaf_unit(self): 263 | dummy = 0 * theano.shared(self.init_vector([self.degree, self.hidden_dim])) 264 | def unit(leaf_word, leaf_index): 265 | return self.recursive_unit( leaf_word, leaf_index, dummy, dummy.sum(axis=1)) 266 | return unit 267 | 268 | def compute_tree(self, x_word, x_index, tree): 269 | self.recursive_unit = self.create_recursive_unit() 270 | self.leaf_unit = self.create_leaf_unit() 271 | num_parents = tree.shape[0] # num internal nodes 272 | num_leaves = self.num_nodes - num_parents 273 | 274 | # compute leaf hidden states 275 | leaf_h, _ = theano.map( 276 | fn=self.leaf_unit, 277 | sequences=[ x_word[:num_leaves], x_index[:num_leaves] ]) 278 | if self.irregular_tree: 279 | init_node_h = T.concatenate([leaf_h, leaf_h, leaf_h], axis=0) 280 | else: 281 | init_node_h = leaf_h 282 | 283 | # use recurrence to compute internal node hidden states 284 | def _recurrence(x_word, x_index, node_info, t, node_h, last_h): 285 | child_exists = node_info > -1 286 | offset = 2*num_leaves * int(self.irregular_tree) - child_exists * t ### offset??? 287 | child_h = node_h[node_info + offset] * child_exists.dimshuffle(0, 'x') ### transpose?? 288 | parent_h = self.recursive_unit(x_word, x_index, child_h, child_exists) 289 | node_h = T.concatenate([node_h, 290 | parent_h.reshape([1, self.hidden_dim])]) 291 | return node_h[1:], parent_h 292 | 293 | dummy = theano.shared(self.init_vector([self.hidden_dim])) 294 | (_, parent_h), _ = theano.scan( 295 | fn=_recurrence, 296 | outputs_info=[init_node_h, dummy], 297 | sequences=[x_word[num_leaves:], x_index[num_leaves:], tree, T.arange(num_parents)], 298 | n_steps=num_parents) 299 | 300 | return T.concatenate([leaf_h, parent_h], axis=0) 301 | 302 | def loss_fn(self, y, pred_y): 303 | return T.sum(T.sqr(y - pred_y)) 304 | 305 | '''def loss_fn_multi(self, y, pred_y, y_exists): 306 | return T.sum(T.sum(T.sqr(y - pred_y), axis=1) * y_exists, axis=0)''' 307 | 308 | def gradient_descent(self, loss): 309 | """Momentum GD with gradient clipping.""" 310 | grad = T.grad(loss, self.params) 311 | self.momentum_velocity_ = [0.] * len(grad) 312 | grad_norm = T.sqrt(sum(map(lambda x: T.sqr(x).sum(), grad))) 313 | updates = OrderedDict() 314 | not_finite = T.or_(T.isnan(grad_norm), T.isinf(grad_norm)) 315 | scaling_den = T.maximum(5.0, grad_norm) 316 | for n, (param, grad) in enumerate(zip(self.params, grad)): 317 | grad = T.switch(not_finite, 0.1 * param, 318 | grad * (5.0 / scaling_den)) 319 | velocity = self.momentum_velocity_[n] 320 | update_step = self.momentum * velocity - self.learning_rate * grad 321 | self.momentum_velocity_[n] = update_step 322 | updates[param] = param + update_step 323 | return updates 324 | -------------------------------------------------------------------------------- /nfold/RNNtrainSet_Twitter160_tree.txt: -------------------------------------------------------------------------------- 1 | 693265096278163456 2 | 692833140428017664 3 | 767092161716350980 4 | 767855091109863424 5 | 693060960001597440 6 | 693466451081060353 7 | 693857551620968448 8 | 693321561542127616 9 | 688366079396163584 10 | 687748306571804672 11 | 692874200927698945 12 | 692884886374318081 13 | 692410832307818497 14 | 681824512120324096 15 | 693119705469587456 16 | 693471161313816576 17 | 693129259334909952 18 | 693811101146963968 19 | 763964234774347776 20 | 691719802499432448 21 | 689938201193115648 22 | 656848877463560192 23 | 681199637387149313 24 | 766541461189832704 25 | 691608761128067072 26 | 691632238035886081 27 | 688446106943008768 28 | 687984820815851521 29 | 641666167992647681 30 | 693843042546106369 31 | 767861179951648768 32 | 767710042816602112 33 | 692748411481780224 34 | 693573781730783232 35 | 693466724822323200 36 | 689267711856263168 37 | 692753210692476928 38 | 693441093048766464 39 | 693200309955469312 40 | 693476774462820352 41 | 692796451987034113 42 | 693140340367187969 43 | 690680149164085248 44 | 692071267189395457 45 | 692940257134653441 46 | 693586539562037248 47 | 692758581494599681 48 | 767709416879644672 49 | 765612862681255936 50 | 693853310479155200 51 | 691678576018657281 52 | 693648675772436480 53 | 691995324752252930 54 | 766822417712963584 55 | 692845716826300418 56 | 692082592380751874 57 | 693041285087756288 58 | 766323684076322816 59 | 691789524498845699 60 | 693171092555431936 61 | 692540218310803456 62 | 692665281362202624 63 | 692803280238419971 64 | 693135382309896192 65 | 692157602554343424 66 | 693844030589902848 67 | 692150118921957376 68 | 692929779696275456 69 | 693086478667112448 70 | 692550140754841603 71 | 692752491482615808 72 | 723025600810766336 73 | 761573188543229952 74 | 764497123530375169 75 | 767807335691653120 76 | 693826104633737217 77 | 693181857261719553 78 | 692820029159653377 79 | 692083780123783172 80 | 693080409282846720 81 | 693858804279201794 82 | 693534670428971008 83 | 692925396292091905 84 | 693203974388895744 85 | 666335363099660288 86 | 693869818366287872 87 | 693059995013742592 88 | 766752508312166402 89 | 686657138270277634 90 | 692623941131722752 91 | 693546915892428800 92 | 693402634011701248 93 | 693456187036037123 94 | 765779159176077312 95 | 767129248045948929 96 | 682999206290829312 97 | 761999790892806144 98 | 682916727282270208 99 | 691285663522648065 100 | 692702295281262593 101 | 766715993385267201 102 | 690042063958732800 103 | 692890520960397312 104 | 687643002240679936 105 | 693528374996652032 106 | 689661418484994049 107 | 766568413418356736 108 | 692838430783332357 109 | 693281966846808064 110 | 767859423150759936 111 | 693502060545703937 112 | 689860942671130624 113 | 692735698349199360 114 | 765859710503378944 115 | 767754921403899906 116 | 764906140257837056 117 | 687537772970684417 118 | 682895395077373952 119 | 690106189951139840 120 | 693146363685642240 121 | 693315824132685824 122 | 693086218276474880 123 | 767203096472719364 124 | 693648684857323521 125 | 693818562981421056 126 | 693893182338289664 127 | 692014905239666688 128 | 688819658057740290 129 | 693061713042771968 130 | 689867195657101312 131 | 767541796410839040 132 | 693571567377342466 133 | 693013768738115584 134 | 692743102432346113 135 | 693906624776245249 136 | 688428083540553728 137 | 688741019979001856 138 | 692516224245235712 139 | 692106491365605376 140 | 767459987476054016 141 | 693857080193761285 142 | 693651239486263296 143 | 692826642583019521 144 | 693076140278153217 145 | 688021039322894336 146 | 692078399012130816 147 | 672553813249826816 148 | 767698691205410816 149 | 723198441690636288 150 | 692758050378256388 151 | 644329878876237824 152 | 688752927381581824 153 | 767814876433571840 154 | 687409983139495939 155 | 682996350909157376 156 | 765359928361922560 157 | 692630756548591616 158 | 692797856386777089 159 | 693771953648373760 160 | 762793077509464064 161 | 692911086920667136 162 | 690376107825192960 163 | 686666933949837312 164 | 693641113693884416 165 | 544282005941530624 166 | 614595106906226688 167 | 544274934835707905 168 | 614610364702044164 169 | 544367462012432384 170 | 552792802309181440 171 | 614467824313106432 172 | 616421546702336000 173 | 524966904885428226 174 | 614593386188828672 175 | 614604580601597953 176 | 649881917534433280 177 | 544520273718812672 178 | 552783667052167168 179 | 552791196247269378 180 | 623599854661541888 181 | 649889459836710912 182 | 552834961762709505 183 | 544358533819420672 184 | 651018580989972480 185 | 552791578893619200 186 | 614605997953404929 187 | 525019752507658240 188 | 544277117039837184 189 | 544504183341064192 190 | 525025279803424768 191 | 524944399890124801 192 | 614610102927147008 193 | 614628865353351168 194 | 552793679082311680 195 | 553589051044151296 196 | 544350712365207552 197 | 614594195479752704 198 | 552792544132997121 199 | 544381485591982083 200 | 649985459389661184 201 | 524995771587108864 202 | 614645853291155457 203 | 615494435074363392 204 | 553587013409325058 205 | 544283772569788416 206 | 524959809402331137 207 | 544517264054423552 208 | 544491151118860289 209 | 553476880339599360 210 | 544374511194632192 211 | 614620298877513729 212 | 498430783699554305 213 | 544271362022338560 214 | 553512735192141826 215 | 614650850393391104 216 | 552785375161499649 217 | 553506608203169792 218 | 614599587362414592 219 | 667487418388488192 220 | 614891047886434304 221 | 615592870540488704 222 | 614610920782888960 223 | 553160652567498752 224 | 544305540286148609 225 | 553566026030272512 226 | 553107921081749504 227 | 614604054552018944 228 | 553544694765215745 229 | 524932935137628160 230 | 544513524438155264 231 | 553586897168392192 232 | 544290258951892992 233 | 552805488631758849 234 | 553590459688570880 235 | 544329935943237632 236 | 552811386259386370 237 | 544319274072817664 238 | 668849913678209024 239 | 614671961801785344 240 | 524935485370929152 241 | 642465192408940544 242 | 614702244001382400 243 | 553535829017370625 244 | 667073349974102017 245 | 544268732046913536 246 | 544282227035869184 247 | 524925987239120897 248 | 614593989203886080 249 | 544301453717041152 250 | 552792913910833152 251 | 619242759359037440 252 | 614601139422633984 253 | 544289311504355328 254 | 580348081100734464 255 | 616765822095261700 256 | 628319096606732290 257 | 553543369604210689 258 | 614599619310407680 259 | 614615157730357248 260 | 553508098825261056 261 | 580324027715063808 262 | 628336948810268673 263 | 525056576038518785 264 | 544289941996326912 265 | 544399927045283840 266 | 552832817089236992 267 | 553221600955621376 268 | 524969201102901248 269 | 525049639016615937 270 | 614790312955904000 271 | 544511199702822913 272 | 628681462976528384 273 | 614595181845839873 274 | 524923676484177920 275 | 616481759329427456 276 | 544352727971954690 277 | 544278335455776769 278 | 614617234942656512 279 | 623533663947517952 280 | 614628136634949632 281 | 525060425184858112 282 | 544515538383564801 283 | 544514564407427072 284 | 650037735579910145 285 | 614616994499788800 286 | 525023025792835585 287 | 524931324763992064 288 | 614648099542204416 289 | 544512664769396736 290 | 650128194209730561 291 | 524943490887991296 292 | 544278985249550337 293 | 614638036593299456 294 | 524923462398513152 295 | 525058976376193024 296 | 674263945172119552 297 | 544289409294553088 298 | 614624331717545984 299 | 525025463648137216 300 | 616311563071434753 301 | 628604055644934144 302 | 524980744658382848 303 | 650046859537448960 304 | 640967537178472448 305 | 544391533240516608 306 | 544350567183556608 307 | 553476490315431937 308 | 524942470472548352 309 | 552806757672964097 310 | 614494460747997184 311 | 552984502063337472 312 | 524975705206304769 313 | 649974380416618496 314 | 524965775036387329 315 | 614494170590367744 316 | 614626710248534016 317 | 614614133410033664 318 | 553586860334010368 319 | 553588178687655936 320 | 524926235030589440 321 | 674358835675549696 322 | 525068915068923904 323 | 544520042810200064 324 | 524922729485848576 325 | 544476808566276097 326 | 553531413459660800 327 | 544391176137089024 328 | 553558982476828674 329 | 614599815280857088 330 | 632377165477191680 331 | 662381914842603520 332 | 676870737932742656 333 | 626770498328895488 334 | 628045645010608128 335 | 659462980476637184 336 | 672539897899577344 337 | 672433211604013057 338 | 674014933235859456 339 | 664000310856310784 340 | 657007736467525632 341 | 620971220301787136 342 | 611039775856812032 343 | 613294443878305796 344 | 675064077367005184 345 | 613362193787129860 346 | 638047610973089793 347 | 653250169752977408 348 | 669259395902152704 349 | 675005503160901632 350 | 614054616154550273 351 | 676067381299576832 352 | 672424512516964352 353 | 604642913188872192 354 | 656880145769197568 355 | 663817239896821760 356 | 672632863452299264 357 | 666051332504207360 358 | 672927317191229440 359 | 656811196218286080 360 | 652783670370115585 361 | 662430295254175744 362 | 673686233936072704 363 | 665358434351509504 364 | 604625816992002049 365 | 656595123590012928 366 | 613016993692798977 367 | 647464349611589632 368 | 613404935003217920 369 | 658259426172891136 370 | 674301413040758785 371 | 676718762830221312 372 | 668144671772778497 373 | 620367840902782976 374 | 636925368927064064 375 | 673615400655970304 376 | 656830586577883136 377 | 658786161733734400 378 | 672632899921833984 379 | 666497286663503872 380 | 658065957823324160 381 | 663925546812837888 382 | 673079581520318464 383 | 651959206287908868 384 | 612646796355960832 385 | 661120256732041216 386 | 623818627054206977 387 | 654343805081157633 388 | 665575674485211136 389 | 626901072209121282 390 | 613425834301485056 391 | 656825206045020160 392 | 655986243042459648 393 | 642432477185867776 394 | 637382230394822656 395 | 640644123339431936 396 | 656818921979310081 397 | 661299012386095105 398 | 654371696195993600 399 | 666633171325353989 400 | 647193820812177408 401 | 656047932093763584 402 | 644229386149888001 403 | 665379967757324288 404 | 674301960787505153 405 | 618192748735299584 406 | 673872171341447169 407 | 672180526946656256 408 | 674314254732931072 409 | 661222523275636736 410 | 634943791934406657 411 | 665364878287224834 412 | 633961125126668288 413 | 651321040119963648 414 | 634665777400950784 415 | 613114185505996802 416 | 638050997340893184 417 | 626897206717624320 418 | 613061089518034944 419 | 671181758692507648 420 | 675043569367982081 421 | 663904307113275392 422 | 637868242560638980 423 | 648894687542034432 424 | 656955120626880512 425 | 673984270902427650 426 | 633949800761700352 427 | 648310692794109952 428 | 661251968078221312 429 | 620916279608651776 430 | 645711628046995462 431 | 645356735545364480 432 | 667465205258051584 433 | 663515735231062016 434 | 669201837187334144 435 | 622858454949040128 436 | 643225207705075716 437 | 672906198434209792 438 | 672488384695279616 439 | 612741808125120513 440 | 660466342038867969 441 | 652992524504600576 442 | 651402689352351744 443 | 618449248179191808 444 | 643139873264812032 445 | 641430951403343872 446 | 672432930426372096 447 | 627828211003469825 448 | 663385747177775105 449 | 620835698514464768 450 | 654351281260113920 451 | 665361505303584774 452 | 677099574855639044 453 | 652882609219833856 454 | 681767380305985536 455 | 629503919098429440 456 | 612841482823729152 457 | 661102820976930816 458 | 656202544331517952 459 | 673664899571060736 460 | 604354747357859842 461 | 613393657161510913 462 | 675065047710892033 463 | 600451916414484480 464 | 612438528803213312 465 | 661870323034431489 466 | 672169954016403456 467 | 673615263040798726 468 | 594687353937100801 469 | 656662726014599168 470 | 635632641635667968 471 | 673581371458199552 472 | 674015148382666752 473 | 667379734343471104 474 | 656834590779289600 475 | 661229627734667264 476 | 663722803489808384 477 | 672828403016429568 478 | 659428447459110912 479 | 673611867181473792 480 | 658462819667615744 481 | 656629493377990656 482 | 666107476526432256 483 | 613194145423826944 484 | 641443248909754368 485 | 622891631293935616 486 | 666640008149925893 487 | 673696115305406466 488 | 618804516578680832 489 | 674080899055546368 490 | 641050980985999360 491 | 626546123713474560 492 | 673346166822694914 493 | 641191076716417025 494 | 626739062792032256 495 | 707308274270539777 496 | 716461257025581056 497 | 650975967146602496 498 | 760928376668454912 499 | 725983128444129280 500 | 715671763808493569 501 | 730939370765754368 502 | 655812191233417216 503 | 778530869208190976 504 | 778625026144792577 505 | 707310135291416576 506 | 716092408920936448 507 | 778681502825451520 508 | 714851393861881857 509 | 714998347111669760 510 | 729647367457230850 511 | 760109079133990912 512 | 728038172270198787 513 | 701975210044497921 514 | 780882510645370880 515 | 742050150307246080 516 | 727623131494387714 517 | 751536167183613952 518 | 723477822950395904 519 | 743058135300988932 520 | 653432177632387072 521 | 765735409984806912 522 | 652300118205427716 523 | 763520953619918848 524 | 740791134146965504 525 | 697992796565741569 526 | 763738618573623297 527 | 778299287293816832 528 | 714531423273746432 529 | 743764020679741440 530 | 763896522790440960 531 | 778689027918618625 532 | 714567472712589312 533 | 748640007934590976 534 | 726442550266044416 535 | 707305999971921920 536 | 711994705333112832 537 | 728273551883534336 538 | 749039299677417472 539 | 723504069814444033 540 | 730516765525082112 541 | 723644048867774464 542 | 703234354579898368 543 | 705093513076015104 544 | 779633844680962048 545 | 656361703664451585 546 | 652982112870662144 547 | 755548076438196225 548 | 765739657908850688 549 | 716416753409081344 550 | 763524712853102596 551 | 717081129627553792 552 | 725070832494624769 553 | 763430916236640256 554 | 777710439870455808 555 | 728013148788154368 556 | 755523157700648960 557 | 732004388181434368 558 | 715268937873760256 559 | 774833492865593344 560 | 712223438698627073 561 | 724939017410727938 562 | 707786906189303808 563 | 764368020391223296 564 | 757450526153900032 565 | 757190314880884736 566 | 716424773216022530 567 | 653285570383335424 568 | 701514249269542912 569 | 731093044460683264 570 | 724044187113512960 571 | 656523458139045889 572 | 714598318333042688 573 | 706933939953344514 574 | 640182854928961536 575 | 715253497462145024 576 | 658938136299511808 577 | 726190016435728385 578 | 724603564946010112 579 | 745236050407194624 580 | 727982226290442240 581 | 705092738224525312 582 | 648993731169939456 583 | 640118021101604864 584 | 650254360727973889 585 | 742571519105077248 586 | 728101712762834944 587 | 652000523525091328 588 | 755475529294352385 589 | 724624672604610562 590 | 723915846985342976 591 | 733242244522725376 592 | 651486105628463105 593 | 775672628493357057 594 | 716448280201269248 595 | 759460236042305536 596 | 766808183696351233 597 | 707332312724283392 598 | 651044059222556674 599 | 728207861050970112 600 | 707604196812591104 601 | 727116900983934976 602 | 756690088533393409 603 | 723365789378584578 604 | 741995157969592321 605 | 724661834419048448 606 | 765887221736046592 607 | 701175292937707520 608 | 650710483289419776 609 | 652349108653551616 610 | 723511860516016128 611 | 715255507506892800 612 | 726043971911213057 613 | 728631482722308096 614 | 778572032531427332 615 | 714811995573325828 616 | 742114513726623744 617 | 757367391202471937 618 | 728625967921401856 619 | 757748522481491968 620 | 654336219447472128 621 | 740748123581087745 622 | 655815788675399680 623 | 651809229842608128 624 | 707300612862566400 625 | 747275598347837440 626 | 655432919595548672 627 | 742012307694223361 628 | 747443219487678464 629 | 751856580874960897 630 | 763428684850094080 631 | 676586804242309121 632 | 723521076446142465 633 | 756282236375277568 634 | 706665777332621314 635 | 725174535897620481 636 | 727834854931435522 637 | 716457799392342018 638 | 731166399389962242 639 | 715264793737879553 640 | 755447443009916929 641 | 727588444000526336 642 | 744390771869102080 643 | 742055437932040193 644 | 716439952922312704 645 | 650952376954650629 646 | 758825535480864769 647 | 714755546285477888 648 | 715515982584881152 649 | 732971411157880832 650 | 745365403237376000 651 | 766789709045518336 652 | 716451800581279744 653 | 658755852199927808 654 | 723772395211862016 655 | 727187859367546880 656 | -------------------------------------------------------------------------------- /nfold/RNNtrainSet_Twitter161_tree.txt: -------------------------------------------------------------------------------- 1 | 693196937172951040 2 | 767803368081358848 3 | 693935557009801218 4 | 693691456222052352 5 | 693827886021767169 6 | 690969315470868480 7 | 688755462783782912 8 | 692368829368918017 9 | 767561970182598657 10 | 693840291992838147 11 | 689915847939219456 12 | 689890946683576322 13 | 672102358516670465 14 | 693128224960856064 15 | 693761289601060864 16 | 687274510643511296 17 | 689641419825242112 18 | 688004802245214208 19 | 693141729529184256 20 | 692023855926374400 21 | 688751061503442944 22 | 690650123358093312 23 | 693087220459270144 24 | 693897857376632832 25 | 692498490249891842 26 | 665309822208729088 27 | 676955015265837056 28 | 693071538896162816 29 | 693167683701968896 30 | 692701223326056449 31 | 693185853867294721 32 | 692393375891361794 33 | 692691444046372865 34 | 693939356390653952 35 | 693555965019492352 36 | 692163879909064704 37 | 676491949524713473 38 | 693606934050684928 39 | 693804277031157761 40 | 692082861525078017 41 | 690580180805509121 42 | 693140340367187969 43 | 690680149164085248 44 | 692071267189395457 45 | 692940257134653441 46 | 693586539562037248 47 | 692758581494599681 48 | 767709416879644672 49 | 765612862681255936 50 | 693853310479155200 51 | 691678576018657281 52 | 693648675772436480 53 | 691995324752252930 54 | 766822417712963584 55 | 692845716826300418 56 | 692082592380751874 57 | 693041285087756288 58 | 766323684076322816 59 | 691789524498845699 60 | 693171092555431936 61 | 692540218310803456 62 | 692665281362202624 63 | 692803280238419971 64 | 693135382309896192 65 | 692157602554343424 66 | 693844030589902848 67 | 692150118921957376 68 | 692929779696275456 69 | 693086478667112448 70 | 692550140754841603 71 | 692752491482615808 72 | 723025600810766336 73 | 761573188543229952 74 | 764497123530375169 75 | 767807335691653120 76 | 693826104633737217 77 | 693181857261719553 78 | 692820029159653377 79 | 692083780123783172 80 | 693080409282846720 81 | 693858804279201794 82 | 693534670428971008 83 | 692925396292091905 84 | 693203974388895744 85 | 666335363099660288 86 | 693869818366287872 87 | 693059995013742592 88 | 766752508312166402 89 | 686657138270277634 90 | 692623941131722752 91 | 693546915892428800 92 | 693402634011701248 93 | 693456187036037123 94 | 765779159176077312 95 | 767129248045948929 96 | 682999206290829312 97 | 761999790892806144 98 | 682916727282270208 99 | 691285663522648065 100 | 692702295281262593 101 | 766715993385267201 102 | 690042063958732800 103 | 692890520960397312 104 | 687643002240679936 105 | 693528374996652032 106 | 689661418484994049 107 | 766568413418356736 108 | 692838430783332357 109 | 693281966846808064 110 | 767859423150759936 111 | 693502060545703937 112 | 689860942671130624 113 | 692735698349199360 114 | 765859710503378944 115 | 767754921403899906 116 | 764906140257837056 117 | 687537772970684417 118 | 682895395077373952 119 | 690106189951139840 120 | 693146363685642240 121 | 693315824132685824 122 | 693086218276474880 123 | 767203096472719364 124 | 693648684857323521 125 | 693818562981421056 126 | 693893182338289664 127 | 692014905239666688 128 | 688819658057740290 129 | 693061713042771968 130 | 689867195657101312 131 | 767541796410839040 132 | 693571567377342466 133 | 693013768738115584 134 | 692743102432346113 135 | 693906624776245249 136 | 688428083540553728 137 | 688741019979001856 138 | 692516224245235712 139 | 692106491365605376 140 | 767459987476054016 141 | 693857080193761285 142 | 693651239486263296 143 | 692826642583019521 144 | 693076140278153217 145 | 688021039322894336 146 | 692078399012130816 147 | 672553813249826816 148 | 767698691205410816 149 | 723198441690636288 150 | 692758050378256388 151 | 644329878876237824 152 | 688752927381581824 153 | 767814876433571840 154 | 687409983139495939 155 | 682996350909157376 156 | 765359928361922560 157 | 692630756548591616 158 | 692797856386777089 159 | 693771953648373760 160 | 762793077509464064 161 | 692911086920667136 162 | 690376107825192960 163 | 686666933949837312 164 | 693641113693884416 165 | 544324444773433348 166 | 524941132237910016 167 | 544271284796784640 168 | 525028734991343617 169 | 524947674164760577 170 | 615840865815298048 171 | 614594259900080128 172 | 524936872666353664 173 | 641972184412327937 174 | 524925215235911680 175 | 524952883343925249 176 | 676367888543031296 177 | 524925050739490816 178 | 544518335019229184 179 | 524962142563610625 180 | 649903655160815616 181 | 614618682543616000 182 | 544269749405097984 183 | 614607711368519680 184 | 544512108885725184 185 | 553587303172833280 186 | 544382892378714113 187 | 544319832486064128 188 | 544358564484378624 189 | 614608936491188225 190 | 544291965513134080 191 | 641082932740947972 192 | 500378223977721856 193 | 614594667225571328 194 | 544314234541469696 195 | 544380742076088320 196 | 553590835850514433 197 | 553587672137334785 198 | 544512676643500033 199 | 675490515748425728 200 | 614609560658161664 201 | 544291804057960448 202 | 681147789653356544 203 | 615689290706595840 204 | 552802654641225728 205 | 553534838880608256 206 | 524959809402331137 207 | 544517264054423552 208 | 544491151118860289 209 | 553476880339599360 210 | 544374511194632192 211 | 614620298877513729 212 | 498430783699554305 213 | 544271362022338560 214 | 553512735192141826 215 | 614650850393391104 216 | 552785375161499649 217 | 553506608203169792 218 | 614599587362414592 219 | 667487418388488192 220 | 614891047886434304 221 | 615592870540488704 222 | 614610920782888960 223 | 553160652567498752 224 | 544305540286148609 225 | 553566026030272512 226 | 553107921081749504 227 | 614604054552018944 228 | 553544694765215745 229 | 524932935137628160 230 | 544513524438155264 231 | 553586897168392192 232 | 544290258951892992 233 | 552805488631758849 234 | 553590459688570880 235 | 544329935943237632 236 | 552811386259386370 237 | 544319274072817664 238 | 668849913678209024 239 | 614671961801785344 240 | 524935485370929152 241 | 642465192408940544 242 | 614702244001382400 243 | 553535829017370625 244 | 667073349974102017 245 | 544268732046913536 246 | 544282227035869184 247 | 524925987239120897 248 | 614593989203886080 249 | 544301453717041152 250 | 552792913910833152 251 | 619242759359037440 252 | 614601139422633984 253 | 544289311504355328 254 | 580348081100734464 255 | 616765822095261700 256 | 628319096606732290 257 | 553543369604210689 258 | 614599619310407680 259 | 614615157730357248 260 | 553508098825261056 261 | 580324027715063808 262 | 628336948810268673 263 | 525056576038518785 264 | 544289941996326912 265 | 544399927045283840 266 | 552832817089236992 267 | 553221600955621376 268 | 524969201102901248 269 | 525049639016615937 270 | 614790312955904000 271 | 544511199702822913 272 | 628681462976528384 273 | 614595181845839873 274 | 524923676484177920 275 | 616481759329427456 276 | 544352727971954690 277 | 544278335455776769 278 | 614617234942656512 279 | 623533663947517952 280 | 614628136634949632 281 | 525060425184858112 282 | 544515538383564801 283 | 544514564407427072 284 | 650037735579910145 285 | 614616994499788800 286 | 525023025792835585 287 | 524931324763992064 288 | 614648099542204416 289 | 544512664769396736 290 | 650128194209730561 291 | 524943490887991296 292 | 544278985249550337 293 | 614638036593299456 294 | 524923462398513152 295 | 525058976376193024 296 | 674263945172119552 297 | 544289409294553088 298 | 614624331717545984 299 | 525025463648137216 300 | 616311563071434753 301 | 628604055644934144 302 | 524980744658382848 303 | 650046859537448960 304 | 640967537178472448 305 | 544391533240516608 306 | 544350567183556608 307 | 553476490315431937 308 | 524942470472548352 309 | 552806757672964097 310 | 614494460747997184 311 | 552984502063337472 312 | 524975705206304769 313 | 649974380416618496 314 | 524965775036387329 315 | 614494170590367744 316 | 614626710248534016 317 | 614614133410033664 318 | 553586860334010368 319 | 553588178687655936 320 | 524926235030589440 321 | 674358835675549696 322 | 525068915068923904 323 | 544520042810200064 324 | 524922729485848576 325 | 544476808566276097 326 | 553531413459660800 327 | 544391176137089024 328 | 553558982476828674 329 | 614599815280857088 330 | 632377165477191680 331 | 656870311057575936 332 | 672513234419638273 333 | 647169726158925824 334 | 641088973717110784 335 | 642027433693171712 336 | 626516248206135296 337 | 629209452793626624 338 | 662151653462790144 339 | 659439879701602304 340 | 640107106943766528 341 | 647168914955243520 342 | 613023744454475776 343 | 626642648179159040 344 | 615346611955183616 345 | 666810213274689537 346 | 676094756758364160 347 | 626898253900943360 348 | 647169573599449088 349 | 637873886072320001 350 | 651825062174195712 351 | 674187250792558592 352 | 675193315306905600 353 | 668872645589471232 354 | 669613420665159680 355 | 618805892222468096 356 | 645362146415525888 357 | 643103859729166337 358 | 674364257799004160 359 | 666190716448587776 360 | 634404792241143809 361 | 631388553801564160 362 | 672219174463275008 363 | 667534186450825216 364 | 676120162018451456 365 | 674229534888185856 366 | 672902686380003328 367 | 666070802924617728 368 | 674244561519161344 369 | 655080266784968705 370 | 633823543541768192 371 | 642145732435292160 372 | 668144671772778497 373 | 620367840902782976 374 | 636925368927064064 375 | 673615400655970304 376 | 656830586577883136 377 | 658786161733734400 378 | 672632899921833984 379 | 666497286663503872 380 | 658065957823324160 381 | 663925546812837888 382 | 673079581520318464 383 | 651959206287908868 384 | 612646796355960832 385 | 661120256732041216 386 | 623818627054206977 387 | 654343805081157633 388 | 665575674485211136 389 | 626901072209121282 390 | 613425834301485056 391 | 656825206045020160 392 | 655986243042459648 393 | 642432477185867776 394 | 637382230394822656 395 | 640644123339431936 396 | 656818921979310081 397 | 661299012386095105 398 | 654371696195993600 399 | 666633171325353989 400 | 647193820812177408 401 | 656047932093763584 402 | 644229386149888001 403 | 665379967757324288 404 | 674301960787505153 405 | 618192748735299584 406 | 673872171341447169 407 | 672180526946656256 408 | 674314254732931072 409 | 661222523275636736 410 | 634943791934406657 411 | 665364878287224834 412 | 633961125126668288 413 | 651321040119963648 414 | 634665777400950784 415 | 613114185505996802 416 | 638050997340893184 417 | 626897206717624320 418 | 613061089518034944 419 | 671181758692507648 420 | 675043569367982081 421 | 663904307113275392 422 | 637868242560638980 423 | 648894687542034432 424 | 656955120626880512 425 | 673984270902427650 426 | 633949800761700352 427 | 648310692794109952 428 | 661251968078221312 429 | 620916279608651776 430 | 645711628046995462 431 | 645356735545364480 432 | 667465205258051584 433 | 663515735231062016 434 | 669201837187334144 435 | 622858454949040128 436 | 643225207705075716 437 | 672906198434209792 438 | 672488384695279616 439 | 612741808125120513 440 | 660466342038867969 441 | 652992524504600576 442 | 651402689352351744 443 | 618449248179191808 444 | 643139873264812032 445 | 641430951403343872 446 | 672432930426372096 447 | 627828211003469825 448 | 663385747177775105 449 | 620835698514464768 450 | 654351281260113920 451 | 665361505303584774 452 | 677099574855639044 453 | 652882609219833856 454 | 681767380305985536 455 | 629503919098429440 456 | 612841482823729152 457 | 661102820976930816 458 | 656202544331517952 459 | 673664899571060736 460 | 604354747357859842 461 | 613393657161510913 462 | 675065047710892033 463 | 600451916414484480 464 | 612438528803213312 465 | 661870323034431489 466 | 672169954016403456 467 | 673615263040798726 468 | 594687353937100801 469 | 656662726014599168 470 | 635632641635667968 471 | 673581371458199552 472 | 674015148382666752 473 | 667379734343471104 474 | 656834590779289600 475 | 661229627734667264 476 | 663722803489808384 477 | 672828403016429568 478 | 659428447459110912 479 | 673611867181473792 480 | 658462819667615744 481 | 656629493377990656 482 | 666107476526432256 483 | 613194145423826944 484 | 641443248909754368 485 | 622891631293935616 486 | 666640008149925893 487 | 673696115305406466 488 | 618804516578680832 489 | 674080899055546368 490 | 641050980985999360 491 | 626546123713474560 492 | 673346166822694914 493 | 641191076716417025 494 | 626739062792032256 495 | 714555825122107392 496 | 722885778448121857 497 | 651786568592658433 498 | 663744139666804736 499 | 748558349139058688 500 | 724320681517670400 501 | 653432261203750912 502 | 742678930516123650 503 | 727172374999666688 504 | 743126914794037248 505 | 715256242990505984 506 | 752965545528528898 507 | 752875379765968897 508 | 715254040289021952 509 | 707405809181917184 510 | 714598641827246081 511 | 707412869860696064 512 | 701872343736520704 513 | 726086935903494144 514 | 701539698452393986 515 | 707321278135463936 516 | 727966590084485120 517 | 724348906096590849 518 | 778949749156245504 519 | 755439197125767169 520 | 760120409429643266 521 | 649584608560832513 522 | 727854332188577792 523 | 748543642323783681 524 | 780436430732525569 525 | 764931593303646208 526 | 732981604826677249 527 | 714577521992343552 528 | 707420972173955072 529 | 749286768554438658 530 | 724703995147751424 531 | 714560810266132480 532 | 714503380476026880 533 | 728627623488786433 534 | 727179214546456577 535 | 707305999971921920 536 | 711994705333112832 537 | 728273551883534336 538 | 749039299677417472 539 | 723504069814444033 540 | 730516765525082112 541 | 723644048867774464 542 | 703234354579898368 543 | 705093513076015104 544 | 779633844680962048 545 | 656361703664451585 546 | 652982112870662144 547 | 755548076438196225 548 | 765739657908850688 549 | 716416753409081344 550 | 763524712853102596 551 | 717081129627553792 552 | 725070832494624769 553 | 763430916236640256 554 | 777710439870455808 555 | 728013148788154368 556 | 755523157700648960 557 | 732004388181434368 558 | 715268937873760256 559 | 774833492865593344 560 | 712223438698627073 561 | 724939017410727938 562 | 707786906189303808 563 | 764368020391223296 564 | 757450526153900032 565 | 757190314880884736 566 | 716424773216022530 567 | 653285570383335424 568 | 701514249269542912 569 | 731093044460683264 570 | 724044187113512960 571 | 656523458139045889 572 | 714598318333042688 573 | 706933939953344514 574 | 640182854928961536 575 | 715253497462145024 576 | 658938136299511808 577 | 726190016435728385 578 | 724603564946010112 579 | 745236050407194624 580 | 727982226290442240 581 | 705092738224525312 582 | 648993731169939456 583 | 640118021101604864 584 | 650254360727973889 585 | 742571519105077248 586 | 728101712762834944 587 | 652000523525091328 588 | 755475529294352385 589 | 724624672604610562 590 | 723915846985342976 591 | 733242244522725376 592 | 651486105628463105 593 | 775672628493357057 594 | 716448280201269248 595 | 759460236042305536 596 | 766808183696351233 597 | 707332312724283392 598 | 651044059222556674 599 | 728207861050970112 600 | 707604196812591104 601 | 727116900983934976 602 | 756690088533393409 603 | 723365789378584578 604 | 741995157969592321 605 | 724661834419048448 606 | 765887221736046592 607 | 701175292937707520 608 | 650710483289419776 609 | 652349108653551616 610 | 723511860516016128 611 | 715255507506892800 612 | 726043971911213057 613 | 728631482722308096 614 | 778572032531427332 615 | 714811995573325828 616 | 742114513726623744 617 | 757367391202471937 618 | 728625967921401856 619 | 757748522481491968 620 | 654336219447472128 621 | 740748123581087745 622 | 655815788675399680 623 | 651809229842608128 624 | 707300612862566400 625 | 747275598347837440 626 | 655432919595548672 627 | 742012307694223361 628 | 747443219487678464 629 | 751856580874960897 630 | 763428684850094080 631 | 676586804242309121 632 | 723521076446142465 633 | 756282236375277568 634 | 706665777332621314 635 | 725174535897620481 636 | 727834854931435522 637 | 716457799392342018 638 | 731166399389962242 639 | 715264793737879553 640 | 755447443009916929 641 | 727588444000526336 642 | 744390771869102080 643 | 742055437932040193 644 | 716439952922312704 645 | 650952376954650629 646 | 758825535480864769 647 | 714755546285477888 648 | 715515982584881152 649 | 732971411157880832 650 | 745365403237376000 651 | 766789709045518336 652 | 716451800581279744 653 | 658755852199927808 654 | 723772395211862016 655 | 727187859367546880 656 | -------------------------------------------------------------------------------- /nfold/RNNtrainSet_Twitter162_tree.txt: -------------------------------------------------------------------------------- 1 | 693196937172951040 2 | 767803368081358848 3 | 693935557009801218 4 | 693691456222052352 5 | 693827886021767169 6 | 690969315470868480 7 | 688755462783782912 8 | 692368829368918017 9 | 767561970182598657 10 | 693840291992838147 11 | 689915847939219456 12 | 689890946683576322 13 | 672102358516670465 14 | 693128224960856064 15 | 693761289601060864 16 | 687274510643511296 17 | 689641419825242112 18 | 688004802245214208 19 | 693141729529184256 20 | 692023855926374400 21 | 688751061503442944 22 | 690650123358093312 23 | 693087220459270144 24 | 693897857376632832 25 | 692498490249891842 26 | 665309822208729088 27 | 676955015265837056 28 | 693071538896162816 29 | 693167683701968896 30 | 692701223326056449 31 | 693185853867294721 32 | 692393375891361794 33 | 692691444046372865 34 | 693939356390653952 35 | 693555965019492352 36 | 692163879909064704 37 | 676491949524713473 38 | 693606934050684928 39 | 693804277031157761 40 | 692082861525078017 41 | 690580180805509121 42 | 693265096278163456 43 | 692833140428017664 44 | 767092161716350980 45 | 767855091109863424 46 | 693060960001597440 47 | 693466451081060353 48 | 693857551620968448 49 | 693321561542127616 50 | 688366079396163584 51 | 687748306571804672 52 | 692874200927698945 53 | 692884886374318081 54 | 692410832307818497 55 | 681824512120324096 56 | 693119705469587456 57 | 693471161313816576 58 | 693129259334909952 59 | 693811101146963968 60 | 763964234774347776 61 | 691719802499432448 62 | 689938201193115648 63 | 656848877463560192 64 | 681199637387149313 65 | 766541461189832704 66 | 691608761128067072 67 | 691632238035886081 68 | 688446106943008768 69 | 687984820815851521 70 | 641666167992647681 71 | 693843042546106369 72 | 767861179951648768 73 | 767710042816602112 74 | 692748411481780224 75 | 693573781730783232 76 | 693466724822323200 77 | 689267711856263168 78 | 692753210692476928 79 | 693441093048766464 80 | 693200309955469312 81 | 693476774462820352 82 | 692796451987034113 83 | 692925396292091905 84 | 693203974388895744 85 | 666335363099660288 86 | 693869818366287872 87 | 693059995013742592 88 | 766752508312166402 89 | 686657138270277634 90 | 692623941131722752 91 | 693546915892428800 92 | 693402634011701248 93 | 693456187036037123 94 | 765779159176077312 95 | 767129248045948929 96 | 682999206290829312 97 | 761999790892806144 98 | 682916727282270208 99 | 691285663522648065 100 | 692702295281262593 101 | 766715993385267201 102 | 690042063958732800 103 | 692890520960397312 104 | 687643002240679936 105 | 693528374996652032 106 | 689661418484994049 107 | 766568413418356736 108 | 692838430783332357 109 | 693281966846808064 110 | 767859423150759936 111 | 693502060545703937 112 | 689860942671130624 113 | 692735698349199360 114 | 765859710503378944 115 | 767754921403899906 116 | 764906140257837056 117 | 687537772970684417 118 | 682895395077373952 119 | 690106189951139840 120 | 693146363685642240 121 | 693315824132685824 122 | 693086218276474880 123 | 767203096472719364 124 | 693648684857323521 125 | 693818562981421056 126 | 693893182338289664 127 | 692014905239666688 128 | 688819658057740290 129 | 693061713042771968 130 | 689867195657101312 131 | 767541796410839040 132 | 693571567377342466 133 | 693013768738115584 134 | 692743102432346113 135 | 693906624776245249 136 | 688428083540553728 137 | 688741019979001856 138 | 692516224245235712 139 | 692106491365605376 140 | 767459987476054016 141 | 693857080193761285 142 | 693651239486263296 143 | 692826642583019521 144 | 693076140278153217 145 | 688021039322894336 146 | 692078399012130816 147 | 672553813249826816 148 | 767698691205410816 149 | 723198441690636288 150 | 692758050378256388 151 | 644329878876237824 152 | 688752927381581824 153 | 767814876433571840 154 | 687409983139495939 155 | 682996350909157376 156 | 765359928361922560 157 | 692630756548591616 158 | 692797856386777089 159 | 693771953648373760 160 | 762793077509464064 161 | 692911086920667136 162 | 690376107825192960 163 | 686666933949837312 164 | 693641113693884416 165 | 544324444773433348 166 | 524941132237910016 167 | 544271284796784640 168 | 525028734991343617 169 | 524947674164760577 170 | 615840865815298048 171 | 614594259900080128 172 | 524936872666353664 173 | 641972184412327937 174 | 524925215235911680 175 | 524952883343925249 176 | 676367888543031296 177 | 524925050739490816 178 | 544518335019229184 179 | 524962142563610625 180 | 649903655160815616 181 | 614618682543616000 182 | 544269749405097984 183 | 614607711368519680 184 | 544512108885725184 185 | 553587303172833280 186 | 544382892378714113 187 | 544319832486064128 188 | 544358564484378624 189 | 614608936491188225 190 | 544291965513134080 191 | 641082932740947972 192 | 500378223977721856 193 | 614594667225571328 194 | 544314234541469696 195 | 544380742076088320 196 | 553590835850514433 197 | 553587672137334785 198 | 544512676643500033 199 | 675490515748425728 200 | 614609560658161664 201 | 544291804057960448 202 | 681147789653356544 203 | 615689290706595840 204 | 552802654641225728 205 | 553534838880608256 206 | 544282005941530624 207 | 614595106906226688 208 | 544274934835707905 209 | 614610364702044164 210 | 544367462012432384 211 | 552792802309181440 212 | 614467824313106432 213 | 616421546702336000 214 | 524966904885428226 215 | 614593386188828672 216 | 614604580601597953 217 | 649881917534433280 218 | 544520273718812672 219 | 552783667052167168 220 | 552791196247269378 221 | 623599854661541888 222 | 649889459836710912 223 | 552834961762709505 224 | 544358533819420672 225 | 651018580989972480 226 | 552791578893619200 227 | 614605997953404929 228 | 525019752507658240 229 | 544277117039837184 230 | 544504183341064192 231 | 525025279803424768 232 | 524944399890124801 233 | 614610102927147008 234 | 614628865353351168 235 | 552793679082311680 236 | 553589051044151296 237 | 544350712365207552 238 | 614594195479752704 239 | 552792544132997121 240 | 544381485591982083 241 | 649985459389661184 242 | 524995771587108864 243 | 614645853291155457 244 | 615494435074363392 245 | 553587013409325058 246 | 544283772569788416 247 | 524925987239120897 248 | 614593989203886080 249 | 544301453717041152 250 | 552792913910833152 251 | 619242759359037440 252 | 614601139422633984 253 | 544289311504355328 254 | 580348081100734464 255 | 616765822095261700 256 | 628319096606732290 257 | 553543369604210689 258 | 614599619310407680 259 | 614615157730357248 260 | 553508098825261056 261 | 580324027715063808 262 | 628336948810268673 263 | 525056576038518785 264 | 544289941996326912 265 | 544399927045283840 266 | 552832817089236992 267 | 553221600955621376 268 | 524969201102901248 269 | 525049639016615937 270 | 614790312955904000 271 | 544511199702822913 272 | 628681462976528384 273 | 614595181845839873 274 | 524923676484177920 275 | 616481759329427456 276 | 544352727971954690 277 | 544278335455776769 278 | 614617234942656512 279 | 623533663947517952 280 | 614628136634949632 281 | 525060425184858112 282 | 544515538383564801 283 | 544514564407427072 284 | 650037735579910145 285 | 614616994499788800 286 | 525023025792835585 287 | 524931324763992064 288 | 614648099542204416 289 | 544512664769396736 290 | 650128194209730561 291 | 524943490887991296 292 | 544278985249550337 293 | 614638036593299456 294 | 524923462398513152 295 | 525058976376193024 296 | 674263945172119552 297 | 544289409294553088 298 | 614624331717545984 299 | 525025463648137216 300 | 616311563071434753 301 | 628604055644934144 302 | 524980744658382848 303 | 650046859537448960 304 | 640967537178472448 305 | 544391533240516608 306 | 544350567183556608 307 | 553476490315431937 308 | 524942470472548352 309 | 552806757672964097 310 | 614494460747997184 311 | 552984502063337472 312 | 524975705206304769 313 | 649974380416618496 314 | 524965775036387329 315 | 614494170590367744 316 | 614626710248534016 317 | 614614133410033664 318 | 553586860334010368 319 | 553588178687655936 320 | 524926235030589440 321 | 674358835675549696 322 | 525068915068923904 323 | 544520042810200064 324 | 524922729485848576 325 | 544476808566276097 326 | 553531413459660800 327 | 544391176137089024 328 | 553558982476828674 329 | 614599815280857088 330 | 632377165477191680 331 | 656870311057575936 332 | 672513234419638273 333 | 647169726158925824 334 | 641088973717110784 335 | 642027433693171712 336 | 626516248206135296 337 | 629209452793626624 338 | 662151653462790144 339 | 659439879701602304 340 | 640107106943766528 341 | 647168914955243520 342 | 613023744454475776 343 | 626642648179159040 344 | 615346611955183616 345 | 666810213274689537 346 | 676094756758364160 347 | 626898253900943360 348 | 647169573599449088 349 | 637873886072320001 350 | 651825062174195712 351 | 674187250792558592 352 | 675193315306905600 353 | 668872645589471232 354 | 669613420665159680 355 | 618805892222468096 356 | 645362146415525888 357 | 643103859729166337 358 | 674364257799004160 359 | 666190716448587776 360 | 634404792241143809 361 | 631388553801564160 362 | 672219174463275008 363 | 667534186450825216 364 | 676120162018451456 365 | 674229534888185856 366 | 672902686380003328 367 | 666070802924617728 368 | 674244561519161344 369 | 655080266784968705 370 | 633823543541768192 371 | 642145732435292160 372 | 662381914842603520 373 | 676870737932742656 374 | 626770498328895488 375 | 628045645010608128 376 | 659462980476637184 377 | 672539897899577344 378 | 672433211604013057 379 | 674014933235859456 380 | 664000310856310784 381 | 657007736467525632 382 | 620971220301787136 383 | 611039775856812032 384 | 613294443878305796 385 | 675064077367005184 386 | 613362193787129860 387 | 638047610973089793 388 | 653250169752977408 389 | 669259395902152704 390 | 675005503160901632 391 | 614054616154550273 392 | 676067381299576832 393 | 672424512516964352 394 | 604642913188872192 395 | 656880145769197568 396 | 663817239896821760 397 | 672632863452299264 398 | 666051332504207360 399 | 672927317191229440 400 | 656811196218286080 401 | 652783670370115585 402 | 662430295254175744 403 | 673686233936072704 404 | 665358434351509504 405 | 604625816992002049 406 | 656595123590012928 407 | 613016993692798977 408 | 647464349611589632 409 | 613404935003217920 410 | 658259426172891136 411 | 674301413040758785 412 | 676718762830221312 413 | 651321040119963648 414 | 634665777400950784 415 | 613114185505996802 416 | 638050997340893184 417 | 626897206717624320 418 | 613061089518034944 419 | 671181758692507648 420 | 675043569367982081 421 | 663904307113275392 422 | 637868242560638980 423 | 648894687542034432 424 | 656955120626880512 425 | 673984270902427650 426 | 633949800761700352 427 | 648310692794109952 428 | 661251968078221312 429 | 620916279608651776 430 | 645711628046995462 431 | 645356735545364480 432 | 667465205258051584 433 | 663515735231062016 434 | 669201837187334144 435 | 622858454949040128 436 | 643225207705075716 437 | 672906198434209792 438 | 672488384695279616 439 | 612741808125120513 440 | 660466342038867969 441 | 652992524504600576 442 | 651402689352351744 443 | 618449248179191808 444 | 643139873264812032 445 | 641430951403343872 446 | 672432930426372096 447 | 627828211003469825 448 | 663385747177775105 449 | 620835698514464768 450 | 654351281260113920 451 | 665361505303584774 452 | 677099574855639044 453 | 652882609219833856 454 | 681767380305985536 455 | 629503919098429440 456 | 612841482823729152 457 | 661102820976930816 458 | 656202544331517952 459 | 673664899571060736 460 | 604354747357859842 461 | 613393657161510913 462 | 675065047710892033 463 | 600451916414484480 464 | 612438528803213312 465 | 661870323034431489 466 | 672169954016403456 467 | 673615263040798726 468 | 594687353937100801 469 | 656662726014599168 470 | 635632641635667968 471 | 673581371458199552 472 | 674015148382666752 473 | 667379734343471104 474 | 656834590779289600 475 | 661229627734667264 476 | 663722803489808384 477 | 672828403016429568 478 | 659428447459110912 479 | 673611867181473792 480 | 658462819667615744 481 | 656629493377990656 482 | 666107476526432256 483 | 613194145423826944 484 | 641443248909754368 485 | 622891631293935616 486 | 666640008149925893 487 | 673696115305406466 488 | 618804516578680832 489 | 674080899055546368 490 | 641050980985999360 491 | 626546123713474560 492 | 673346166822694914 493 | 641191076716417025 494 | 626739062792032256 495 | 714555825122107392 496 | 722885778448121857 497 | 651786568592658433 498 | 663744139666804736 499 | 748558349139058688 500 | 724320681517670400 501 | 653432261203750912 502 | 742678930516123650 503 | 727172374999666688 504 | 743126914794037248 505 | 715256242990505984 506 | 752965545528528898 507 | 752875379765968897 508 | 715254040289021952 509 | 707405809181917184 510 | 714598641827246081 511 | 707412869860696064 512 | 701872343736520704 513 | 726086935903494144 514 | 701539698452393986 515 | 707321278135463936 516 | 727966590084485120 517 | 724348906096590849 518 | 778949749156245504 519 | 755439197125767169 520 | 760120409429643266 521 | 649584608560832513 522 | 727854332188577792 523 | 748543642323783681 524 | 780436430732525569 525 | 764931593303646208 526 | 732981604826677249 527 | 714577521992343552 528 | 707420972173955072 529 | 749286768554438658 530 | 724703995147751424 531 | 714560810266132480 532 | 714503380476026880 533 | 728627623488786433 534 | 727179214546456577 535 | 707308274270539777 536 | 716461257025581056 537 | 650975967146602496 538 | 760928376668454912 539 | 725983128444129280 540 | 715671763808493569 541 | 730939370765754368 542 | 655812191233417216 543 | 778530869208190976 544 | 778625026144792577 545 | 707310135291416576 546 | 716092408920936448 547 | 778681502825451520 548 | 714851393861881857 549 | 714998347111669760 550 | 729647367457230850 551 | 760109079133990912 552 | 728038172270198787 553 | 701975210044497921 554 | 780882510645370880 555 | 742050150307246080 556 | 727623131494387714 557 | 751536167183613952 558 | 723477822950395904 559 | 743058135300988932 560 | 653432177632387072 561 | 765735409984806912 562 | 652300118205427716 563 | 763520953619918848 564 | 740791134146965504 565 | 697992796565741569 566 | 763738618573623297 567 | 778299287293816832 568 | 714531423273746432 569 | 743764020679741440 570 | 763896522790440960 571 | 778689027918618625 572 | 714567472712589312 573 | 748640007934590976 574 | 726442550266044416 575 | 715253497462145024 576 | 658938136299511808 577 | 726190016435728385 578 | 724603564946010112 579 | 745236050407194624 580 | 727982226290442240 581 | 705092738224525312 582 | 648993731169939456 583 | 640118021101604864 584 | 650254360727973889 585 | 742571519105077248 586 | 728101712762834944 587 | 652000523525091328 588 | 755475529294352385 589 | 724624672604610562 590 | 723915846985342976 591 | 733242244522725376 592 | 651486105628463105 593 | 775672628493357057 594 | 716448280201269248 595 | 759460236042305536 596 | 766808183696351233 597 | 707332312724283392 598 | 651044059222556674 599 | 728207861050970112 600 | 707604196812591104 601 | 727116900983934976 602 | 756690088533393409 603 | 723365789378584578 604 | 741995157969592321 605 | 724661834419048448 606 | 765887221736046592 607 | 701175292937707520 608 | 650710483289419776 609 | 652349108653551616 610 | 723511860516016128 611 | 715255507506892800 612 | 726043971911213057 613 | 728631482722308096 614 | 778572032531427332 615 | 714811995573325828 616 | 742114513726623744 617 | 757367391202471937 618 | 728625967921401856 619 | 757748522481491968 620 | 654336219447472128 621 | 740748123581087745 622 | 655815788675399680 623 | 651809229842608128 624 | 707300612862566400 625 | 747275598347837440 626 | 655432919595548672 627 | 742012307694223361 628 | 747443219487678464 629 | 751856580874960897 630 | 763428684850094080 631 | 676586804242309121 632 | 723521076446142465 633 | 756282236375277568 634 | 706665777332621314 635 | 725174535897620481 636 | 727834854931435522 637 | 716457799392342018 638 | 731166399389962242 639 | 715264793737879553 640 | 755447443009916929 641 | 727588444000526336 642 | 744390771869102080 643 | 742055437932040193 644 | 716439952922312704 645 | 650952376954650629 646 | 758825535480864769 647 | 714755546285477888 648 | 715515982584881152 649 | 732971411157880832 650 | 745365403237376000 651 | 766789709045518336 652 | 716451800581279744 653 | 658755852199927808 654 | 723772395211862016 655 | 727187859367546880 656 | -------------------------------------------------------------------------------- /nfold/RNNtrainSet_Twitter163_tree.txt: -------------------------------------------------------------------------------- 1 | 693196937172951040 2 | 767803368081358848 3 | 693935557009801218 4 | 693691456222052352 5 | 693827886021767169 6 | 690969315470868480 7 | 688755462783782912 8 | 692368829368918017 9 | 767561970182598657 10 | 693840291992838147 11 | 689915847939219456 12 | 689890946683576322 13 | 672102358516670465 14 | 693128224960856064 15 | 693761289601060864 16 | 687274510643511296 17 | 689641419825242112 18 | 688004802245214208 19 | 693141729529184256 20 | 692023855926374400 21 | 688751061503442944 22 | 690650123358093312 23 | 693087220459270144 24 | 693897857376632832 25 | 692498490249891842 26 | 665309822208729088 27 | 676955015265837056 28 | 693071538896162816 29 | 693167683701968896 30 | 692701223326056449 31 | 693185853867294721 32 | 692393375891361794 33 | 692691444046372865 34 | 693939356390653952 35 | 693555965019492352 36 | 692163879909064704 37 | 676491949524713473 38 | 693606934050684928 39 | 693804277031157761 40 | 692082861525078017 41 | 690580180805509121 42 | 693265096278163456 43 | 692833140428017664 44 | 767092161716350980 45 | 767855091109863424 46 | 693060960001597440 47 | 693466451081060353 48 | 693857551620968448 49 | 693321561542127616 50 | 688366079396163584 51 | 687748306571804672 52 | 692874200927698945 53 | 692884886374318081 54 | 692410832307818497 55 | 681824512120324096 56 | 693119705469587456 57 | 693471161313816576 58 | 693129259334909952 59 | 693811101146963968 60 | 763964234774347776 61 | 691719802499432448 62 | 689938201193115648 63 | 656848877463560192 64 | 681199637387149313 65 | 766541461189832704 66 | 691608761128067072 67 | 691632238035886081 68 | 688446106943008768 69 | 687984820815851521 70 | 641666167992647681 71 | 693843042546106369 72 | 767861179951648768 73 | 767710042816602112 74 | 692748411481780224 75 | 693573781730783232 76 | 693466724822323200 77 | 689267711856263168 78 | 692753210692476928 79 | 693441093048766464 80 | 693200309955469312 81 | 693476774462820352 82 | 692796451987034113 83 | 693140340367187969 84 | 690680149164085248 85 | 692071267189395457 86 | 692940257134653441 87 | 693586539562037248 88 | 692758581494599681 89 | 767709416879644672 90 | 765612862681255936 91 | 693853310479155200 92 | 691678576018657281 93 | 693648675772436480 94 | 691995324752252930 95 | 766822417712963584 96 | 692845716826300418 97 | 692082592380751874 98 | 693041285087756288 99 | 766323684076322816 100 | 691789524498845699 101 | 693171092555431936 102 | 692540218310803456 103 | 692665281362202624 104 | 692803280238419971 105 | 693135382309896192 106 | 692157602554343424 107 | 693844030589902848 108 | 692150118921957376 109 | 692929779696275456 110 | 693086478667112448 111 | 692550140754841603 112 | 692752491482615808 113 | 723025600810766336 114 | 761573188543229952 115 | 764497123530375169 116 | 767807335691653120 117 | 693826104633737217 118 | 693181857261719553 119 | 692820029159653377 120 | 692083780123783172 121 | 693080409282846720 122 | 693858804279201794 123 | 693534670428971008 124 | 693648684857323521 125 | 693818562981421056 126 | 693893182338289664 127 | 692014905239666688 128 | 688819658057740290 129 | 693061713042771968 130 | 689867195657101312 131 | 767541796410839040 132 | 693571567377342466 133 | 693013768738115584 134 | 692743102432346113 135 | 693906624776245249 136 | 688428083540553728 137 | 688741019979001856 138 | 692516224245235712 139 | 692106491365605376 140 | 767459987476054016 141 | 693857080193761285 142 | 693651239486263296 143 | 692826642583019521 144 | 693076140278153217 145 | 688021039322894336 146 | 692078399012130816 147 | 672553813249826816 148 | 767698691205410816 149 | 723198441690636288 150 | 692758050378256388 151 | 644329878876237824 152 | 688752927381581824 153 | 767814876433571840 154 | 687409983139495939 155 | 682996350909157376 156 | 765359928361922560 157 | 692630756548591616 158 | 692797856386777089 159 | 693771953648373760 160 | 762793077509464064 161 | 692911086920667136 162 | 690376107825192960 163 | 686666933949837312 164 | 693641113693884416 165 | 544324444773433348 166 | 524941132237910016 167 | 544271284796784640 168 | 525028734991343617 169 | 524947674164760577 170 | 615840865815298048 171 | 614594259900080128 172 | 524936872666353664 173 | 641972184412327937 174 | 524925215235911680 175 | 524952883343925249 176 | 676367888543031296 177 | 524925050739490816 178 | 544518335019229184 179 | 524962142563610625 180 | 649903655160815616 181 | 614618682543616000 182 | 544269749405097984 183 | 614607711368519680 184 | 544512108885725184 185 | 553587303172833280 186 | 544382892378714113 187 | 544319832486064128 188 | 544358564484378624 189 | 614608936491188225 190 | 544291965513134080 191 | 641082932740947972 192 | 500378223977721856 193 | 614594667225571328 194 | 544314234541469696 195 | 544380742076088320 196 | 553590835850514433 197 | 553587672137334785 198 | 544512676643500033 199 | 675490515748425728 200 | 614609560658161664 201 | 544291804057960448 202 | 681147789653356544 203 | 615689290706595840 204 | 552802654641225728 205 | 553534838880608256 206 | 544282005941530624 207 | 614595106906226688 208 | 544274934835707905 209 | 614610364702044164 210 | 544367462012432384 211 | 552792802309181440 212 | 614467824313106432 213 | 616421546702336000 214 | 524966904885428226 215 | 614593386188828672 216 | 614604580601597953 217 | 649881917534433280 218 | 544520273718812672 219 | 552783667052167168 220 | 552791196247269378 221 | 623599854661541888 222 | 649889459836710912 223 | 552834961762709505 224 | 544358533819420672 225 | 651018580989972480 226 | 552791578893619200 227 | 614605997953404929 228 | 525019752507658240 229 | 544277117039837184 230 | 544504183341064192 231 | 525025279803424768 232 | 524944399890124801 233 | 614610102927147008 234 | 614628865353351168 235 | 552793679082311680 236 | 553589051044151296 237 | 544350712365207552 238 | 614594195479752704 239 | 552792544132997121 240 | 544381485591982083 241 | 649985459389661184 242 | 524995771587108864 243 | 614645853291155457 244 | 615494435074363392 245 | 553587013409325058 246 | 544283772569788416 247 | 524959809402331137 248 | 544517264054423552 249 | 544491151118860289 250 | 553476880339599360 251 | 544374511194632192 252 | 614620298877513729 253 | 498430783699554305 254 | 544271362022338560 255 | 553512735192141826 256 | 614650850393391104 257 | 552785375161499649 258 | 553506608203169792 259 | 614599587362414592 260 | 667487418388488192 261 | 614891047886434304 262 | 615592870540488704 263 | 614610920782888960 264 | 553160652567498752 265 | 544305540286148609 266 | 553566026030272512 267 | 553107921081749504 268 | 614604054552018944 269 | 553544694765215745 270 | 524932935137628160 271 | 544513524438155264 272 | 553586897168392192 273 | 544290258951892992 274 | 552805488631758849 275 | 553590459688570880 276 | 544329935943237632 277 | 552811386259386370 278 | 544319274072817664 279 | 668849913678209024 280 | 614671961801785344 281 | 524935485370929152 282 | 642465192408940544 283 | 614702244001382400 284 | 553535829017370625 285 | 667073349974102017 286 | 544268732046913536 287 | 544282227035869184 288 | 614648099542204416 289 | 544512664769396736 290 | 650128194209730561 291 | 524943490887991296 292 | 544278985249550337 293 | 614638036593299456 294 | 524923462398513152 295 | 525058976376193024 296 | 674263945172119552 297 | 544289409294553088 298 | 614624331717545984 299 | 525025463648137216 300 | 616311563071434753 301 | 628604055644934144 302 | 524980744658382848 303 | 650046859537448960 304 | 640967537178472448 305 | 544391533240516608 306 | 544350567183556608 307 | 553476490315431937 308 | 524942470472548352 309 | 552806757672964097 310 | 614494460747997184 311 | 552984502063337472 312 | 524975705206304769 313 | 649974380416618496 314 | 524965775036387329 315 | 614494170590367744 316 | 614626710248534016 317 | 614614133410033664 318 | 553586860334010368 319 | 553588178687655936 320 | 524926235030589440 321 | 674358835675549696 322 | 525068915068923904 323 | 544520042810200064 324 | 524922729485848576 325 | 544476808566276097 326 | 553531413459660800 327 | 544391176137089024 328 | 553558982476828674 329 | 614599815280857088 330 | 632377165477191680 331 | 656870311057575936 332 | 672513234419638273 333 | 647169726158925824 334 | 641088973717110784 335 | 642027433693171712 336 | 626516248206135296 337 | 629209452793626624 338 | 662151653462790144 339 | 659439879701602304 340 | 640107106943766528 341 | 647168914955243520 342 | 613023744454475776 343 | 626642648179159040 344 | 615346611955183616 345 | 666810213274689537 346 | 676094756758364160 347 | 626898253900943360 348 | 647169573599449088 349 | 637873886072320001 350 | 651825062174195712 351 | 674187250792558592 352 | 675193315306905600 353 | 668872645589471232 354 | 669613420665159680 355 | 618805892222468096 356 | 645362146415525888 357 | 643103859729166337 358 | 674364257799004160 359 | 666190716448587776 360 | 634404792241143809 361 | 631388553801564160 362 | 672219174463275008 363 | 667534186450825216 364 | 676120162018451456 365 | 674229534888185856 366 | 672902686380003328 367 | 666070802924617728 368 | 674244561519161344 369 | 655080266784968705 370 | 633823543541768192 371 | 642145732435292160 372 | 662381914842603520 373 | 676870737932742656 374 | 626770498328895488 375 | 628045645010608128 376 | 659462980476637184 377 | 672539897899577344 378 | 672433211604013057 379 | 674014933235859456 380 | 664000310856310784 381 | 657007736467525632 382 | 620971220301787136 383 | 611039775856812032 384 | 613294443878305796 385 | 675064077367005184 386 | 613362193787129860 387 | 638047610973089793 388 | 653250169752977408 389 | 669259395902152704 390 | 675005503160901632 391 | 614054616154550273 392 | 676067381299576832 393 | 672424512516964352 394 | 604642913188872192 395 | 656880145769197568 396 | 663817239896821760 397 | 672632863452299264 398 | 666051332504207360 399 | 672927317191229440 400 | 656811196218286080 401 | 652783670370115585 402 | 662430295254175744 403 | 673686233936072704 404 | 665358434351509504 405 | 604625816992002049 406 | 656595123590012928 407 | 613016993692798977 408 | 647464349611589632 409 | 613404935003217920 410 | 658259426172891136 411 | 674301413040758785 412 | 676718762830221312 413 | 668144671772778497 414 | 620367840902782976 415 | 636925368927064064 416 | 673615400655970304 417 | 656830586577883136 418 | 658786161733734400 419 | 672632899921833984 420 | 666497286663503872 421 | 658065957823324160 422 | 663925546812837888 423 | 673079581520318464 424 | 651959206287908868 425 | 612646796355960832 426 | 661120256732041216 427 | 623818627054206977 428 | 654343805081157633 429 | 665575674485211136 430 | 626901072209121282 431 | 613425834301485056 432 | 656825206045020160 433 | 655986243042459648 434 | 642432477185867776 435 | 637382230394822656 436 | 640644123339431936 437 | 656818921979310081 438 | 661299012386095105 439 | 654371696195993600 440 | 666633171325353989 441 | 647193820812177408 442 | 656047932093763584 443 | 644229386149888001 444 | 665379967757324288 445 | 674301960787505153 446 | 618192748735299584 447 | 673872171341447169 448 | 672180526946656256 449 | 674314254732931072 450 | 661222523275636736 451 | 634943791934406657 452 | 665364878287224834 453 | 633961125126668288 454 | 681767380305985536 455 | 629503919098429440 456 | 612841482823729152 457 | 661102820976930816 458 | 656202544331517952 459 | 673664899571060736 460 | 604354747357859842 461 | 613393657161510913 462 | 675065047710892033 463 | 600451916414484480 464 | 612438528803213312 465 | 661870323034431489 466 | 672169954016403456 467 | 673615263040798726 468 | 594687353937100801 469 | 656662726014599168 470 | 635632641635667968 471 | 673581371458199552 472 | 674015148382666752 473 | 667379734343471104 474 | 656834590779289600 475 | 661229627734667264 476 | 663722803489808384 477 | 672828403016429568 478 | 659428447459110912 479 | 673611867181473792 480 | 658462819667615744 481 | 656629493377990656 482 | 666107476526432256 483 | 613194145423826944 484 | 641443248909754368 485 | 622891631293935616 486 | 666640008149925893 487 | 673696115305406466 488 | 618804516578680832 489 | 674080899055546368 490 | 641050980985999360 491 | 626546123713474560 492 | 673346166822694914 493 | 641191076716417025 494 | 626739062792032256 495 | 714555825122107392 496 | 722885778448121857 497 | 651786568592658433 498 | 663744139666804736 499 | 748558349139058688 500 | 724320681517670400 501 | 653432261203750912 502 | 742678930516123650 503 | 727172374999666688 504 | 743126914794037248 505 | 715256242990505984 506 | 752965545528528898 507 | 752875379765968897 508 | 715254040289021952 509 | 707405809181917184 510 | 714598641827246081 511 | 707412869860696064 512 | 701872343736520704 513 | 726086935903494144 514 | 701539698452393986 515 | 707321278135463936 516 | 727966590084485120 517 | 724348906096590849 518 | 778949749156245504 519 | 755439197125767169 520 | 760120409429643266 521 | 649584608560832513 522 | 727854332188577792 523 | 748543642323783681 524 | 780436430732525569 525 | 764931593303646208 526 | 732981604826677249 527 | 714577521992343552 528 | 707420972173955072 529 | 749286768554438658 530 | 724703995147751424 531 | 714560810266132480 532 | 714503380476026880 533 | 728627623488786433 534 | 727179214546456577 535 | 707308274270539777 536 | 716461257025581056 537 | 650975967146602496 538 | 760928376668454912 539 | 725983128444129280 540 | 715671763808493569 541 | 730939370765754368 542 | 655812191233417216 543 | 778530869208190976 544 | 778625026144792577 545 | 707310135291416576 546 | 716092408920936448 547 | 778681502825451520 548 | 714851393861881857 549 | 714998347111669760 550 | 729647367457230850 551 | 760109079133990912 552 | 728038172270198787 553 | 701975210044497921 554 | 780882510645370880 555 | 742050150307246080 556 | 727623131494387714 557 | 751536167183613952 558 | 723477822950395904 559 | 743058135300988932 560 | 653432177632387072 561 | 765735409984806912 562 | 652300118205427716 563 | 763520953619918848 564 | 740791134146965504 565 | 697992796565741569 566 | 763738618573623297 567 | 778299287293816832 568 | 714531423273746432 569 | 743764020679741440 570 | 763896522790440960 571 | 778689027918618625 572 | 714567472712589312 573 | 748640007934590976 574 | 726442550266044416 575 | 707305999971921920 576 | 711994705333112832 577 | 728273551883534336 578 | 749039299677417472 579 | 723504069814444033 580 | 730516765525082112 581 | 723644048867774464 582 | 703234354579898368 583 | 705093513076015104 584 | 779633844680962048 585 | 656361703664451585 586 | 652982112870662144 587 | 755548076438196225 588 | 765739657908850688 589 | 716416753409081344 590 | 763524712853102596 591 | 717081129627553792 592 | 725070832494624769 593 | 763430916236640256 594 | 777710439870455808 595 | 728013148788154368 596 | 755523157700648960 597 | 732004388181434368 598 | 715268937873760256 599 | 774833492865593344 600 | 712223438698627073 601 | 724939017410727938 602 | 707786906189303808 603 | 764368020391223296 604 | 757450526153900032 605 | 757190314880884736 606 | 716424773216022530 607 | 653285570383335424 608 | 701514249269542912 609 | 731093044460683264 610 | 724044187113512960 611 | 656523458139045889 612 | 714598318333042688 613 | 706933939953344514 614 | 640182854928961536 615 | 714811995573325828 616 | 742114513726623744 617 | 757367391202471937 618 | 728625967921401856 619 | 757748522481491968 620 | 654336219447472128 621 | 740748123581087745 622 | 655815788675399680 623 | 651809229842608128 624 | 707300612862566400 625 | 747275598347837440 626 | 655432919595548672 627 | 742012307694223361 628 | 747443219487678464 629 | 751856580874960897 630 | 763428684850094080 631 | 676586804242309121 632 | 723521076446142465 633 | 756282236375277568 634 | 706665777332621314 635 | 725174535897620481 636 | 727834854931435522 637 | 716457799392342018 638 | 731166399389962242 639 | 715264793737879553 640 | 755447443009916929 641 | 727588444000526336 642 | 744390771869102080 643 | 742055437932040193 644 | 716439952922312704 645 | 650952376954650629 646 | 758825535480864769 647 | 714755546285477888 648 | 715515982584881152 649 | 732971411157880832 650 | 745365403237376000 651 | 766789709045518336 652 | 716451800581279744 653 | 658755852199927808 654 | 723772395211862016 655 | 727187859367546880 656 | -------------------------------------------------------------------------------- /nfold/RNNtrainSet_Twitter164_tree.txt: -------------------------------------------------------------------------------- 1 | 693196937172951040 2 | 767803368081358848 3 | 693935557009801218 4 | 693691456222052352 5 | 693827886021767169 6 | 690969315470868480 7 | 688755462783782912 8 | 692368829368918017 9 | 767561970182598657 10 | 693840291992838147 11 | 689915847939219456 12 | 689890946683576322 13 | 672102358516670465 14 | 693128224960856064 15 | 693761289601060864 16 | 687274510643511296 17 | 689641419825242112 18 | 688004802245214208 19 | 693141729529184256 20 | 692023855926374400 21 | 688751061503442944 22 | 690650123358093312 23 | 693087220459270144 24 | 693897857376632832 25 | 692498490249891842 26 | 665309822208729088 27 | 676955015265837056 28 | 693071538896162816 29 | 693167683701968896 30 | 692701223326056449 31 | 693185853867294721 32 | 692393375891361794 33 | 692691444046372865 34 | 693939356390653952 35 | 693555965019492352 36 | 692163879909064704 37 | 676491949524713473 38 | 693606934050684928 39 | 693804277031157761 40 | 692082861525078017 41 | 690580180805509121 42 | 693265096278163456 43 | 692833140428017664 44 | 767092161716350980 45 | 767855091109863424 46 | 693060960001597440 47 | 693466451081060353 48 | 693857551620968448 49 | 693321561542127616 50 | 688366079396163584 51 | 687748306571804672 52 | 692874200927698945 53 | 692884886374318081 54 | 692410832307818497 55 | 681824512120324096 56 | 693119705469587456 57 | 693471161313816576 58 | 693129259334909952 59 | 693811101146963968 60 | 763964234774347776 61 | 691719802499432448 62 | 689938201193115648 63 | 656848877463560192 64 | 681199637387149313 65 | 766541461189832704 66 | 691608761128067072 67 | 691632238035886081 68 | 688446106943008768 69 | 687984820815851521 70 | 641666167992647681 71 | 693843042546106369 72 | 767861179951648768 73 | 767710042816602112 74 | 692748411481780224 75 | 693573781730783232 76 | 693466724822323200 77 | 689267711856263168 78 | 692753210692476928 79 | 693441093048766464 80 | 693200309955469312 81 | 693476774462820352 82 | 692796451987034113 83 | 693140340367187969 84 | 690680149164085248 85 | 692071267189395457 86 | 692940257134653441 87 | 693586539562037248 88 | 692758581494599681 89 | 767709416879644672 90 | 765612862681255936 91 | 693853310479155200 92 | 691678576018657281 93 | 693648675772436480 94 | 691995324752252930 95 | 766822417712963584 96 | 692845716826300418 97 | 692082592380751874 98 | 693041285087756288 99 | 766323684076322816 100 | 691789524498845699 101 | 693171092555431936 102 | 692540218310803456 103 | 692665281362202624 104 | 692803280238419971 105 | 693135382309896192 106 | 692157602554343424 107 | 693844030589902848 108 | 692150118921957376 109 | 692929779696275456 110 | 693086478667112448 111 | 692550140754841603 112 | 692752491482615808 113 | 723025600810766336 114 | 761573188543229952 115 | 764497123530375169 116 | 767807335691653120 117 | 693826104633737217 118 | 693181857261719553 119 | 692820029159653377 120 | 692083780123783172 121 | 693080409282846720 122 | 693858804279201794 123 | 693534670428971008 124 | 692925396292091905 125 | 693203974388895744 126 | 666335363099660288 127 | 693869818366287872 128 | 693059995013742592 129 | 766752508312166402 130 | 686657138270277634 131 | 692623941131722752 132 | 693546915892428800 133 | 693402634011701248 134 | 693456187036037123 135 | 765779159176077312 136 | 767129248045948929 137 | 682999206290829312 138 | 761999790892806144 139 | 682916727282270208 140 | 691285663522648065 141 | 692702295281262593 142 | 766715993385267201 143 | 690042063958732800 144 | 692890520960397312 145 | 687643002240679936 146 | 693528374996652032 147 | 689661418484994049 148 | 766568413418356736 149 | 692838430783332357 150 | 693281966846808064 151 | 767859423150759936 152 | 693502060545703937 153 | 689860942671130624 154 | 692735698349199360 155 | 765859710503378944 156 | 767754921403899906 157 | 764906140257837056 158 | 687537772970684417 159 | 682895395077373952 160 | 690106189951139840 161 | 693146363685642240 162 | 693315824132685824 163 | 693086218276474880 164 | 767203096472719364 165 | 544324444773433348 166 | 524941132237910016 167 | 544271284796784640 168 | 525028734991343617 169 | 524947674164760577 170 | 615840865815298048 171 | 614594259900080128 172 | 524936872666353664 173 | 641972184412327937 174 | 524925215235911680 175 | 524952883343925249 176 | 676367888543031296 177 | 524925050739490816 178 | 544518335019229184 179 | 524962142563610625 180 | 649903655160815616 181 | 614618682543616000 182 | 544269749405097984 183 | 614607711368519680 184 | 544512108885725184 185 | 553587303172833280 186 | 544382892378714113 187 | 544319832486064128 188 | 544358564484378624 189 | 614608936491188225 190 | 544291965513134080 191 | 641082932740947972 192 | 500378223977721856 193 | 614594667225571328 194 | 544314234541469696 195 | 544380742076088320 196 | 553590835850514433 197 | 553587672137334785 198 | 544512676643500033 199 | 675490515748425728 200 | 614609560658161664 201 | 544291804057960448 202 | 681147789653356544 203 | 615689290706595840 204 | 552802654641225728 205 | 553534838880608256 206 | 544282005941530624 207 | 614595106906226688 208 | 544274934835707905 209 | 614610364702044164 210 | 544367462012432384 211 | 552792802309181440 212 | 614467824313106432 213 | 616421546702336000 214 | 524966904885428226 215 | 614593386188828672 216 | 614604580601597953 217 | 649881917534433280 218 | 544520273718812672 219 | 552783667052167168 220 | 552791196247269378 221 | 623599854661541888 222 | 649889459836710912 223 | 552834961762709505 224 | 544358533819420672 225 | 651018580989972480 226 | 552791578893619200 227 | 614605997953404929 228 | 525019752507658240 229 | 544277117039837184 230 | 544504183341064192 231 | 525025279803424768 232 | 524944399890124801 233 | 614610102927147008 234 | 614628865353351168 235 | 552793679082311680 236 | 553589051044151296 237 | 544350712365207552 238 | 614594195479752704 239 | 552792544132997121 240 | 544381485591982083 241 | 649985459389661184 242 | 524995771587108864 243 | 614645853291155457 244 | 615494435074363392 245 | 553587013409325058 246 | 544283772569788416 247 | 524959809402331137 248 | 544517264054423552 249 | 544491151118860289 250 | 553476880339599360 251 | 544374511194632192 252 | 614620298877513729 253 | 498430783699554305 254 | 544271362022338560 255 | 553512735192141826 256 | 614650850393391104 257 | 552785375161499649 258 | 553506608203169792 259 | 614599587362414592 260 | 667487418388488192 261 | 614891047886434304 262 | 615592870540488704 263 | 614610920782888960 264 | 553160652567498752 265 | 544305540286148609 266 | 553566026030272512 267 | 553107921081749504 268 | 614604054552018944 269 | 553544694765215745 270 | 524932935137628160 271 | 544513524438155264 272 | 553586897168392192 273 | 544290258951892992 274 | 552805488631758849 275 | 553590459688570880 276 | 544329935943237632 277 | 552811386259386370 278 | 544319274072817664 279 | 668849913678209024 280 | 614671961801785344 281 | 524935485370929152 282 | 642465192408940544 283 | 614702244001382400 284 | 553535829017370625 285 | 667073349974102017 286 | 544268732046913536 287 | 544282227035869184 288 | 524925987239120897 289 | 614593989203886080 290 | 544301453717041152 291 | 552792913910833152 292 | 619242759359037440 293 | 614601139422633984 294 | 544289311504355328 295 | 580348081100734464 296 | 616765822095261700 297 | 628319096606732290 298 | 553543369604210689 299 | 614599619310407680 300 | 614615157730357248 301 | 553508098825261056 302 | 580324027715063808 303 | 628336948810268673 304 | 525056576038518785 305 | 544289941996326912 306 | 544399927045283840 307 | 552832817089236992 308 | 553221600955621376 309 | 524969201102901248 310 | 525049639016615937 311 | 614790312955904000 312 | 544511199702822913 313 | 628681462976528384 314 | 614595181845839873 315 | 524923676484177920 316 | 616481759329427456 317 | 544352727971954690 318 | 544278335455776769 319 | 614617234942656512 320 | 623533663947517952 321 | 614628136634949632 322 | 525060425184858112 323 | 544515538383564801 324 | 544514564407427072 325 | 650037735579910145 326 | 614616994499788800 327 | 525023025792835585 328 | 524931324763992064 329 | 614599815280857088 330 | 632377165477191680 331 | 656870311057575936 332 | 672513234419638273 333 | 647169726158925824 334 | 641088973717110784 335 | 642027433693171712 336 | 626516248206135296 337 | 629209452793626624 338 | 662151653462790144 339 | 659439879701602304 340 | 640107106943766528 341 | 647168914955243520 342 | 613023744454475776 343 | 626642648179159040 344 | 615346611955183616 345 | 666810213274689537 346 | 676094756758364160 347 | 626898253900943360 348 | 647169573599449088 349 | 637873886072320001 350 | 651825062174195712 351 | 674187250792558592 352 | 675193315306905600 353 | 668872645589471232 354 | 669613420665159680 355 | 618805892222468096 356 | 645362146415525888 357 | 643103859729166337 358 | 674364257799004160 359 | 666190716448587776 360 | 634404792241143809 361 | 631388553801564160 362 | 672219174463275008 363 | 667534186450825216 364 | 676120162018451456 365 | 674229534888185856 366 | 672902686380003328 367 | 666070802924617728 368 | 674244561519161344 369 | 655080266784968705 370 | 633823543541768192 371 | 642145732435292160 372 | 662381914842603520 373 | 676870737932742656 374 | 626770498328895488 375 | 628045645010608128 376 | 659462980476637184 377 | 672539897899577344 378 | 672433211604013057 379 | 674014933235859456 380 | 664000310856310784 381 | 657007736467525632 382 | 620971220301787136 383 | 611039775856812032 384 | 613294443878305796 385 | 675064077367005184 386 | 613362193787129860 387 | 638047610973089793 388 | 653250169752977408 389 | 669259395902152704 390 | 675005503160901632 391 | 614054616154550273 392 | 676067381299576832 393 | 672424512516964352 394 | 604642913188872192 395 | 656880145769197568 396 | 663817239896821760 397 | 672632863452299264 398 | 666051332504207360 399 | 672927317191229440 400 | 656811196218286080 401 | 652783670370115585 402 | 662430295254175744 403 | 673686233936072704 404 | 665358434351509504 405 | 604625816992002049 406 | 656595123590012928 407 | 613016993692798977 408 | 647464349611589632 409 | 613404935003217920 410 | 658259426172891136 411 | 674301413040758785 412 | 676718762830221312 413 | 668144671772778497 414 | 620367840902782976 415 | 636925368927064064 416 | 673615400655970304 417 | 656830586577883136 418 | 658786161733734400 419 | 672632899921833984 420 | 666497286663503872 421 | 658065957823324160 422 | 663925546812837888 423 | 673079581520318464 424 | 651959206287908868 425 | 612646796355960832 426 | 661120256732041216 427 | 623818627054206977 428 | 654343805081157633 429 | 665575674485211136 430 | 626901072209121282 431 | 613425834301485056 432 | 656825206045020160 433 | 655986243042459648 434 | 642432477185867776 435 | 637382230394822656 436 | 640644123339431936 437 | 656818921979310081 438 | 661299012386095105 439 | 654371696195993600 440 | 666633171325353989 441 | 647193820812177408 442 | 656047932093763584 443 | 644229386149888001 444 | 665379967757324288 445 | 674301960787505153 446 | 618192748735299584 447 | 673872171341447169 448 | 672180526946656256 449 | 674314254732931072 450 | 661222523275636736 451 | 634943791934406657 452 | 665364878287224834 453 | 633961125126668288 454 | 651321040119963648 455 | 634665777400950784 456 | 613114185505996802 457 | 638050997340893184 458 | 626897206717624320 459 | 613061089518034944 460 | 671181758692507648 461 | 675043569367982081 462 | 663904307113275392 463 | 637868242560638980 464 | 648894687542034432 465 | 656955120626880512 466 | 673984270902427650 467 | 633949800761700352 468 | 648310692794109952 469 | 661251968078221312 470 | 620916279608651776 471 | 645711628046995462 472 | 645356735545364480 473 | 667465205258051584 474 | 663515735231062016 475 | 669201837187334144 476 | 622858454949040128 477 | 643225207705075716 478 | 672906198434209792 479 | 672488384695279616 480 | 612741808125120513 481 | 660466342038867969 482 | 652992524504600576 483 | 651402689352351744 484 | 618449248179191808 485 | 643139873264812032 486 | 641430951403343872 487 | 672432930426372096 488 | 627828211003469825 489 | 663385747177775105 490 | 620835698514464768 491 | 654351281260113920 492 | 665361505303584774 493 | 677099574855639044 494 | 652882609219833856 495 | 714555825122107392 496 | 722885778448121857 497 | 651786568592658433 498 | 663744139666804736 499 | 748558349139058688 500 | 724320681517670400 501 | 653432261203750912 502 | 742678930516123650 503 | 727172374999666688 504 | 743126914794037248 505 | 715256242990505984 506 | 752965545528528898 507 | 752875379765968897 508 | 715254040289021952 509 | 707405809181917184 510 | 714598641827246081 511 | 707412869860696064 512 | 701872343736520704 513 | 726086935903494144 514 | 701539698452393986 515 | 707321278135463936 516 | 727966590084485120 517 | 724348906096590849 518 | 778949749156245504 519 | 755439197125767169 520 | 760120409429643266 521 | 649584608560832513 522 | 727854332188577792 523 | 748543642323783681 524 | 780436430732525569 525 | 764931593303646208 526 | 732981604826677249 527 | 714577521992343552 528 | 707420972173955072 529 | 749286768554438658 530 | 724703995147751424 531 | 714560810266132480 532 | 714503380476026880 533 | 728627623488786433 534 | 727179214546456577 535 | 707308274270539777 536 | 716461257025581056 537 | 650975967146602496 538 | 760928376668454912 539 | 725983128444129280 540 | 715671763808493569 541 | 730939370765754368 542 | 655812191233417216 543 | 778530869208190976 544 | 778625026144792577 545 | 707310135291416576 546 | 716092408920936448 547 | 778681502825451520 548 | 714851393861881857 549 | 714998347111669760 550 | 729647367457230850 551 | 760109079133990912 552 | 728038172270198787 553 | 701975210044497921 554 | 780882510645370880 555 | 742050150307246080 556 | 727623131494387714 557 | 751536167183613952 558 | 723477822950395904 559 | 743058135300988932 560 | 653432177632387072 561 | 765735409984806912 562 | 652300118205427716 563 | 763520953619918848 564 | 740791134146965504 565 | 697992796565741569 566 | 763738618573623297 567 | 778299287293816832 568 | 714531423273746432 569 | 743764020679741440 570 | 763896522790440960 571 | 778689027918618625 572 | 714567472712589312 573 | 748640007934590976 574 | 726442550266044416 575 | 707305999971921920 576 | 711994705333112832 577 | 728273551883534336 578 | 749039299677417472 579 | 723504069814444033 580 | 730516765525082112 581 | 723644048867774464 582 | 703234354579898368 583 | 705093513076015104 584 | 779633844680962048 585 | 656361703664451585 586 | 652982112870662144 587 | 755548076438196225 588 | 765739657908850688 589 | 716416753409081344 590 | 763524712853102596 591 | 717081129627553792 592 | 725070832494624769 593 | 763430916236640256 594 | 777710439870455808 595 | 728013148788154368 596 | 755523157700648960 597 | 732004388181434368 598 | 715268937873760256 599 | 774833492865593344 600 | 712223438698627073 601 | 724939017410727938 602 | 707786906189303808 603 | 764368020391223296 604 | 757450526153900032 605 | 757190314880884736 606 | 716424773216022530 607 | 653285570383335424 608 | 701514249269542912 609 | 731093044460683264 610 | 724044187113512960 611 | 656523458139045889 612 | 714598318333042688 613 | 706933939953344514 614 | 640182854928961536 615 | 715253497462145024 616 | 658938136299511808 617 | 726190016435728385 618 | 724603564946010112 619 | 745236050407194624 620 | 727982226290442240 621 | 705092738224525312 622 | 648993731169939456 623 | 640118021101604864 624 | 650254360727973889 625 | 742571519105077248 626 | 728101712762834944 627 | 652000523525091328 628 | 755475529294352385 629 | 724624672604610562 630 | 723915846985342976 631 | 733242244522725376 632 | 651486105628463105 633 | 775672628493357057 634 | 716448280201269248 635 | 759460236042305536 636 | 766808183696351233 637 | 707332312724283392 638 | 651044059222556674 639 | 728207861050970112 640 | 707604196812591104 641 | 727116900983934976 642 | 756690088533393409 643 | 723365789378584578 644 | 741995157969592321 645 | 724661834419048448 646 | 765887221736046592 647 | 701175292937707520 648 | 650710483289419776 649 | 652349108653551616 650 | 723511860516016128 651 | 715255507506892800 652 | 726043971911213057 653 | 728631482722308096 654 | 778572032531427332 655 | 727187859367546880 656 | -------------------------------------------------------------------------------- /model/TD_RvNN.py: -------------------------------------------------------------------------------- 1 | __doc__ = """Tree GRU aka Recursive Neural Networks.""" 2 | 3 | import numpy as np 4 | import theano 5 | from theano import tensor as T 6 | #from collections import OrderedDict 7 | from theano.compat.python2x import OrderedDict 8 | from theano.tensor.signal.pool import pool_2d 9 | 10 | 11 | theano.config.floatX = 'float32' 12 | 13 | 14 | class Node_tweet(object): 15 | def __init__(self, idx=None): 16 | self.children = [] 17 | #self.index = index 18 | self.idx = idx 19 | self.word = [] 20 | self.index = [] 21 | #self.height = 1 22 | #self.size = 1 23 | #self.num_leaves = 1 24 | self.parent = None 25 | #self.label = None 26 | 27 | ################################# generate tree structure ############################## 28 | #def gen_nn_inputs(root_node, ini_word, ini_index): 29 | def gen_nn_inputs(root_node, ini_word): 30 | """Given a root node, returns the appropriate inputs to NN. 31 | 32 | The NN takes in 33 | x: the values at the leaves (e.g. word indices) 34 | tree: a (n x degree) matrix that provides the computation order. 35 | Namely, a row tree[i] = [a, b, c] in tree signifies that a 36 | and b are children of c, and that the computation 37 | f(a, b) -> c should happen on step i. 38 | 39 | """ 40 | #_clear_indices(root_node) 41 | #x, leaf_labels = _get_leaf_vals(root_node) 42 | #X_word, X_index = _get_leaf_vals(root_node) 43 | tree = [[0, root_node.idx]] 44 | #X_word, X_index = [ini_word], [ini_index] 45 | X_word, X_index = [root_node.word], [root_node.index] 46 | #print X_index 47 | #print X_word 48 | #exit(0) 49 | internal_tree, internal_word, internal_index = _get_tree_path(root_node) 50 | #print internal_tree 51 | #assert all(v is not None for v in x) 52 | #if not only_leaves_have_vals: 53 | # assert all(v is not None for v in internal_x) 54 | tree.extend(internal_tree) 55 | X_word.extend(internal_word) 56 | X_index.extend(internal_index) 57 | X_word.append(ini_word) 58 | #if max_degree is not None: 59 | # assert all(len(t) == max_degree + 1 for t in tree) 60 | '''if with_labels: 61 | labels = leaf_labels + internal_labels 62 | labels_exist = [l is not None for l in labels] 63 | labels = [l or 0 for l in labels] 64 | return (np.array(x, dtype='int32'), 65 | np.array(tree, dtype='int32'), 66 | np.array(labels, dtype=theano.config.floatX), 67 | np.array(labels_exist, dtype=theano.config.floatX))''' 68 | ##### debug here ##### 69 | '''ls = [] 70 | for x in X_word: 71 | l = len(x) 72 | if not l in ls: ls.append(l) 73 | print ls''' 74 | #print X_word 75 | #print type(X_word) 76 | return (np.array(X_word, dtype='float32'), 77 | np.array(X_index, dtype='int32'), 78 | np.array(tree, dtype='int32')) 79 | #return (np.array(X_word), 80 | # np.array(X_index), 81 | # np.array(tree)) 82 | 83 | def _get_tree_path(root_node): 84 | """Get computation order of leaves -> root.""" 85 | if not root_node.children: 86 | return [], [], [] 87 | layers = [] 88 | layer = [root_node] 89 | while layer: 90 | layers.append(layer[:]) 91 | next_layer = [] 92 | [next_layer.extend([child for child in node.children if child]) 93 | for node in layer] 94 | layer = next_layer 95 | #print 'layer:', layers 96 | tree = [] 97 | word = [] 98 | index = [] 99 | for layer in layers: 100 | for node in layer: 101 | if not node.children: 102 | continue 103 | #child_idxs = [child.idx for child in ] ## idx of child node 104 | for child in node.children: 105 | tree.append([node.idx, child.idx]) 106 | word.append(child.word if child.word is not None else -1) 107 | index.append(child.index if child.index is not None else -1) 108 | '''if max_degree is not None: 109 | child_idxs.extend([-1] * (max_degree - len(child_idxs))) 110 | assert not any(idx is None for idx in child_idxs) 111 | 112 | node.idx = idx 113 | tree.append(child_idxs + [node.idx]) 114 | internal_word.append(node.word if node.word is not None else -1) 115 | internal_index.append(node.index if node.index is not None else -1) 116 | idx += 1''' 117 | 118 | return tree, word, index 119 | 120 | ################################ tree rnn class ###################################### 121 | class RvNN(object): 122 | """Data is represented in a tree structure. 123 | 124 | Every leaf and internal node has a data (provided by the input) 125 | and a memory or hidden state. The hidden state is computed based 126 | on its own data and the hidden states of its children. The 127 | hidden state of leaves is given by a custom init function. 128 | 129 | The entire tree's embedding is represented by the final 130 | state computed at the root. 131 | 132 | """ 133 | def __init__(self, word_dim, hidden_dim=5, Nclass=4, 134 | degree=2, momentum=0.9, 135 | trainable_embeddings=True, 136 | labels_on_nonroot_nodes=False, 137 | irregular_tree=True): 138 | assert word_dim > 1 and hidden_dim > 1 139 | self.word_dim = word_dim 140 | self.hidden_dim = hidden_dim 141 | self.Nclass = Nclass 142 | self.degree = degree 143 | #self.learning_rate = learning_rate 144 | self.momentum = momentum 145 | self.irregular_tree = irregular_tree 146 | 147 | self.params = [] 148 | 149 | #self.x = T.ivector(name='x') # word indices 150 | #self.x_word = T.matrix(dtype=theano.config.floatX) # word frequendtype=theano.config.floatX 151 | self.x_word = T.matrix(name='x_word') # word frequent 152 | self.x_index = T.imatrix(name='x_index') # word indices 153 | self.tree = T.imatrix(name='tree') # shape [None, self.degree] 154 | self.y = T.ivector(name='y') # output shape [self.output_dim] 155 | self.num_parent = T.iscalar(name='num_parent') 156 | self.num_nodes = self.x_word.shape[0] # total number of nodes (leaves + internal) in tree 157 | self.num_child = self.num_nodes - self.num_parent-1 158 | #emb_x = self.embeddings[self.x] 159 | #emb_x = emb_x * T.neq(self.x, -1).dimshuffle(0, 'x') # zero-out non-existent embeddings 160 | 161 | self.tree_states = self.compute_tree(self.x_word, self.x_index, self.num_parent, self.tree) 162 | #self.final_state = self.tree_states.mean(axis=0)#self.tree_states[-1] 163 | #self.final_state = pool_2d(input=self.tree_states, ds=(self.num_child,1), ignore_border=True,mode='max') 164 | self.final_state = self.tree_states.max(axis=0) 165 | self.output_fn = self.create_output_fn() 166 | self.pred_y = self.output_fn(self.final_state) 167 | self.loss = self.loss_fn(self.y, self.pred_y) 168 | 169 | self.learning_rate = T.scalar('learning_rate') 170 | #updates = self.gradient_descent(self.loss, self.learning_rate) 171 | train_inputs = [self.x_word, self.x_index, self.num_parent, self.tree, self.y, self.learning_rate] 172 | updates = self.gradient_descent(self.loss) 173 | 174 | #train_inputs = [self.x_word, self.x_index, self.tree, self.y] 175 | self._train = theano.function(train_inputs, 176 | [self.loss, self.pred_y], 177 | updates=updates) 178 | 179 | self._evaluate = theano.function([self.x_word, self.x_index, self.num_parent, self.tree], self.final_state) 180 | self._evaluate2 = theano.function([self.x_word, self.x_index, self.num_parent, self.tree], self.tree_states) 181 | #self._state = theano.function([self.x_word, self.x_index, self.num_child, self.tree], self.tree_states) 182 | 183 | self._predict = theano.function([self.x_word, self.x_index, self.num_parent, self.tree], self.pred_y) 184 | 185 | self.tree_states_test = self.compute_tree_test(self.x_word, self.x_index, self.tree) 186 | self._evaluate3 = theano.function([self.x_word, self.x_index, self.tree], self.tree_states_test) 187 | 188 | '''def _check_input(self, x, tree): 189 | assert np.array_equal(tree[:, -1], np.arange(len(x) - len(tree), len(x))) 190 | if not self.irregular_tree: 191 | assert np.all((tree[:, 0] + 1 >= np.arange(len(tree))) | 192 | (tree[:, 0] == -1)) 193 | assert np.all((tree[:, 1] + 1 >= np.arange(len(tree))) | 194 | (tree[:, 1] == -1)) 195 | 196 | def train_step_inner(self, x, tree, y): 197 | self._check_input(x, tree) 198 | return self._train(x, tree[:, :-1], y) 199 | 200 | def train_step(self, root_node, y): 201 | x_word, x_index, tree = gen_nn_inputs(root_node, max_degree=self.degree, only_leaves_have_vals=False) 202 | return self._train(x_word, x_index, tree[:, :-1], y) 203 | #return self.train_step_inner(x, tree, y)''' 204 | 205 | def train_step_up(self, x_word, x_index, num_parent, tree, y, lr): 206 | #x_word, x_index, tree = gen_nn_inputs(root_node, max_degree=self.degree, only_leaves_have_vals=False) 207 | return self._train(x_word, x_index, num_parent, tree, y, lr) 208 | 209 | def evaluate(self, x_word, x_index, num_parent, tree): 210 | #x, tree = gen_nn_inputs(root_node, max_degree=self.degree, only_leaves_have_vals=False) 211 | #self._check_input(x, tree) 212 | return self._evaluate(x_word, x_index, num_parent, tree) 213 | 214 | def predict_up(self, x_word, x_index, num_parent, tree): 215 | #x, tree = gen_nn_inputs(root_node, max_degree=self.degree, only_leaves_have_vals=False) 216 | #self._check_input(x, tree) 217 | return self._predict(x_word, x_index, num_parent, tree) 218 | 219 | def init_matrix(self, shape): 220 | return np.random.normal(scale=0.1, size=shape).astype(theano.config.floatX) 221 | 222 | def init_vector(self, shape): 223 | return np.zeros(shape, dtype=theano.config.floatX) 224 | 225 | def create_output_fn(self): 226 | self.W_out = theano.shared(self.init_matrix([self.Nclass, self.hidden_dim])) 227 | self.b_out = theano.shared(self.init_vector([self.Nclass])) 228 | self.params.extend([self.W_out, self.b_out]) 229 | 230 | def fn(final_state): 231 | return T.nnet.softmax( self.W_out.dot(final_state)+ self.b_out ) 232 | return fn 233 | 234 | '''def create_output_fn_multi(self): 235 | self.W_out = theano.shared(self.init_matrix([self.output_dim, self.hidden_dim])) 236 | self.b_out = theano.shared(self.init_vector([self.output_dim])) 237 | self.params.extend([self.W_out, self.b_out]) 238 | 239 | def fn(tree_states): 240 | return T.nnet.softmax( 241 | T.dot(tree_states, self.W_out.T) + 242 | self.b_out.dimshuffle('x', 0)) 243 | return fn''' 244 | 245 | def create_recursive_unit(self): 246 | self.E = theano.shared(self.init_matrix([self.hidden_dim, self.word_dim])) 247 | self.W_z = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 248 | self.U_z = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 249 | self.b_z = theano.shared(self.init_vector([self.hidden_dim])) 250 | self.W_r = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 251 | self.U_r = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 252 | self.b_r = theano.shared(self.init_vector([self.hidden_dim])) 253 | self.W_h = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 254 | self.U_h = theano.shared(self.init_matrix([self.hidden_dim, self.hidden_dim])) 255 | self.b_h = theano.shared(self.init_vector([self.hidden_dim])) 256 | self.params.extend([self.E, self.W_z, self.U_z, self.b_z, self.W_r, self.U_r, self.b_r, self.W_h, self.U_h, self.b_h]) 257 | def unit(word, index, parent_h): 258 | #h_tilde = T.sum(child_h, axis=0) 259 | child_xe = self.E[:,index].dot(word) 260 | z = T.nnet.hard_sigmoid(self.W_z.dot(child_xe)+self.U_z.dot(parent_h)+self.b_z) 261 | r = T.nnet.hard_sigmoid(self.W_r.dot(child_xe)+self.U_r.dot(parent_h)+self.b_r) 262 | c = T.tanh(self.W_h.dot(child_xe)+self.U_h.dot(parent_h * r)+self.b_h) 263 | h = z*parent_h + (1-z)*c 264 | return h 265 | return unit 266 | 267 | '''def create_leaf_unit(self): 268 | dummy = 0 * theano.shared(self.init_vector([self.degree, self.hidden_dim])) 269 | def unit(leaf_word, leaf_index): 270 | return self.recursive_unit( leaf_word, leaf_index, dummy, dummy.sum(axis=1)) 271 | return unit''' 272 | 273 | def compute_tree(self, x_word, x_index, num_parent, tree): 274 | self.recursive_unit = self.create_recursive_unit() 275 | #num_nodes = self.num_nodes+1 276 | def ini_unit(x): 277 | return theano.shared(self.init_vector([self.hidden_dim])) 278 | #init_node_h = 0 * theano.shared(self.init_vector([self.num_nodes, self.hidden_dim])) 279 | init_node_h, _ = theano.scan( 280 | fn=ini_unit, 281 | sequences=[ x_word ]) 282 | #n_steps=num_nodes) 283 | #dummy = 0 * theano.shared(self.init_vector([self.hidden_dim])) 284 | #init_node_h = T.concatenate([dummy, all_node_h], axis=0) 285 | 286 | '''self.recursive_unit = self.create_recursive_unit() 287 | self.leaf_unit = self.create_leaf_unit() 288 | num_parents = tree.shape[0] # num internal nodes 289 | num_leaves = self.num_nodes - num_parents 290 | 291 | # compute leaf hidden states 292 | leaf_h, _ = theano.map( 293 | fn=self.leaf_unit, 294 | sequences=[ x_word[:num_leaves], x_index[:num_leaves] ]) 295 | if self.irregular_tree: 296 | init_node_h = T.concatenate([leaf_h, leaf_h, leaf_h], axis=0) 297 | else: 298 | init_node_h = leaf_h''' 299 | 300 | # use recurrence to compute internal node hidden states 301 | def _recurrence(x_word, x_index, node_info, node_h, last_h): 302 | parent_h = node_h[node_info[0]] 303 | child_h = self.recursive_unit(x_word, x_index, parent_h) 304 | #node_h[node_info[1]] = child_h 305 | node_h = T.concatenate([node_h[:node_info[1]], 306 | child_h.reshape([1, self.hidden_dim]), 307 | node_h[node_info[1]+1:] ]) 308 | '''#child_exists = node_info > -1 309 | #offset = 2*num_leaves * int(self.irregular_tree) - child_exists * t ### offset??? 310 | child_h = node_h[node_info + offset] * child_exists.dimshuffle(0, 'x') ### transpose?? 311 | parent_h = self.recursive_unit(x_word, x_index, child_h, child_exists) 312 | node_h = T.concatenate([node_h, 313 | parent_h.reshape([1, self.hidden_dim])]) 314 | return node_h[1:], parent_h''' 315 | return node_h, child_h 316 | 317 | dummy = theano.shared(self.init_vector([self.hidden_dim])) 318 | (_, child_hs), _ = theano.scan( 319 | fn=_recurrence, 320 | outputs_info=[init_node_h, dummy], 321 | sequences=[x_word[:-1], x_index, tree]) 322 | 323 | '''dummy = theano.shared(self.init_vector([self.hidden_dim])) 324 | (_, parent_h), _ = theano.scan( 325 | fn=_recurrence, 326 | outputs_info=[init_node_h, dummy], 327 | sequences=[x_word[num_leaves:], x_index[num_leaves:], tree, T.arange(num_parents)], 328 | n_steps=num_parents) 329 | 330 | return T.concatenate([leaf_h, parent_h], axis=0)''' 331 | return child_hs[num_parent-1:] 332 | 333 | def compute_tree_test(self, x_word, x_index, tree): 334 | self.recursive_unit = self.create_recursive_unit() 335 | def ini_unit(x): 336 | return theano.shared(self.init_vector([self.hidden_dim])) 337 | init_node_h, _ = theano.scan( 338 | fn=ini_unit, 339 | sequences=[ x_word ]) 340 | 341 | def _recurrence(x_word, x_index, node_info, node_h, last_h): 342 | parent_h = node_h[node_info[0]] 343 | child_h = self.recursive_unit(x_word, x_index, parent_h) 344 | #node_h[node_info[1]] = child_h 345 | node_h = T.concatenate([node_h[:node_info[1]], 346 | child_h.reshape([1, self.hidden_dim]), 347 | node_h[node_info[1]+1:] ]) 348 | return node_h, child_h 349 | 350 | dummy = theano.shared(self.init_vector([self.hidden_dim])) 351 | (_, child_hs), _ = theano.scan( 352 | fn=_recurrence, 353 | outputs_info=[init_node_h, dummy], 354 | sequences=[x_word[:-1], x_index, tree]) 355 | return child_hs 356 | 357 | def loss_fn(self, y, pred_y): 358 | return T.sum(T.sqr(y - pred_y)) 359 | 360 | '''def loss_fn_multi(self, y, pred_y, y_exists): 361 | return T.sum(T.sum(T.sqr(y - pred_y), axis=1) * y_exists, axis=0)''' 362 | 363 | def gradient_descent(self, loss): 364 | """Momentum GD with gradient clipping.""" 365 | grad = T.grad(loss, self.params) 366 | self.momentum_velocity_ = [0.] * len(grad) 367 | grad_norm = T.sqrt(sum(map(lambda x: T.sqr(x).sum(), grad))) 368 | updates = OrderedDict() 369 | not_finite = T.or_(T.isnan(grad_norm), T.isinf(grad_norm)) 370 | scaling_den = T.maximum(5.0, grad_norm) 371 | for n, (param, grad) in enumerate(zip(self.params, grad)): 372 | grad = T.switch(not_finite, 0.1 * param, 373 | grad * (5.0 / scaling_den)) 374 | velocity = self.momentum_velocity_[n] 375 | update_step = self.momentum * velocity - self.learning_rate * grad 376 | self.momentum_velocity_[n] = update_step 377 | updates[param] = param + update_step 378 | return updates 379 | --------------------------------------------------------------------------------