2023-07-01ãã1ã¶æéã®è¨äºä¸è¦§
ã¯ããã« ãããã¡ããããªãã¦ãæ©ããããèªçæ¥ããã§ã¨ããããã¾ãã ã¢ãã¡U149å ¨é¨è¦ã¾ããããã©ã¡ããããã£ã... nikkieã§ã ããã¾ã§VS Codeãé·ãã使ã£ã¦ãã¾ãã1ããæ¬æ¥è¡æãèµ°ãã¾ããã ç®æ¬¡ ã¯ããã« ç®æ¬¡ è¡ãããã«ã¯ã©ã¼ãã§å²ã¿ããâ¦
ã¯ããã« ä»ã¯ã¾ã ãåæ°ãèªä¿¡ãå ¨ç¶ã ããããããç²¾ä¸æ¯ãnikkieã§ãã Javaã®Mavenã£ã¦ãããããªãã§ããã 触ããã¨ããããã§ãããããªãã ãããããããªãã¦ã¤ã«ãã¤ãªããPythonã¨çµæ§éããã ããªãã¨æãã¦ãã¾ããã ãã®ãã³ãé¿ããã«å°ãåâ¦
ã¯ããã« ç¡æµç´ããªã¼ãã¼3å¨å¹´ nikkieã§ãã ããä¼ã¿ã®æ¥ã«ããã§ããªããã¨ããã¨è¿½æ±ããçµæãæè¿ã®ãä¼ã¿ã¯éçºå宿æãããã¾ãã ä»åã¯æ°ã«ãªã£ã¦ããæè¡ãBERT-CRFã触ãã¾ããã ç®æ¬¡ ã¯ããã« ç®æ¬¡ ãã£ã¨å¼ã£ããã£ã¦ããBERT-CRF ã大è¦æ¨¡â¦
ã¯ããã« ï¾ï¾ï¾ï¾ï½¸ï¾ï½°ãnikkieã§ãã æ¨æ¥ã®å°ãã¿ã®ï¼ã¾ããã®ï¼ç¶ç·¨ã§ãã uniqã³ãã³ãã便å©ãªãã¨ã«æ°ã¥ãã¾ããã ç®æ¬¡ ã¯ããã« ç®æ¬¡ åå & ããã ããã³ã¡ã³ã uniqã®ãªãã·ã§ã³ã使ã£ãsort | uniq sort | uniq -c sort | uniq -d sort | uniq -u uniqâ¦
ã¯ããã« ãã®å¿ è¦ã¯ãªããã nikkieã§ãã ä»ååãä¸ããã®ã¯å°ãã¿ã§ãã æè¿ç¥ã£ã¦ãããé©ãã¾ãã ç®æ¬¡ ã¯ããã« ç®æ¬¡ sortã®-uãªãã·ã§ã³ï¼ï¼ ããã¥ã¢ã«ç¢ºèª man uniq man sort sort | uniq ã¨ã®åºä¼ã çµããã« sortã®-uãªãã·ã§ã³ï¼ï¼ ããã¹ã¿ãªâ¦
ã¯ããã« ããªã·ã£ã¹ãã¤ã«ããnikkieã§ãã 以ååå ãããåå¼·æ³ã®åå¼·ä¼ãï¼ãªã³ã©ã¤ã³åå¼·ä¼ï¼ã®ã·ã¼ãºã³2ãããã¾ãã¦ãåå ãã¦ãã¾ããã ã¬ãã¼ãã綴ã£ã¦ããã¾ãã ç®æ¬¡ ã¯ããã« ç®æ¬¡ ãåå¼·æ³ã®åå¼·ä¼#2ã #YUMEMIxTORALAB ä¼èª¬ã®ã·ã¼ãºã³1 ä»åâ¦
ã¯ããã« æªæ¥ã§å¾ ã£ã¦ãã nikkieã§ã1ã ããæè¿ã¤ãã³ãã«ã¼ãã使ã£ã並è¡å¦çï¼asyncioï¼ãç´ æ¯ããã¾ããã ããã¯I/Oãã¦ã³ããªå¦çã«æå¹ã§ãã I/Oãã¦ã³ããªå¦çã«ã¯ãã«ãã¹ã¬ãããæå¹ã¨èãã®ã§ãå°ãã ãç´ æ¯ããã¾ããã ç®æ¬¡ ã¯ããã« ç®â¦
ã¯ããã« ã¿ããªãç®é»ã·ããã¸è¡ããã ãç¹å¥ä¸æ çãããã¿ã®å¤åãã観ããããï¼ nikkieã§ãã ããæ°æ¥Pythonã®éåæã¸ã§ãã¬ã¼ã¿ãé ã«å¼ã£ããã£ã¦ãã¾ãã é£ããããªæ¦å¿µã§ããããã¤ãã«ãã®æãæ¥ãããã¨è ¹ã決ãã¦ç´ æ¯ããã¾ããã â»èãéãâ¦
ã¯ããã« ä¸é ããã¿ãã1ãããããªã³ãããã³ä½ããã®ãã¸å°æ¬ãnikkieã§ãã ãã¾ã«ã¯æ®ããåãã綴ã£ã¦ããã¾ãã ç®æ¬¡ ã¯ããã« ç®æ¬¡ nikkie as 調çã¹ãã«é§ãåºãã¨ã³ã¸ã㢠æè¿ç¼ãã¦ã¾ã é¤å ã½ã¼ã»ã¼ã¸ æ¾ã£ã¦ãã調çã¯æ§ã«åã£ã¦ãããã çµâ¦
ã¯ããã« ãããããã©ããï¼1 nikkieã§ãã æ¯æ¥å¤ï¼ã£ã¦æãã§ãããä»æ¥ãå æ°ã«OpenAIã®APIãå©ãã¦ããããã¨æãã¾ãï¼ ä»åã¯ããããéãã®ã§ã並è¡å¦çã模索ãã¾ããã ç¾æç¹ã§ã®èãã®ããã¯ã¢ããç®çã®ã¨ã³ããªã§ãã ç®æ¬¡ ã¯ããã« ç®æ¬¡ ãã¼â¦
ã¯ããã« è´ æ²¢ãªåã ããã¨ã¯è¨ãããã¼ãï¼ nikkieã§ãã å®ç¿ã¨ãã¦ãããããµã¤ãã«SQLã¤ã³ã¸ã§ã¯ã·ã§ã³ãã¾ããã ããã§æ¹¯å©å©ã¨ééãã¦ã身ãå®ãã¾ãï¼ ç®æ¬¡ ã¯ããã« ç®æ¬¡ ããããµã¤ãBad Todo List è±ç·ï¼æ¹¯å©å©ã¨SQLã¤ã³ã¸ã§ã¯ã·ã§ã³ã£ã¦ãªãã®â¦
ã¯ããã« ä¸å°çµ¶å½ãnikkieã§ãã ãã«ããè¦çµãã¾ããï¼æ²çµµã¡ããããããï¼ scikit-learnã®å®è£ ãçºãã¦ãã¦ããå種è©ä¾¡ææ¨ãä¸çºã§åºããé¢æ°ãããããï¼ãã¨æ°ä»ãã¾ããã ãã®æåãå ±æãã¦ããã¾ãã ç®æ¬¡ ã¯ããã« ç®æ¬¡ sklearn.metrics.preciâ¦
ã¯ããã« PrayForKyoaniãnikkieã§ãã ä¹ ãã¶ãã®ãããã¹ãPythonãèªæ¸ãã°ã å°æ¥ã®éçºè ã«æå³ãä¼ããPythonã®æ¸ãæ¹ãæåãããï¼è°è«ã®ããã®ï¼æ¬ã§ãã Pydanticã®é¢ä¿1ã§14ç« ãèªã¿ã¾ããã ç®æ¬¡ ã¯ããã« ç®æ¬¡ ååã®ãããã¹ãPythonãï¼ 14ç« â¦
ã¯ãã㫠解ãããã®ããï¼è§£ãããªãã®ããï¼ã©ã£ã¡ãªãã ãï¼ nikkieã§ãã Twitterã®ã¿ã¤ã ã©ã¤ã³ã§è¦ãããè«æç´¹ä»ããèå³ãæã¡ãè«æãå°ã追ã£ã¦ã¿ã¾ããã è¨äºã«ãã¦ãã»ã¼ããã¤ã³ããä½ãã¾ã ç®æ¬¡ ã¯ããã« ç®æ¬¡ Is Information Extraction Soâ¦
ã¯ããã« å¤æ´ããããã³ã¼ããæ¸ããªãã®ã«ã½ããã¦ã§ã¢éçºã¨ãèãã¦ããã®ã§ãã 天使æ§1ããããªããããnikkieã§ã ããããããã¨æè¡æ¸ã夢ã®åä½ãæããããã¡ãããã¤æ¬ï¼ãã¡ãããã¤ã½ããã¦ã§ã¢è¨è¨å ¥éãï¼ï¼ èªæ¸ä¼ã¨çµ¡ãã¦èªã¿é²ãã¦ãããâ¦
ã¯ããã« ããä½ãæããªãã nikkieã§ã FastAPIãLangChainã¨ãã£ãã©ã¤ãã©ãªãä¾åãã¦ãããã¨ã§ããªãã¿Pydanticï¼ ç´2é±éåã6æã®çµããã«v1.10.xããv2ã¸ã¨ã¡ã¸ã£ã¼ãã¼ã¸ã§ã³ã¢ãããã¾ããã ç ´å£çå¤æ´1ãããã¾ã ã§ãããä»ã®ã©ã¤ãã©ãªã®ã¡â¦
ã¯ããã« ãããã£ãããããããããã£ï¼ï¼ï¼ï¼ï¼ nikkieã§ãã æããããå°å¥³ã§ããªãã¿ããã¤ã¹ã®æ¥ã«ã¿ããªã®Pythonåå¼·ä¼ãããã¾ããã ãã¤ãã®ããã«ã¹ã¿ããåå ãã¦ãããåå¼·ä¼ã®ã¬ãã¼ãã綴ãã¾ãã ç®æ¬¡ ã¯ããã« ç®æ¬¡ åå¼·ä¼ã®æ¦è¦ ãPythonâ¦
ã¯ãã㫠夢è¦ã¦ãã nikkieã§ãã æè¿LangChainã«å·å¿ã§ãããä»åã¯ããããªãã¨ããµã¯ãã¨ã§ãã¡ããã®ï¼ï¼ãã¨ããå人çããã°ãã¥ã¼ã¹ãã¢ã¦ãããããã¾ã ç®æ¬¡ ã¯ããã« ç®æ¬¡ YouTubeã®æåèµ·ããããããªã«ç°¡åã«åå¾ã§ãã¡ããã®ï¼ï¼ ç´ æ¯ãï¼Lanâ¦
ã¯ããã« ãã£ãªã£ãã£ã® ã¢ã¼ã¤ãã«ã⪠ãã¤ã¹ãªstapyã§ããï¼ nikkieã§ãã æè¿è§¦ã£ã¦ããLangChainã触ããã³ã«ããã¯ãããã©ã¤ãã©ãªã ã¨å®æãã¾ãã å°ããç®æã§ãããlangchain.verbose = Trueã¨æå®ããã ãã§ãããã³ãããåºåãããä½ãèµ·ãã£â¦
ã¯ããã« 7æã¯ãã¤ã¹ãªstapyã§ããã¿ããªæ¥ã¦ãï¼ nikkieã§ãã æ©æ¢°å¦ç¿ã§ã¯ããªãã¿ã®ã©ã¤ãã©ãªscikit-learnã 親ã®é¡ãè¦ãåæ°ããã¤ã³ã¹ãã¼ã«ãã¦ãããã·ãããã¾ãã ãããªscikit-learnã®f1_scoreé¢æ°ã§è¦ããããã¨ã®ããwarningã«ã¤ãã¦ãæè¿â¦
ã¯ããã« ãã§ããç§ã¯å¤©æµ·æ¥é¦ã ãããã nikkieã§ãã LLMã»LangChainé¢ä¿ã®ç´ æ¯ãã§ãããä»åã¯èªåã®è¶£å³å好ã«æ¯ãåãã¾ãã æèãããã³ããã«å«ãã¦ãLLMããã¨ã¢ãã¡ã«ã¤ãã¦ãããã¹ãããããï¼ ç®æ¬¡ ã¯ããã« ç®æ¬¡ ãããããã¨ãæèãããã³â¦
ã¯ããã« 7æã¯ãã¤ã¹ãªstapyã§ããã¿ããªæ¥ã¦ãï¼ nikkieã§ãã StudyCoããã®åå¼·ä¼ã¢ã¼ã«ã¤ããæ©ã«ãLangChainã使ã£ã¦æèãããã³ããã«å«ãã¦LLMï¼ChatGPTï¼ã«åãåãããã³ã¼ããåããã¾ããã ãã®ç解ãæ·±ããã¹ãããæèãããã³ããã«å«ããâ¦
ã¯ããã« ã¢ããªã±ã¼ã·ã§ã³ã»ãã¹ãã£ã³ã°ï¼ nikkieã§ãã Command Line Interface Creation Kitãé æåãåã£ã¦Clickã ã³ãã³ãã©ã¤ã³ãã¼ã«ãå®è£ ã§ããã©ã¤ãã©ãªã®1ã¤ã§ãã Clickã®ããã¥ã¡ã³ãã®ä¸ã«ãã¹ãã®æ¸ãæ¹ãè¦ã¤ããæãåããã¦ã¿ã¾ãããâ¦
ã¯ããã« ã¢ã¤ãããããããã¼ã³ãããã§ã¨ãï¼ï¼ nikkieã§ãã ã¿ããªã¢ã¤ããè¦ã¦ãã¦å¬ããéã⪠sentence-transformersã¨ããPythonã®ã©ã¤ãã©ãªãããã¾ãã ããã¤ã§embeddingsï¼ããã¹ãã®åãè¾¼ã¿è¡¨ç¾ï¼ãè¨ç®ã§ããããããæ°ã«ãªã£ãã®ã§è§¦ã£ã¦ã¿â¦
ã¯ããã« æãã¤ãªãã nikkieã§ãã ã¢ã¤ãããã¿ããªã«è¦ããã¦ãã¦å¬ããéã⪠ã¡ãããã¤æ¬ï¼ãã¡ãããã¤ã½ããã¦ã§ã¢è¨è¨å ¥éãï¼ã§ããã±ã¼ã¸ååãç¥ã£ãã®ãæ©ã«ãClean Architectureãã«æã伸ã°ãã¦ã¿ã¦ãã¾ãã ä»åã¯çµåã«é¢ãã3ååç¯ã®èªæ¸â¦
ã¯ããã« ãã£ã¼ãã©ã¼ãã³ã°ã®ããããããããï¼ï¼ï¼ãããããã転è·ããã§ã¨ããããã¾ã1ï¼ nikkieã§ãã å æ¥ã¡ãããã¤æ¬ï¼ãã¡ãããã¤ã½ããã¦ã§ã¢è¨è¨å ¥éãï¼ç¬¬2ç« ã§6ã¤ã®ããã±ã¼ã¸ååãç¥ãã¾ããã æå±è Uncle Bobã®ãClean Architectureãâ¦
ã¯ããã« å¤æ´ããããã³ã¼ããæ¸ããªãã®ã«ã½ããã¦ã§ã¢éçºã¨ãèãã¦ããã®ã§ãã 天使æ§1ããããªããããnikkieã§ã ããããããã¨æè¡æ¸ã夢ã®åä½ãæããããã¡ãããã¤æ¬ï¼ãã¡ãããã¤ã½ããã¦ã§ã¢è¨è¨å ¥éãï¼ï¼ ãããªã¡ãããã¤æ¬ã®èªæ¸ä¼ã«åâ¦
ã¯ããã« ã°ã©ã¹ã´ã¼ã»ã³ã¼ãã»ã¹ã±ã¼ã«ã¨ããGCSããããnikkieã§ãã Python製ã®ã©ã¤ãã©ãªGCSFSã使ã£ã¦ãã¦æ°ã«ãªã£ããã¨ããã½ã¼ã¹ã³ã¼ããèªãã§èª¿ã¹ã¾ããã ç®æ¬¡ ã¯ããã« ç®æ¬¡ çµè«ï¼ã¿ã¤ãã«ã¸ã®åçï¼ ãã¼ã¸ã§ã³æ å ± GCSFS GCSFSã®Credentials â¦
ã¯ããã« ãã«ãã³ãã³ãã»ãã¤ãã©ã¤ãã³ã°ï¼ nikkieã§ãã å æ¥Clickã®ããã¥ã¡ã³ãã®ãMulti Command Chainingããåãä¸ãã¾ããã ä»åã¯ãã®ããããã¦ã¼ã¹ã±ã¼ã¹ã®ãMulti Command Pipelinesãã«ã¤ãã¦ãããã¥ã¡ã³ãããç解ãããã¨ãã¾ã¨ãã¾ãã â¦
ã¯ããã« ãã«ãã³ãã³ãã»ãã§ã¤ãã³ã°ï¼1 nikkieã§ãã ã³ãã³ãã©ã¤ã³ãã¼ã«ä½æã¯æ¨æºã©ã¤ãã©ãªã®argparseãå¤ãç§2ã§ããããµã¼ããã¼ãã£ã®Clickï¼Command Line Interface Creation Kitã®é è¾èªï¼ãè¦ãã¦ã¿ã¾ããã ãargparseã§ã¯ã§ããªãããã§ãâ¦