NLP2011ã«åå ãã¦ãã¾ãã
ãããä¸ã¶æ以ä¸ãåã®è©±ã«ãªãã¾ããã2011å¹´ã®è¨èªå¦çå¦ä¼å¹´æ¬¡å¤§ä¼ã§ãããªæ¼¢åå¤æã«ã¤ãã¦çºè¡¨ããã¦ãã¾ããã
ãæ¥æ¬èªå
¥åã«ã¤ãã¦ã®ãã¼ãã»ãã·ã§ã³ãç¨æããã¦ããã¨ãããã¨ã§ãçºè¡¨ç³ãè¾¼ã¿ãããããã©ããè¿·ã£ãæå¥ãä»äºãå¿ãããããããããã®ã§ããããååæ¥ã«G社ã®æ¹ãããææ¥ããåãªã®ã§ãããããçãªã¡ã¼ã«ãæ¥ã¦ããããªã«ç³ãè¾¼ã¿ãå°ãªããªãåºããâ¦ã¨ãããã¨ã§çºè¡¨ãã¦ãã¾ãããèãéãã¦ã¿ãã2ã»ãã·ã§ã³åã®çºè¡¨ããã£ã¦å²ã¨å¤§äººæ°ã ã£ã訳ã§ããããããªæ©ä¼ããªãã¨ãªããªãä¼ããªããããªäººã«ããããä¼ããã®ã§ãçµæçã«ã¯è¡ã£ã¦ãã¦è¯ãã£ãã§ãã
ãçºè¡¨ã«é¢ãã¦ã¯ä¼ç¤¾ããã°ã®æ¹ã«æ¢ã«資料を上げたã®ã§ããã¡ãã§ã¯å®è£
ã®ç´°ããã¨ããã®è©±ãã¡ãã£ã¨æ¸ãã¦ã¿ããã¨æãã¾ãã
ãè³æã«ãæ¸ãã¾ããããæ§é åSVMãFOBOSã§æé©åããå ´åã
- æ£è§£ãã¹ã¸ã¯ããã«ãã£ãä¸ãã¤ã¤ç¾å¨ã®ãã©ã¡ã¼ã¿ã¼ã§å¤æãã¦ã¿ã
- å¤æã§ãããä½ãããªããå¤æã§ããªãã£ãããã©ã¡ã¼ã¿ã¼ãæ´æ°ãã
ãã¨ããæé ã«ãªãã¾ããå¦ç¿ã®é度ã®ãã¨ãèããã¨ãå®éã«å¤æãã¦ã¿ãã¨ããã¨ãããããã«ããã¯ã§ãã¤ã¾ããç§éã«ä½æãããå¤æã§ããããã¨ããã®ãé常ã«éè¦ãªæ°åã«ãªã£ã¦ãã¾ããçµè«ããæ¸ãã¨ãä»åã®å®è£
ã§ã¯ããããé å¼µããããããã§ã850æ/secãããã®é度ã§å¤æã§ããããã«ãªãã¾ãããSandy Bridgeãªã1000æ/secãããã¯ãããã¨æãã¾ãã京大ã³ã¼ãã¹ã«ã¯çµæ§é·ãæãå«ã¾ãã¦ãã¾ããããããã¯ãªããªãã®é度ã ã¨èãã¦ãã¾ãã
ãå¤æã®éã«ã¯ãã¿ãã¢ã«ã´ãªãºã ã使ããã¨ã«ãªãã¾ããããã®ä¸ã§ããã¤ã°ã©ã ã³ã¹ããæ±ãã¦ããã¨ãããè¨ç®éçã«ã¯ä¸çªéãã¨ããã§ãããããã¡ã¤ã«ãã¨ã£ã¦ã¿ãã¨ä¸çºã§ããã«ããã¯ãªã®ãããããããã§ãã ããã8å²ä»¥ä¸ã®æéãããã«è²»ãããã¾ããä»åã¯åèªãã¤ã°ã©ã ç´ æ§ã使ã£ãã®ã§ãç¹ã«åé¡ã§ããã
ããã¤ã°ã©ã ã³ã¹ããæ±ããã¨ã¯è¨ããã®ã®ãå®éã«ã¯ãªã«ããã®å ´ã§è¨ç®ããã訳ã§ã¯ãªãããã¼ã¿æ§é ã«çªã£è¾¼ãã§ãããã³ã¹ãã®å¤ãåã£ã¦ããã ããªã®ã§ãåé¡ã¨ãã¦ã¯ã©ããããã¼ã¿æ§é ãéãã®ããã¨ãããã®ã«ãªãã¾ãã
ãåèªãã¤ã°ã©ã ãç´ æ§ã¨ãã¦ä½¿ãå ´åããã¤ã°ã©ã ã®æç¹ã§æ¢ã«ç´ æ§ç©ºéãåºããªããããã®ã§ãäºæ¬¡å
ã®é
åã§æã¤ã¨ããã®ã¯ç¾å®çã§ã¯ããã¾ããããããæè¿ã®ãã¤ã¹ããã¯ãã·ã³ã ã¨çµæ§ç¾å®çã ã£ãããã¾ãããä»åã¯ããã¾ã§ã¡ã¢ãªã潤沢ã«ã¯ä½¿ãã¾ããã§ããã
ããããªãã¨ãæ®ãã®é¸æè¢ã¨ãã¦ã¯ãããã·ã¥ãã¼ãã«ã«çªã£è¾¼ããããããã¯åçããã«ã¢ã¬ã¤ã«çªã£è¾¼ãããç§ã®æè¡åçã«ã¯ãã®2ã¤ã«çµããã¾ãã
ãåçããã«ã¢ã¬ã¤ã¯ãã°ã£ãã¨ãã«ãããã°ã大å¤ï¼éå»ã«ä½é¨ãã¦é常ã«è¾ããã¨ãããã¾ããâ¦ï¼ãªã®ã§ããåã¾ã§ã®ã¹ã±ã¸ã¥ã¼ã«ãã¿ã¤ããªä»åã¯ããã·ã¥ãã¼ãã«ã使ããã¨ã«ãã¾ããã
ãããã·ã¥ãã¼ãã«ã¯ãã¾ãã¯glibä»å±ã®g_hash_tableã使ã£ã¦ããã®ã§ãããããã¾ãéããªããæ¹é ãé¢åãªæãã ã£ãã®ã§ãä»ã®ãã®ãããã¤ãå½ãã£ã¦ã¿ããã¨ã«ãã¾ããã
ã次ã«ããã£ãã®ã¯C++ã®tr/unordred_mapã§ããããããã¯glibããé
ããè«å¤ã§ãããstringãããªãã¦char*ã使ãã°ããã£ãã®ããããã¾ããããããããã¨ã¡ã¢ãªç®¡çãã¾ãããã¶ãã¨é¢åã«ãªã£ã¦ãã¾ãã®ã§ããã以ä¸ã®æ¹è¯ã¯æ念ãã¾ããã
ã次ã«ãlibghthashã¨ããããã·ã¥ãã¼ãã«ã使ã£ã¦ã¿ã¾ãããããã¯ããã·ã¥é¢æ°ãåãæ¿ãããããã§ããããglibã¨éã£ã¦æ¹é ããããã£ãã®ã§ããã¡ãã使ããã¨ã«ãã¾ããã
ããããã試è¡é¯èª¤ãããã®ã§ãããæçµçã«ã¯ä»¥ä¸ã®ãããªæ¹é ãããlibghthashã使ã£ã¦ãã¾ãã
- ããã·ã¥é¢æ°ã¯one at a time hashããã¼ã¹ã«ãåã£ã¦ã大ä¸å¤«ãããªã¨ãããåã£ã¦ã¿ããªãªã¸ãã«ã®é©å½é¢æ°ãæ¡ç¨
- ããã·ã¥ãã¼ãã«ããå¤ãåãåºãã¨ããã¯ããã¹ã¦ã®é¢æ°ãããããã¡ã¤ã«ã«ç§»ãã¦ã¤ã³ã©ã¤ã³å
- ãã¼ãã«ã®ç©ºãé åãå¢ããã¦ãæ¢ç´¢å¤±æãé«éå
ãããã·ã¥é¢æ°ã¯FNVã¨ãmurmurããã·ã¥ã¨ã試ãã¦ã¿ã¾ããããæçµçã«ã¯é©å½ãªå¥´ãä¸çªæ©ããã¨ããçµæã«è½ã¡çãã¾ããããã¾ãã·ã³ãã«ãªããã·ã¥é¢æ°ã«ãéããã¨è¡çªç¢ºçãä¸ãã£ã¦å´ã£ã¦é
ããªãã¨ãã£ããã¬ã¼ããªããããèå³æ·±ãä½é¨ã§ããã
ãã¤ã³ã©ã¤ã³åã¯é常ã«éè¦ã§ãããã§20ã30%ãããã¯é度ã稼ãã¾ããäºéã«ã¼ãã®ä¸ã§å¼ã³åºãã®ã§ä»æ¹ãªãã§ãããæ½è±¡åã¨é«éåã¯æã«ä¸¡ç«ããªããã¨ããããæ®å¿µãªçµæã«ãªã£ã¦ãã¾ãã¾ããã
ããã®ä»ãããã·ã¥ãã¼ãã«ã2éã«ããã¨ãã£ãå®é¨ããã¦ã¿ã¾ãããããã¾ãè¯ãçµæãå¾ããã¾ããã§ããããã£ã¨ããããã«é¢ãã¦ã¯ãã¾ã追æ±ãã¦ããªãã®ã§ããããããããã¾ãé«éã§ããããããã¾ããã
ãã¾ããå§æ¯ãªé«éåã¨ãã¦ãIDãå°ããé¨åã«é¢ãã¦ã¯äºæ¬¡å
é
åã«å¤ãä¿åããã¨ãã工夫ãå
¥ããã¨ãããæ°ç¾MBã®ã¡ã¢ãªã¨å¼æã«ãããããé«éåãã§ãã¾ããã10%ãããã ã£ãããªï¼
ãè«æã«ã¯ããã£ã¨ãå¦ç¿æéã¯8å30ç§ç¨åº¦ã§ãã£ããã¨æ¸ãã¦ããã¾ããããã®å½±ã«ã¯ãã®ãããªè¦å´ããã£ãããã§ããããããå¦ç¿ã10åç¨åº¦ã§çµããã®ã§ããã°ãããããããã¾ã§ã·ãã¢ã«é«éåãè¡ãå¿
è¦ã¯ããã¾ãããç¹ã«æ¹è¯ãããã¨ããå½åã®ãã¤ã¼ããªå®è£
ã§ããããã30å以å
ãããã«å¦ç¿ã¯çµãã£ã¦ããã§ãããã
ãããã«ã¯ãã¾ã¬ããªäºæ
ãããã¾ããå®ã¯ããã°ã«ãã£ã¦å¤ææéããããé·ããªã£ã¦ããããã®æ¬è³ªã«æ°ã¥ããªãã£ãããã§ãããæå³ã§ã¯ç¡é§ãªåªåãé«éåã«ã¤ãè¾¼ãã§ããã®ã§ãããã¿ãã¢ã«ã´ãªãºã ã§ã¯ã´ã¼ã«ã¾ã§ãã©ãçãçµè·¯ãä¸ã¤ä»¥ä¸ã¯å¿
è¦ã§ããããã°ã©ãã®æ§ç¯æã«å
¥åæåãã®ã¾ã¾ã®ãã¼ãããªã³ã¶ãã©ã¤ã§è¿½å ãã¦ããã®ã§ãããé¢æ°å¼ã³åºãã®ãã©ã°ãééãã¦ãã¦ããã®ãªã³ã¶ãã©ã¤ã®ãã¼ããè¾æ¸ã«ã¾ã§è¿½å ãã¦ãã¾ã£ã¦ããã®ã§ããããããè¾æ¸ã¨ã³ããªã«éè¤ã許ããã¦ãããã®ã§ãããã²ãããªãè¾æ¸ã«å¤§éã«è¿½å ãããçµæã¨ãã¦è¾æ¸ã¾ããã®æä½ã³ã¹ããã¹ã¦ãæ¥ä¸æãã¦ããã®ã§ããããã®ãã°ã®å¹æã¯åçã§ãã³ã¼ãã¹ã«å¯¾ãã¦1åã®å¦ç¿ã«ã¼ããåãããã«3æ¥é以ä¸ã®æéãå¿
è¦ã§ãããå¤æçµæãã®ãã®ã«ã¯å½±é¿ãã§ãªãã®ã§ãã©ãã«ãã°ãããã®ãããããã¥ãããåä»ã§ããã
ããã®ä»ãå®è£
ã§ã¤ã¾ã¥ãããç´°ã
ã¨ç¹ãæãã¦ããã¾ãã
ãä»åã¯ãç´ æ§ãæ½è±¡åãã¦æ±ãããã£ãã®ã§ãããã·ã¥ãã¼ãã«ã®ãã¼ã¨ãã¦ã¯64bitã®æ´æ°ã使ããã¨ã«ãããã®ä¸ä½4bitãç´ æ§ã®ç¨®å¥ã¨ãã¦ä½¿ããæ®ãã®60bitãç´ æ§IDã¨ãã¦ä½¿ããã¨ã«ãã¾ãããããã¯æåã«å®è£
ããæ¹æ³ã¨ãã¦ã¯ããã¾ãè¯ãããæ¹ã§ã¯ããã¾ããã§ãããçµå±ããã®ç´ æ§ã®æ½è±¡åã®é¨åã§ã¯ãã°ã¯ãªãã£ãã®ã§ããããã¾ãåããªãã¨ãã«ã¯ãã®æ½è±¡åã®é¨åãçããããå¾ãããããæ£ããåãã¦ãããã¨ã確èªããã®ãé£ããã®ã§ãç¡é§ã«æéãåããã¦ãã¾ãã¾ãããå¾ç¥æµã§ãããã¾ãã¯ãã£ã¨åããããããç´ æ§ã¯åãããããæååã§è¡¨ç¾ãã¹ãã§ããããã¡ãã§æ£ããåããã¨ã確èªã§ãã¦ãããé«éåå®è£
ãä½ã£ãã»ãããçµæçã«ã¯æ©ãå®è£
ãçµããããããã§ãããã
ãã¾ããã¡ã¢ãªç®¡çãé常ã«é¢åã§ãããã°ã©ãæ§ç¯æã«ã²ãããªã®çµè·¯ã追å ãã¦ããããã§ããããã®ããã«è¾æ¸ãè¿ãã¡ã¢ãªé åãããªã¼ãã¦ã¯ãããªããã®ã¨ããªã¼ããªãã¨ãããªããã®ã®2種é¡ããããåççã«ã¯ãã®2ã¤ã¯ã³ã¼ããã¹ã§åºå¥ã§ãããã¾ãå¦çã§ããã¯ãã ã£ãã®ã§ãããããã«ãã¤ã³ã¿ãããªãã«ãã¤ã³ã¿ãä¹±èããããã«ãªãã¨èªåã®ç®¡çè½åãè¶
ãã¦ãã¾ãããã¾ãåãã¾ããã§ãããçµå±ãå¤ææã«ä¸æçã«ç¢ºä¿ããã¡ã¢ãªã¯å¤æçµäºå¾ã«ä¸æ°ã«éæ¾ã§ããããã«ãããã¡ã¯ã©ã¹ãä½ã£ã¦ãã¡ã¢ãªã¯ãã¡ãã§ç®¡çããããã«ããã®ã§ãããããã¯ããèãã¦ã¿ããã¡ã¢ãªãã¼ã«ãã®ãã®ã§ãèªåã§ä½ããã«aprã¨ã使ãã°ããã£ããªã¨ããããå¾ç¥æµã§æãã¾ããã
ãé«éåèªä½ã¯æ¥½ããä½æ¥ã§ã¯ããã¾ããããäºç¨¿æåºã®ä¸é±éåã¯ã¾ã ã¾ã¨ããªæ°åãåºãã¦ããªãã¨ããç¶æ
ã§ãæ£ç´ãªã¨ããæ°ãæ°ã§ã¯ããã¾ããã§ãããéã«åã£ã¦æ¬å½ã«è¯ãã£ãã