Commit 2257845a by Genii Silitonga

updated

parent 130d626d
...@@ -847,7 +847,8 @@ ...@@ -847,7 +847,8 @@
" else:\n", " else:\n",
" res.append((result[1], result[0]))\n", " res.append((result[1], result[0]))\n",
" if not prints:\n", " if not prints:\n",
" return res" " for result in similarities[:top_n]:\n",
" return f\"{data['NAME'][result[1]]} \\t {result[0]}\\n\""
] ]
}, },
{ {
...@@ -859,18 +860,18 @@ ...@@ -859,18 +860,18 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Men Suits: Formal Suits\n", "man suits\n",
"Men Suits: Formal Suits\n", "man suits\n",
"\n", "\n",
"Lino Perros Men Red & Blue Accessory Gift Set \t 0.3818812966346741\n", "Royal Enfield Men Black Short Summer Riding Leather Gloves \t 0.19364917278289795\n",
"\n", "\n",
"Swiss Military Unisex Black Free Flow Travel Organiser \t 0.3689323663711548\n", "Baggit Men Black Solid Two Fold Wallet \t 0.1819017082452774\n",
"\n", "\n",
"Alvaro Castagnino Pack of 3 White Solid Cotton Handkerchief Gift Set \t 0.3572172522544861\n", "Tossido Men Blue & Black Accessory Gift Set \t 0.13608276844024658\n",
"\n", "\n",
"Being Human Clothing Men Navy Genuine Leather Belt \t 0.27907276153564453\n", "Lino Perros Men Red & Blue Accessory Gift Set \t 0.13363061845302582\n",
"\n", "\n",
"FabSeasons Beige Solid Scarf \t 0.27399832010269165\n", "Lino Perros Yellow Patterned Tie \t 0.1330380141735077\n",
"\n" "\n"
] ]
} }
...@@ -972,18 +973,18 @@ ...@@ -972,18 +973,18 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Men Suits Formal\n", "man suits\n",
"Men Suits Formal\n", "man suits\n",
"\n", "\n",
"Lino Perros Yellow Patterned Tie \t 0.30940839648246765\n", "Royal Enfield Men Black Short Summer Riding Leather Gloves \t 0.4765750467777252\n",
"\n", "\n",
"Lino Perros Men Red & Blue Accessory Gift Set \t 0.28751063346862793\n", "Baggit Men Black Solid Two Fold Wallet \t 0.44735321402549744\n",
"\n", "\n",
"Fastrack Men Tan Brown Solid Belt \t 0.2718902826309204\n", "Lino Perros Yellow Patterned Tie \t 0.26982423663139343\n",
"\n", "\n",
"Swiss Military Unisex Black Free Flow Travel Organiser \t 0.25618454813957214\n", "Lino Perros Men Red & Blue Accessory Gift Set \t 0.25037795305252075\n",
"\n", "\n",
"French Connection Men Navy Blue Solid Leather Belt \t 0.23481214046478271\n", "Fastrack Men Tan Brown Solid Belt \t 0.23710601031780243\n",
"\n" "\n"
] ]
} }
...@@ -1322,7 +1323,7 @@ ...@@ -1322,7 +1323,7 @@
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"[<matplotlib.lines.Line2D at 0x2d674272b48>]" "[<matplotlib.lines.Line2D at 0x256ce945048>]"
] ]
}, },
"execution_count": 44, "execution_count": 44,
...@@ -1659,18 +1660,18 @@ ...@@ -1659,18 +1660,18 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"fort collin men red solid pad jacket\n", "man suits\n",
"fort collin men red solid pad jacket\n", "man suits\n",
"\n", "\n",
"U.S. Polo Assn. Men Brown Genuine Leather Two Fold Wallet \t 5.350090026855469\n", "Baggit Men Black Solid Two Fold Wallet \t 2.119823455810547\n",
"\n", "\n",
"SCHARF Men Brown Leather Solid Belt \t 4.534244537353516\n", "Royal Enfield Men Black Short Summer Riding Leather Gloves \t 2.107051372528076\n",
"\n", "\n",
"Tommy Hilfiger Men Black Solid Genuine Leather Belt \t 4.481557369232178\n", "Swiss Military Unisex Black Free Flow Travel Organiser \t 1.7023154497146606\n",
"\n", "\n",
"Adidas Originals Unisex Black NMD Printed Baseball Cap \t 4.477484703063965\n", "Da Milano Men Brown Textured Two Fold Wallet \t 1.462896466255188\n",
"\n", "\n",
"Alvaro Castagnino Men Coffee Brown Textured Belt \t 4.455972671508789\n", "Lino Perros Red Solid Tie \t 1.4308322668075562\n",
"\n" "\n"
] ]
} }
...@@ -1723,13 +1724,13 @@ ...@@ -1723,13 +1724,13 @@
"[(0,\n", "[(0,\n",
" '0.780*\",\" + 0.321*\"men\" + 0.224*\"buy\" + 0.214*\"apparel\" + 0.119*\"shirt\" + 0.115*\"fit\" + 0.112*\"india\" + 0.112*\"online\" + 0.112*\"for\" + 0.112*\"in\"'),\n", " '0.780*\",\" + 0.321*\"men\" + 0.224*\"buy\" + 0.214*\"apparel\" + 0.119*\"shirt\" + 0.115*\"fit\" + 0.112*\"india\" + 0.112*\"online\" + 0.112*\"for\" + 0.112*\"in\"'),\n",
" (1,\n", " (1,\n",
" '-0.541*\"jeans\" + 0.275*\"shirt\" + 0.263*\"t\" + 0.262*\"tshirts\" + -0.255*\"rise\" + -0.246*\"fit\" + -0.217*\"mid\" + -0.204*\"stretchable\" + -0.197*\"look\" + -0.197*\"clean\"'),\n", " '0.541*\"jeans\" + -0.275*\"shirt\" + -0.263*\"t\" + -0.262*\"tshirts\" + 0.255*\"rise\" + 0.246*\"fit\" + 0.217*\"mid\" + 0.204*\"stretchable\" + 0.197*\"look\" + 0.197*\"clean\"'),\n",
" (2,\n", " (2,\n",
" '-0.422*\"trousers\" + 0.342*\"jeans\" + -0.274*\".\" + 0.273*\"t\" + 0.271*\"tshirts\" + -0.240*\"fit\" + 0.202*\"neck\" + -0.201*\"formal\" + -0.191*\"solid\" + 0.180*\"round\"'),\n", " '0.422*\"trousers\" + -0.342*\"jeans\" + 0.274*\".\" + -0.273*\"t\" + -0.271*\"tshirts\" + 0.240*\"fit\" + -0.202*\"neck\" + 0.201*\"formal\" + 0.191*\"solid\" + -0.180*\"round\"'),\n",
" (3,\n", " (3,\n",
" '-0.754*\".\" + -0.317*\"polo\" + -0.248*\"s\" + -0.240*\"u\" + -0.240*\"assn\" + -0.132*\"jeans\" + -0.125*\"t\" + -0.125*\"tshirts\" + 0.099*\"solid\" + 0.097*\"trousers\"'),\n", " '0.754*\".\" + 0.317*\"polo\" + 0.248*\"s\" + 0.240*\"u\" + 0.240*\"assn\" + 0.132*\"jeans\" + 0.125*\"t\" + 0.125*\"tshirts\" + -0.099*\"solid\" + -0.097*\"trousers\"'),\n",
" (4,\n", " (4,\n",
" '0.429*\"shirts\" + 0.346*\"shirt\" + -0.338*\"trousers\" + 0.305*\"&\" + -0.281*\"solid\" + 0.259*\"fit\" + 0.251*\"slim\" + 0.185*\"casual\" + 0.182*\"blue\" + 0.150*\"formal\"')]" " '-0.429*\"shirts\" + -0.346*\"shirt\" + 0.338*\"trousers\" + -0.305*\"&\" + 0.281*\"solid\" + -0.259*\"fit\" + -0.251*\"slim\" + -0.185*\"casual\" + -0.182*\"blue\" + -0.150*\"formal\"')]"
] ]
}, },
"execution_count": 55, "execution_count": 55,
...@@ -1750,256 +1751,256 @@ ...@@ -1750,256 +1751,256 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"0 282.2957056725745 282.29570567257457 True\n", "0 282.29570567257423 282.29570567257457 True\n",
"1 80.81257947082779 80.8125794708277 True\n", "1 80.81257947082767 80.8125794708277 True\n",
"2 61.2025092822799 61.20250928228014 True\n", "2 61.20250928228007 61.20250928228014 True\n",
"3 54.82496635290205 54.82496635290246 True\n", "3 54.82496635290196 54.82496635290246 True\n",
"4 45.5670465049582 45.567046504959784 True\n", "4 45.56704650495861 45.567046504959784 True\n",
"5 38.598219529238044 38.59821952924385 True\n", "5 38.59821952923482 38.59821952924385 True\n",
"6 37.269131448143646 37.26913144815381 True\n", "6 37.26913144813921 37.26913144815381 True\n",
"7 33.99246596229948 33.992465962326975 True\n", "7 33.992465962292876 33.992465962326975 True\n",
"8 30.393295763165092 30.393295763239777 True\n", "8 30.39329576319288 30.393295763239777 True\n",
"9 29.24664300126496 29.246643001359455 True\n", "9 29.2466430012623 29.246643001359455 True\n",
"10 28.263987512025277 28.26398751215802 True\n", "10 28.263987512007613 28.26398751215802 True\n",
"11 27.14532503702664 27.14532503722892 True\n", "11 27.14532503689811 27.14532503722892 True\n",
"12 25.41598071645504 25.41598071675283 True\n", "12 25.415980716099885 25.41598071675283 True\n",
"13 24.98131018892752 24.98131018927059 True\n", "13 24.981310188991227 24.98131018927059 True\n",
"14 24.16536025554687 24.165360256313193 True\n", "14 24.16536025569852 24.165360256313193 True\n",
"15 22.99614928434986 22.996149285216802 True\n", "15 22.996149284481763 22.996149285216802 True\n",
"16 22.88201020775814 22.88201020877216 True\n", "16 22.882010207899878 22.88201020877216 True\n",
"17 22.448388235571667 22.448388237247304 True\n", "17 22.44838823607819 22.448388237247304 True\n",
"18 21.818995181426622 21.818995182649086 True\n", "18 21.8189951810088 21.818995182649086 True\n",
"19 21.24004501140754 21.240045012655823 True\n", "19 21.240045011348002 21.240045012655823 True\n",
"20 21.168987570646056 21.168987572195757 True\n", "20 21.168987570704576 21.168987572195757 True\n",
"21 21.005236901673996 21.005236903568335 True\n", "21 21.005236901756216 21.005236903568335 True\n",
"22 20.162074696274146 20.162074700408372 True\n", "22 20.162074697952303 20.162074700408372 True\n",
"23 19.91297318890671 19.912973191044898 True\n", "23 19.912973188388158 19.912973191044898 True\n",
"24 19.407942238696013 19.407942242225236 True\n", "24 19.40794223845312 19.407942242225236 True\n",
"25 19.023124693691763 19.023124699013543 True\n", "25 19.023124695203816 19.023124699013543 True\n",
"26 18.700268546037467 18.700268551646744 True\n", "26 18.700268543611063 18.700268551646744 True\n",
"27 18.29113497448139 18.29113497941287 True\n", "27 18.291134969329004 18.29113497941287 True\n",
"28 18.015883984501855 18.015883990507948 True\n", "28 18.015883984368692 18.015883990507948 True\n",
"29 17.58155199770854 17.581552004832204 True\n", "29 17.581551998527598 17.581552004832204 True\n",
"30 17.29542395054032 17.295423957233293 True\n", "30 17.2954239475833 17.295423957233293 True\n",
"31 16.71848273717535 16.71848275255207 True\n", "31 16.718482739541955 16.71848275255207 True\n",
"32 16.609819602230935 16.609819635955624 True\n", "32 16.609819619098037 16.609819635955624 True\n",
"33 16.309400090363674 16.309400120331937 True\n", "33 16.309400104773395 16.309400120331937 True\n",
"34 16.058266839219534 16.058266869171515 True\n", "34 16.058266853376118 16.058266869171515 True\n",
"35 15.921197288478133 15.921197312865562 True\n", "35 15.921197292961821 15.921197312865562 True\n",
"36 15.68860869331597 15.68860872882099 True\n", "36 15.688608698896468 15.68860872882099 True\n",
"37 15.653385295109098 15.65338532296361 True\n", "37 15.653385303496092 15.65338532296361 True\n",
"38 15.227163268297298 15.227163292617222 True\n", "38 15.227163258671846 15.227163292617222 True\n",
"39 15.067716380653842 15.067716433896795 True\n", "39 15.067716372558303 15.067716433896795 True\n",
"40 15.058679268403141 15.058679294840521 True\n", "40 15.058679251287106 15.058679294840521 True\n",
"41 14.726609720570547 14.726609780193257 True\n", "41 14.726609736523427 14.726609780193257 True\n",
"42 14.658026288294467 14.658026367364325 True\n", "42 14.658026330534808 14.658026367364325 True\n",
"43 14.33539278880494 14.335392865427117 True\n", "43 14.335392777537875 14.335392865427117 True\n",
"44 14.192437528767188 14.19243761219465 True\n", "44 14.192437545859887 14.19243761219465 True\n",
"45 13.991063373266023 13.991063422651143 True\n", "45 13.991063310361032 13.991063422651143 True\n",
"46 13.835585617129746 13.835585710950633 True\n", "46 13.83558563259328 13.835585710950633 True\n",
"47 13.62486532009778 13.624865495900362 True\n", "47 13.624865387961071 13.624865495900362 True\n",
"48 13.563687816555877 13.563687894147451 True\n", "48 13.563687752011024 13.563687894147451 True\n",
"49 13.460526421153721 13.460526516149844 True\n", "49 13.460526440932282 13.460526516149844 True\n",
"50 13.326401453571647 13.326401584245959 True\n", "50 13.326401487117039 13.326401584245959 True\n",
"51 13.14619146899115 13.146191590631155 True\n", "51 13.14619144473399 13.146191590631155 True\n",
"52 13.051097817979066 13.051097914633186 True\n", "52 13.051097855165194 13.051097914633186 True\n",
"53 12.899368982935457 12.899369115930666 True\n", "53 12.899368765789468 12.899369115930666 True\n",
"54 12.786273094003551 12.78627322934749 True\n", "54 12.786273128878118 12.78627322934749 True\n",
"55 12.603896283530736 12.603896521149265 True\n", "55 12.603896159471114 12.603896521149265 True\n",
"56 12.24459478219181 12.244595016075253 True\n", "56 12.24459483854504 12.244595016075253 True\n",
"57 12.081890737764127 12.081891139298037 True\n", "57 12.081890935959327 12.081891139298037 True\n",
"58 11.963153012825172 11.963153577378659 True\n", "58 11.963153181957699 11.963153577378659 True\n",
"59 11.86698737983579 11.866987626205537 True\n", "59 11.866987366543476 11.866987626205537 True\n",
"60 11.846454128079248 11.846454543383365 True\n", "60 11.846454254251205 11.846454543383365 True\n",
"61 11.632708232573489 11.632708740365016 True\n", "61 11.632708311651522 11.632708740365016 True\n",
"62 11.47973676293262 11.479737381101435 True\n", "62 11.479736946355013 11.479737381101435 True\n",
"63 11.310523431410934 11.31052387809046 True\n", "63 11.310523346901332 11.31052387809046 True\n",
"64 11.245673669093398 11.245674002000872 True\n", "64 11.245673502803884 11.245674002000872 True\n",
"65 11.191724799146208 11.191725592009057 True\n", "65 11.191724972430812 11.191725592009057 True\n",
"66 11.064180295091159 11.064180657871876 True\n", "66 11.06418031206743 11.064180657871876 True\n",
"67 11.01312035030076 11.013120873574962 True\n", "67 11.013120501498017 11.013120873574962 True\n",
"68 10.848097950650242 10.848098659000257 True\n", "68 10.848098097271997 10.848098659000257 True\n",
"69 10.640878198499426 10.64087901321515 True\n", "69 10.640878120553019 10.64087901321515 True\n",
"70 10.481023956640286 10.481025165464422 True\n", "70 10.481024113889113 10.481025165464422 True\n",
"71 10.419250256408837 10.419250979085225 True\n", "71 10.41925024930544 10.419250979085225 True\n",
"72 10.39575358488571 10.395755708029727 True\n", "72 10.39575421180511 10.395755708029727 True\n",
"73 10.290910825430666 10.290911928292331 True\n", "73 10.29091041568209 10.290911928292331 True\n",
"74 10.112868234883017 10.112869297815083 True\n", "74 10.112867809320235 10.112869297815083 True\n",
"75 10.092282614025011 10.092283618317 True\n", "75 10.092281343703961 10.092283618317 True\n",
"76 9.974746344036888 9.9747482072759 True\n", "76 9.974747475344698 9.9747482072759 True\n",
"77 9.874670678577123 9.87467271023612 True\n", "77 9.87467145378299 9.87467271023612 True\n",
"78 9.691867206272638 9.691868983455695 True\n", "78 9.69186747462841 9.691868983455695 True\n",
"79 9.666575422820127 9.666577199908287 True\n", "79 9.66657482189091 9.666577199908287 True\n",
"80 9.546056437289687 9.54606137821152 True\n", "80 9.546059172168109 9.54606137821152 True\n",
"81 9.36450734324066 9.364509197321494 True\n", "81 9.36450680643162 9.364509197321494 True\n",
"82 9.292626734073629 9.292629871191895 True\n", "82 9.292628642832971 9.292629871191895 True\n",
"83 9.137652889219025 9.137655692229586 True\n", "83 9.13765341015983 9.137655692229586 True\n",
"84 9.086305330546848 9.086307826132957 True\n", "84 9.0863064234283 9.086307826132957 True\n",
"85 8.987992793030617 8.987997457307765 True\n", "85 8.987994846211759 8.987997457307765 True\n",
"86 8.968533538954633 8.968537825712612 True\n", "86 8.968534574665208 8.968537825712612 True\n",
"87 8.82198802768483 8.821990136961672 True\n", "87 8.821983249255675 8.821990136961672 True\n",
"88 8.796003139844219 8.796006916396774 True\n", "88 8.796002784577556 8.796006916396774 True\n",
"89 8.78928731962543 8.78929631636091 True\n", "89 8.789293855760258 8.78929631636091 True\n",
"90 8.642528452336498 8.642533211490786 True\n", "90 8.642509581189325 8.642533211490786 True\n",
"91 8.635533406222772 8.635538142898882 True\n", "91 8.635532886542821 8.635538142898882 True\n",
"92 8.581657825440374 8.581667073055607 True\n", "92 8.581662333622281 8.581667073055607 True\n",
"93 8.500767414797899 8.500774258627553 True\n", "93 8.500769511135836 8.500774258627553 True\n",
"94 8.439213481791196 8.439219025715683 True\n", "94 8.43920846720157 8.439219025715683 True\n",
"95 8.417954502629687 8.417963233975339 True\n", "95 8.41795852398197 8.417963233975339 True\n",
"96 8.366150944565332 8.36616379640356 True\n", "96 8.366157089987354 8.36616379640356 True\n",
"97 8.30902725914819 8.309044591957754 True\n", "97 8.309037343499016 8.309044591957754 True\n",
"98 8.234769901609708 8.234777067900914 True\n", "98 8.234769419656203 8.234777067900914 True\n",
"99 8.213934700224106 8.213940050434301 True\n", "99 8.213930635756908 8.213940050434301 True\n",
"100 8.18882047362826 8.188828352008155 True\n", "100 8.188820553641209 8.188828352008155 True\n",
"101 8.086766617834444 8.086782081203387 True\n", "101 8.086768206663423 8.086782081203387 True\n",
"102 8.056501992951606 8.056512862531214 True\n", "102 8.056503601722161 8.056512862531214 True\n",
"103 7.994904953368551 7.994910349902213 True\n", "103 7.994898308345787 7.994910349902213 True\n",
"104 7.868361262390078 7.868376794373796 True\n", "104 7.868365085763679 7.868376794373796 True\n",
"105 7.836414910556654 7.836431569473695 True\n", "105 7.83642278985161 7.836431569473695 True\n",
"106 7.759916851863615 7.759923877695468 True\n", "106 7.7599123471416345 7.759923877695468 True\n",
"107 7.733012717870695 7.733030155785209 True\n", "107 7.733005702420836 7.733030155785209 True\n",
"108 7.685906971899503 7.685918284682891 True\n", "108 7.685904588971587 7.685918284682891 True\n",
"109 7.629137778803163 7.629154897298439 True\n", "109 7.629144043626104 7.629154897298439 True\n",
"110 7.551124777035608 7.551138943943203 True\n", "110 7.551106655067341 7.551138943943203 True\n",
"111 7.51952447145205 7.519541907576092 True\n", "111 7.519525915815485 7.519541907576092 True\n",
"112 7.47464883393366 7.474670931289876 True\n", "112 7.474655935961377 7.474670931289876 True\n",
"113 7.430562575660156 7.430578314816374 True\n", "113 7.430556921032008 7.430578314816374 True\n",
"114 7.420863915594336 7.420893232568204 True\n", "114 7.420872899841925 7.420893232568204 True\n",
"115 7.323596819308681 7.323629977455387 True\n", "115 7.323606843370866 7.323629977455387 True\n",
"116 7.299937858729446 7.299963520256556 True\n", "116 7.299935352793829 7.299963520256556 True\n",
"117 7.245923788631047 7.245941553580699 True\n", "117 7.245920605434483 7.245941553580699 True\n",
"118 7.179930730684895 7.179975894897942 True\n", "118 7.1799601120084375 7.179975894897942 True\n",
"119 7.16743838901172 7.1674679131011105 True\n", "119 7.1674531347215416 7.1674679131011105 True\n",
"120 7.145565706927993 7.1455989201764005 True\n", "120 7.145544948396368 7.1455989201764005 True\n",
"121 7.01036880634433 7.010412620837399 True\n", "121 7.010367098172533 7.010412620837399 True\n",
"122 6.995386024954567 6.995409963521163 True\n", "122 6.995382073419483 6.995409963521163 True\n",
"123 6.977328845675479 6.977377264978789 True\n", "123 6.977332592982995 6.977377264978789 True\n",
"124 6.936881610097396 6.936930212840086 True\n", "124 6.936902630887171 6.936930212840086 True\n",
"125 6.89328673733997 6.893329278977496 True\n", "125 6.893288310704246 6.893329278977496 True\n",
"126 6.817939354483354 6.81796767643536 True\n", "126 6.817889335651047 6.81796767643536 False\n",
"127 6.795993194345026 6.796037309695072 True\n", "127 6.796001925946704 6.796037309695072 True\n",
"128 6.761770032418167 6.761807475787397 True\n", "128 6.761767955011231 6.761807475787397 True\n",
"129 6.73680467776714 6.736865073662728 True\n", "129 6.736819353601687 6.736865073662728 True\n",
"130 6.6585197447038755 6.658548664699633 True\n", "130 6.658488662894567 6.658548664699633 True\n",
"131 6.634823192577358 6.634864128904676 True\n", "131 6.634803689885012 6.634864128904676 True\n",
"132 6.622106937168293 6.622165487790968 True\n", "132 6.6221360687019475 6.622165487790968 True\n",
"133 6.555629792548903 6.5556849471717635 True\n", "133 6.555623950532734 6.5556849471717635 True\n",
"134 6.469187643453936 6.46926267659238 False\n", "134 6.469206992381582 6.46926267659238 True\n",
"135 6.449964704221819 6.450021258899795 True\n", "135 6.449928692209615 6.450021258899795 False\n",
"136 6.384855020428419 6.384946629268907 False\n", "136 6.38483341115079 6.384946629268907 False\n",
"137 6.357787760327908 6.357839661801575 True\n", "137 6.35774361745446 6.357839661801575 False\n",
"138 6.287932629109054 6.288070534072515 False\n", "138 6.287982395682518 6.288070534072515 False\n",
"139 6.270833116963148 6.270892776188856 True\n", "139 6.270768244677501 6.270892776188856 False\n",
"140 6.22648714198718 6.226636984486413 False\n", "140 6.22650096165163 6.226636984486413 False\n",
"141 6.216162261488712 6.216231810200055 False\n", "141 6.216151975473096 6.216231810200055 False\n",
"142 6.187210007738721 6.187338196525775 False\n", "142 6.187259584463441 6.187338196525775 False\n",
"143 6.185354089488428 6.1854258850753965 False\n", "143 6.185338045167987 6.1854258850753965 False\n",
"144 6.136678408091446 6.136764407409564 False\n", "144 6.136567673664515 6.136764407409564 False\n",
"145 6.127296152114972 6.127437734129397 False\n", "145 6.127315766644174 6.127437734129397 False\n",
"146 6.0526602594631544 6.05279358443227 False\n", "146 6.05273666512158 6.05279358443227 True\n",
"147 6.039404245099761 6.039548117002396 False\n", "147 6.039410403770248 6.039548117002396 False\n",
"148 6.013760254853822 6.013831133557258 False\n", "148 6.013691035706532 6.013831133557258 False\n",
"149 5.972739611264569 5.972849844024313 False\n", "149 5.972734009761526 5.972849844024313 False\n",
"150 5.954590432389776 5.954698413616891 False\n", "150 5.954522317302211 5.954698413616891 False\n",
"151 5.93644085643444 5.9365735078135256 False\n", "151 5.936406896853184 5.9365735078135256 False\n",
"152 5.895557774522765 5.895778124931551 False\n", "152 5.895607907808495 5.895778124931551 False\n",
"153 5.872938233743961 5.8731909865733085 False\n", "153 5.873070381206518 5.8731909865733085 False\n",
"154 5.864127736940418 5.864232210225334 False\n", "154 5.8640623983250775 5.864232210225334 False\n",
"155 5.843940073986173 5.844049679072953 False\n", "155 5.843856448293965 5.844049679072953 False\n",
"156 5.80956953038909 5.809780820076843 False\n", "156 5.8097013795852295 5.809780820076843 False\n",
"157 5.742411999974989 5.7425805794035565 False\n", "157 5.742296830110277 5.7425805794035565 False\n",
"158 5.727840106342784 5.728003297472801 False\n", "158 5.727787717181513 5.728003297472801 False\n",
"159 5.704138799486538 5.704229513376295 False\n", "159 5.703990992274023 5.704229513376295 False\n",
"160 5.671326562996116 5.671594306515941 False\n", "160 5.671362420190118 5.671594306515941 False\n",
"161 5.661229319791581 5.661401888244609 False\n", "161 5.661255716214835 5.661401888244609 False\n",
"162 5.6312328092888455 5.631469865505804 False\n", "162 5.6312527619526245 5.631469865505804 False\n",
"163 5.623501378848894 5.623792961078581 False\n", "163 5.623422380613316 5.623792961078581 False\n",
"164 5.594535861778121 5.594737412450218 False\n", "164 5.594453727997291 5.594737412450218 False\n",
"165 5.567319752743344 5.5675334261408285 False\n", "165 5.567116546644625 5.5675334261408285 False\n",
"166 5.561357944207198 5.561556437477851 False\n", "166 5.5613457444883 5.561556437477851 False\n",
"167 5.534827123698119 5.535040085666817 False\n", "167 5.534897720152284 5.535040085666817 False\n",
"168 5.475944008711171 5.476286286775192 False\n", "168 5.475966874201733 5.476286286775192 False\n",
"169 5.447181930906447 5.447534093630126 False\n", "169 5.447235689226016 5.447534093630126 False\n",
"170 5.393653520645915 5.393844339164585 False\n", "170 5.393519359109608 5.393844339164585 False\n",
"171 5.373700887703489 5.373989813339329 False\n", "171 5.373675532377189 5.373989813339329 False\n",
"172 5.346287186702591 5.346733706096892 False\n", "172 5.346478555969167 5.346733706096892 False\n",
"173 5.302403918974314 5.302961970886246 False\n", "173 5.302651525953609 5.302961970886246 False\n",
"174 5.2816996503122295 5.282220163011061 False\n", "174 5.2819205501573965 5.282220163011061 False\n",
"175 5.24111025917357 5.241595833100238 False\n", "175 5.24127655369534 5.241595833100238 False\n",
"176 5.230961513009 5.231267023137635 False\n", "176 5.230803288017326 5.231267023137635 False\n",
"177 5.183291888027453 5.183916390702387 False\n", "177 5.183632367296181 5.183916390702387 False\n",
"178 5.1665825947188155 5.167166958515638 False\n", "178 5.166648510423473 5.167166958515638 False\n",
"179 5.154669516616122 5.1551360959126775 False\n", "179 5.154646503690222 5.1551360959126775 False\n",
"180 5.13864577472713 5.13918870469448 False\n", "180 5.138439028899184 5.13918870469448 False\n",
"181 5.10682389412179 5.107752319927996 False\n", "181 5.106881158102181 5.107752319927996 False\n",
"182 5.0949201338583485 5.095543723552137 False\n", "182 5.095150989102234 5.095543723552137 False\n",
"183 5.084528543854696 5.084799390822841 False\n", "183 5.0843349975042 5.084799390822841 False\n",
"184 5.0317973208337285 5.032430170526123 False\n", "184 5.031914889931756 5.032430170526123 False\n",
"185 5.007215494867228 5.007867368543465 False\n", "185 5.007488784158766 5.007867368543465 False\n",
"186 4.995309743889807 4.995957911562522 False\n", "186 4.995114941240579 4.995957911562522 False\n",
"187 4.959332675442447 4.959835242745164 False\n", "187 4.959417125654179 4.959835242745164 False\n",
"188 4.913029814256754 4.913924957034896 False\n", "188 4.91330167323612 4.913924957034896 False\n",
"189 4.892585635944614 4.893604705378042 False\n", "189 4.892816966829473 4.893604705378042 False\n",
"190 4.87942427691294 4.88011350912293 False\n", "190 4.879048473115278 4.88011350912293 False\n",
"191 4.869225989664856 4.869763713624773 False\n", "191 4.869158078724695 4.869763713624773 False\n",
"192 4.851602766339177 4.852059636952089 False\n", "192 4.8512333191850825 4.852059636952089 False\n",
"193 4.818271130854635 4.819338237603759 False\n", "193 4.818542759580067 4.819338237603759 False\n",
"194 4.814107272395931 4.815437721168763 False\n", "194 4.81500775271639 4.815437721168763 False\n",
"195 4.777169968843174 4.778055691333868 False\n", "195 4.777467038079834 4.778055691333868 False\n",
"196 4.7368200933695315 4.7377481581488885 False\n", "196 4.737211711619157 4.7377481581488885 False\n",
"197 4.7145680256576545 4.715121691594005 False\n", "197 4.714443031239303 4.715121691594005 False\n",
"198 4.6964624559720605 4.697598538355146 False\n", "198 4.696108711086335 4.697598538355146 False\n",
"199 4.647784285153062 4.648902453761702 False\n", "199 4.648067019849262 4.648902453761702 False\n",
"200 4.616205217590328 4.618461117930671 False\n", "200 4.617134059910867 4.618461117930671 False\n",
"201 4.603546342046109 4.60454143897401 False\n", "201 4.602613337976195 4.60454143897401 False\n",
"202 4.578404095564949 4.58018135141145 False\n", "202 4.578411884399181 4.58018135141145 False\n",
"203 4.546653228618853 4.547927218193237 False\n", "203 4.545841939066675 4.547927218193237 False\n",
"204 4.49642380629184 4.498256762688885 False\n", "204 4.496816491472595 4.498256762688885 False\n",
"205 4.4842744967122865 4.48508866138501 False\n", "205 4.483375051577317 4.48508866138501 False\n",
"206 4.456866633535383 4.4587117010898245 False\n", "206 4.456410997143484 4.4587117010898245 False\n",
"207 4.441378341345862 4.443110107204811 False\n", "207 4.440156409822983 4.443110107204811 False\n",
"208 4.381956171910071 4.385869421654407 False\n", "208 4.382812007539389 4.385869421654407 False\n",
"209 4.367757357717589 4.369089343028882 False\n", "209 4.367372840888642 4.369089343028882 False\n",
"210 4.3392449635811845 4.340542813553938 False\n", "210 4.338778043423859 4.340542813553938 False\n",
"211 4.296042946430803 4.297981414076213 False\n", "211 4.295480987058756 4.297981414076213 False\n",
"212 4.2915688976359565 4.2940109822279595 False\n", "212 4.292417574019701 4.2940109822279595 False\n",
"213 4.281601078302176 4.283240227670502 False\n", "213 4.281715126469481 4.283240227670502 False\n",
"214 4.274873751959374 4.276701492270051 False\n", "214 4.2750725278843476 4.276701492270051 False\n",
"215 4.254451707750888 4.2576081807984725 False\n", "215 4.255768326282822 4.2576081807984725 False\n",
"216 4.232739592238667 4.235215861986921 False\n", "216 4.23305570376171 4.235215861986921 False\n",
"217 4.227414726772738 4.229951380920869 False\n", "217 4.228550107154597 4.229951380920869 False\n",
"218 4.213820734933847 4.217342404059044 False\n", "218 4.214917706313943 4.217342404059044 False\n",
"219 4.2120032048894265 4.214087138293985 False\n", "219 4.212277311260583 4.214087138293985 False\n",
"220 4.2022250973163064 4.203888873116322 False\n", "220 4.200125181708883 4.203888873116322 False\n",
"221 4.186936733932766 4.1900256026039395 False\n", "221 4.1884782071166295 4.1900256026039395 False\n",
"222 4.176031144085105 4.178338501226308 False\n", "222 4.176247511976992 4.178338501226308 False\n",
"223 4.1519061825887285 4.153214751140703 False\n", "223 4.149564217806229 4.153214751140703 False\n",
"224 4.1337325533036084 4.13707545108394 False\n", "224 4.1348085841618385 4.13707545108394 False\n",
"225 4.132643342231077 4.13485133185874 False\n", "225 4.131645840135839 4.13485133185874 False\n",
"226 4.1259920393816865 4.128018816389408 False\n", "226 4.123958335692545 4.128018816389408 False\n",
"227 4.113506102935065 4.115909017995836 False\n", "227 4.111705145415796 4.115909017995836 False\n",
"228 4.099098235930706 4.1014889925978535 False\n", "228 4.097767117027009 4.1014889925978535 False\n",
"229 4.089196996158331 4.093103694196744 False\n", "229 4.088137241892387 4.093103694196744 False\n",
"230 4.067704842364876 4.071473280002942 False\n", "230 4.070317477000433 4.071473280002942 False\n",
"231 4.049264891253607 4.0525298074424425 False\n", "231 4.049365418515412 4.0525298074424425 False\n",
"232 4.036409873661451 4.038930156020619 False\n", "232 4.032726885360853 4.038930156020619 False\n",
"233 4.016661178837895 4.023541213720316 False\n", "233 4.01721835675212 4.023541213720316 False\n",
"234 4.005879913800353 4.010089303241536 False\n", "234 4.007080399681326 4.010089303241536 False\n",
"235 3.9795821857197233 3.982581464130896 False\n", "235 3.98054486428575 3.982581464130896 False\n",
"236 3.970812230152063 3.979808995018844 False\n", "236 3.9748661026626073 3.979808995018844 False\n",
"237 3.9490826978552525 3.957390684000785 False\n", "237 3.9543161557617252 3.957390684000785 False\n",
"238 3.9036729427789423 3.908248032864678 False\n", "238 3.905344733644587 3.908248032864678 False\n",
"239 3.8982113434568286 3.9019974355018743 False\n", "239 3.899358397680305 3.9019974355018743 False\n",
"240 3.879352215416703 3.884067664543178 False\n", "240 3.8810992248222815 3.884067664543178 False\n",
"241 3.8610928551269192 3.8697909783397386 False\n", "241 3.865616239150962 3.8697909783397386 False\n",
"242 3.8363273260355673 3.8386062395652254 False\n", "242 3.8354587052455447 3.8386062395652254 False\n",
"243 3.8315690929245996 3.837673964215226 False\n", "243 3.8324196626110987 3.837673964215226 False\n",
"244 3.815415204819316 3.822185661055782 False\n", "244 3.8179250035042243 3.822185661055782 False\n",
"245 3.801078950366636 3.807433943896055 False\n", "245 3.802594167096563 3.807433943896055 False\n",
"246 3.791171624218988 3.7969130819332775 False\n", "246 3.791128232001944 3.7969130819332775 False\n",
"247 3.7647438181001824 3.7711552432125575 False\n", "247 3.7667071720056664 3.7711552432125575 False\n",
"248 3.754563703193374 3.759990416757248 False\n", "248 3.757485393281104 3.759990416757248 False\n",
"249 3.7342344824303906 3.7391928266703394 False\n" "249 3.733598431803078 3.7391928266703394 False\n"
] ]
} }
], ],
...@@ -2007,6 +2008,46 @@ ...@@ -2007,6 +2008,46 @@
"for i in range(rank_svd):\n", "for i in range(rank_svd):\n",
" print(i, model_lsi.projection.s[i], s_trunced[i], np.allclose(model_lsi.projection.s[i], s_trunced[i]))" " print(i, model_lsi.projection.s[i], s_trunced[i], np.allclose(model_lsi.projection.s[i], s_trunced[i]))"
] ]
},
{
"cell_type": "code",
"execution_count": 57,
"metadata": {},
"outputs": [],
"source": [
"import anvil.server"
]
},
{
"cell_type": "code",
"execution_count": 58,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Connecting to wss://anvil.works/uplink\n",
"Anvil websocket open\n",
"Authenticated OK\n"
]
}
],
"source": [
"anvil.server.connect('KFA7RH76TGDGT2MTT75HY3AJ-SKCOH5Z2H6TTPDM6')"
]
},
{
"cell_type": "code",
"execution_count": 59,
"metadata": {},
"outputs": [],
"source": [
"@anvil.server.callable\n",
"def tfidfProductSearch(str):\n",
" data = search(index_tfidf, str) \n",
" return data"
]
} }
], ],
"metadata": { "metadata": {
......
Proyek STBI GG15 - Product Search Using TFIDF
UI untuk Program Python dikembangkan dalam bentuk website menggunakan Anvil
Link website: https://ppstbi15.anvil.app/
Step untuk menggunakan program python di website:
1. Jalankan Program Python di Jupyter Notebook dengan requirement penginstalan anvil uplink
"pip install anvil-uplink"
2. Akses website menggunakan link di atas
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment