{"metadata":{"kernelspec":{"language":"python","display_name":"Python 3","name":"python3"},"language_info":{"name":"python","version":"3.10.13","mimetype":"text/x-python","codemirror_mode":{"name":"ipython","version":3},"pygments_lexer":"ipython3","nbconvert_exporter":"python","file_extension":".py"},"kaggle":{"accelerator":"none","dataSources":[{"sourceId":59575,"databundleVersionId":8060720,"sourceType":"competition"},{"sourceId":174185912,"sourceType":"kernelVersion"}],"dockerImageVersionId":30698,"isInternetEnabled":true,"language":"python","sourceType":"notebook","isGpuEnabled":false}},"nbformat_minor":4,"nbformat":4,"cells":[{"cell_type":"markdown","source":"Debug code of https://www.kaggle.com/competitions/uspto-explainable-ai/discussion/498283.     \n\nThis notebook is set to \"Internet On\" for debugging purposes, so it cannot be used for submission.","metadata":{"_uuid":"8f2839f25d086af736a60e9eeb907d3b93b6e0e5","_cell_guid":"b1076dfc-b9ad-4769-8c92-a6c4dae69d19"}},{"cell_type":"code","source":"! sed 's:/kaggle/input/whoosh-wheel-2-7-4/Whoosh-2.7.4-py2.py3-none-any.whl:whoosh-reloaded==2.7.5:g' /kaggle/usr/lib/whoosh_utils/whoosh_utils.py > whoosh_utils.py\nimport whoosh_utils","metadata":{"execution":{"iopub.status.busy":"2024-04-30T08:09:17.050298Z","iopub.execute_input":"2024-04-30T08:09:17.050975Z","iopub.status.idle":"2024-04-30T08:09:37.997398Z","shell.execute_reply.started":"2024-04-30T08:09:17.050829Z","shell.execute_reply":"2024-04-30T08:09:37.995341Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"train_idx = whoosh_utils.load_index('/kaggle/input/uspto-explainable-ai/train_index')\nsearcher = whoosh_utils.get_searcher(train_idx)\nqp = whoosh_utils.get_query_parser()","metadata":{"execution":{"iopub.status.busy":"2024-04-30T08:09:38.000632Z","iopub.execute_input":"2024-04-30T08:09:38.001231Z","iopub.status.idle":"2024-04-30T08:11:18.040799Z","shell.execute_reply.started":"2024-04-30T08:09:38.001179Z","shell.execute_reply":"2024-04-30T08:11:18.038927Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# https://www.kaggle.com/competitions/uspto-explainable-ai/discussion/498283\nquery_3 = 'cpc:G03G15/224 OR cpc:B33Y10/00 OR cpc:B33Y30/00'\nwhoosh_utils.execute_query(query_3, qp, searcher)","metadata":{"execution":{"iopub.status.busy":"2024-04-30T08:11:18.043503Z","iopub.execute_input":"2024-04-30T08:11:18.044149Z","iopub.status.idle":"2024-04-30T08:11:18.446042Z","shell.execute_reply.started":"2024-04-30T08:11:18.044090Z","shell.execute_reply":"2024-04-30T08:11:18.444503Z"},"trusted":true},"execution_count":null,"outputs":[]},{"cell_type":"code","source":"# https://www.kaggle.com/competitions/uspto-explainable-ai/discussion/498283#2782101\nquery_4 = 'cpc:C07B2200/13 OR cpc:A61P35/00 OR cpc:C07D487/04 OR cpc:C07D471/04 OR cpc:A61P43/00 OR cpc:C07D401/14 OR cpc:A61P31/12 OR cpc:A61K31/519 OR cpc:A61P31/20 OR cpc:C07D513/04 OR cpc:C07D403/06 OR cpc:C07D417/14 OR cpc:C07D405/12'\nwhoosh_utils.execute_query(query_4, qp, searcher)","metadata":{"execution":{"iopub.status.busy":"2024-04-30T08:11:18.449427Z","iopub.execute_input":"2024-04-30T08:11:18.449984Z","iopub.status.idle":"2024-04-30T08:11:18.587873Z","shell.execute_reply.started":"2024-04-30T08:11:18.449935Z","shell.execute_reply":"2024-04-30T08:11:18.586548Z"},"trusted":true},"execution_count":null,"outputs":[]}]}