File size: 85,729 Bytes
b2af341
 
 
 
1d67a6e
b2af341
 
 
 
 
 
 
 
1d67a6e
b2af341
 
 
 
 
 
 
 
 
 
1d67a6e
b2af341
 
1d67a6e
 
 
 
 
 
 
 
b2af341
 
 
1d67a6e
b2af341
 
1d67a6e
b2af341
 
 
 
 
3d2ca49
 
 
 
 
b2af341
 
 
 
 
 
 
 
1d67a6e
b2af341
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b2af341
 
1d67a6e
 
 
 
b2af341
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3d2ca49
 
 
1d67a6e
3d2ca49
 
 
 
 
 
 
 
1d67a6e
3d2ca49
 
 
 
 
1d67a6e
3d2ca49
 
1d67a6e
3d2ca49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1d67a6e
3d2ca49
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
3d2ca49
 
 
 
 
 
 
 
1d67a6e
3d2ca49
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
3d2ca49
 
 
 
 
 
 
 
1d67a6e
3d2ca49
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
3d2ca49
 
 
 
 
 
 
1d67a6e
3d2ca49
 
 
1d67a6e
 
 
 
 
 
 
 
 
3d2ca49
 
 
 
 
 
 
 
 
 
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3d2ca49
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1d67a6e
 
 
 
 
 
3d2ca49
 
 
1d67a6e
 
3d2ca49
 
 
 
 
1d67a6e
 
 
 
 
 
3d2ca49
 
1d67a6e
 
 
 
 
 
3d2ca49
 
1d67a6e
 
 
 
 
3d2ca49
 
 
 
 
 
 
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
3d2ca49
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
3d2ca49
 
1d67a6e
3d2ca49
 
 
 
 
1d67a6e
3d2ca49
1d67a6e
3d2ca49
77ce2b6
 
 
1d67a6e
77ce2b6
 
 
1d67a6e
77ce2b6
1d67a6e
77ce2b6
 
 
 
1d67a6e
77ce2b6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1d67a6e
 
 
 
 
 
77ce2b6
 
1d67a6e
 
 
 
 
77ce2b6
 
 
1d67a6e
 
 
 
 
 
77ce2b6
 
1d67a6e
 
 
 
 
 
77ce2b6
 
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77ce2b6
 
 
1d67a6e
77ce2b6
 
 
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77ce2b6
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77ce2b6
 
1d67a6e
77ce2b6
 
 
 
 
1d67a6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77ce2b6
b2af341
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1d67a6e
b2af341
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "import importlib"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "pd.set_option(\"display.max_colwidth\", 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\Users\\Leems\\Desktop\\Coding\\Projects\\fritz\\venv\\Lib\\site-packages\\tqdm\\auto.py:21: TqdmWarning: IProgress not found. Please update jupyter and ipywidgets. See https://ipywidgets.readthedocs.io/en/stable/user_install.html\n",
      "  from .autonotebook import tqdm as notebook_tqdm\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<module 'src.storage' from 'c:\\\\Users\\\\Leems\\\\Desktop\\\\Coding\\\\Projects\\\\fritz\\\\src\\\\storage.py'>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import src.embedding as embedding\n",
    "import src.storage as storage\n",
    "from src.storage import ArXivData\n",
    "from src.cleaning import TextCleaner\n",
    "from src.embedding import Embedder\n",
    "from sentence_transformers import util\n",
    "\n",
    "importlib.reload(embedding)\n",
    "importlib.reload(storage)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "ename": "PermissionError",
     "evalue": "[Errno 13] Permission denied: './data/libraries/APSP_50_allenai-specter/'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mPermissionError\u001b[0m                           Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[8], line 6\u001b[0m\n\u001b[0;32m      3\u001b[0m path_to_library_embeddings \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39m./data/libraries/APSP_50_allenai-specter/embeddings.feather\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m      5\u001b[0m library \u001b[39m=\u001b[39m ArXivData()\n\u001b[1;32m----> 6\u001b[0m library\u001b[39m.\u001b[39;49mload_from_feather(library_path)\n",
      "File \u001b[1;32mc:\\Users\\Leems\\Desktop\\Coding\\Projects\\fritz\\src\\storage.py:32\u001b[0m, in \u001b[0;36mArXivData.load_from_feather\u001b[1;34m(self, path_to_dataset)\u001b[0m\n\u001b[0;32m     26\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mload_from_feather\u001b[39m(\u001b[39mself\u001b[39m, path_to_dataset):\n\u001b[0;32m     27\u001b[0m \u001b[39m    \u001b[39m\u001b[39m\"\"\"Loads metadata from a saved feather file.\u001b[39;00m\n\u001b[0;32m     28\u001b[0m \n\u001b[0;32m     29\u001b[0m \u001b[39m    Args:\u001b[39;00m\n\u001b[0;32m     30\u001b[0m \u001b[39m        path_to_dataset: path to the feather file containing the dataset.\u001b[39;00m\n\u001b[0;32m     31\u001b[0m \u001b[39m    \"\"\"\u001b[39;00m\n\u001b[1;32m---> 32\u001b[0m     \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_returned_metadata \u001b[39m=\u001b[39m pd\u001b[39m.\u001b[39;49mread_feather(path_to_dataset)\n\u001b[0;32m     33\u001b[0m     \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmetadata \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_returned_metadata\n\u001b[0;32m     34\u001b[0m     \u001b[39mself\u001b[39m\u001b[39m.\u001b[39marxiv_subjects \u001b[39m=\u001b[39m clean\u001b[39m.\u001b[39mOHE_arxiv_subjects(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmetadata)\n",
      "File \u001b[1;32mc:\\Users\\Leems\\Desktop\\Coding\\Projects\\fritz\\venv\\Lib\\site-packages\\pandas\\io\\feather_format.py:144\u001b[0m, in \u001b[0;36mread_feather\u001b[1;34m(path, columns, use_threads, storage_options, dtype_backend)\u001b[0m\n\u001b[0;32m    140\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39mpyarrow\u001b[39;00m \u001b[39mimport\u001b[39;00m feather\n\u001b[0;32m    142\u001b[0m check_dtype_backend(dtype_backend)\n\u001b[1;32m--> 144\u001b[0m \u001b[39mwith\u001b[39;00m get_handle(\n\u001b[0;32m    145\u001b[0m     path, \u001b[39m\"\u001b[39;49m\u001b[39mrb\u001b[39;49m\u001b[39m\"\u001b[39;49m, storage_options\u001b[39m=\u001b[39;49mstorage_options, is_text\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m\n\u001b[0;32m    146\u001b[0m ) \u001b[39mas\u001b[39;00m handles:\n\u001b[0;32m    147\u001b[0m     \u001b[39mif\u001b[39;00m dtype_backend \u001b[39mis\u001b[39;00m lib\u001b[39m.\u001b[39mno_default:\n\u001b[0;32m    148\u001b[0m         \u001b[39mreturn\u001b[39;00m feather\u001b[39m.\u001b[39mread_feather(\n\u001b[0;32m    149\u001b[0m             handles\u001b[39m.\u001b[39mhandle, columns\u001b[39m=\u001b[39mcolumns, use_threads\u001b[39m=\u001b[39m\u001b[39mbool\u001b[39m(use_threads)\n\u001b[0;32m    150\u001b[0m         )\n",
      "File \u001b[1;32mc:\\Users\\Leems\\Desktop\\Coding\\Projects\\fritz\\venv\\Lib\\site-packages\\pandas\\io\\common.py:868\u001b[0m, in \u001b[0;36mget_handle\u001b[1;34m(path_or_buf, mode, encoding, compression, memory_map, is_text, errors, storage_options)\u001b[0m\n\u001b[0;32m    859\u001b[0m         handle \u001b[39m=\u001b[39m \u001b[39mopen\u001b[39m(\n\u001b[0;32m    860\u001b[0m             handle,\n\u001b[0;32m    861\u001b[0m             ioargs\u001b[39m.\u001b[39mmode,\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m    864\u001b[0m             newline\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m\"\u001b[39m,\n\u001b[0;32m    865\u001b[0m         )\n\u001b[0;32m    866\u001b[0m     \u001b[39melse\u001b[39;00m:\n\u001b[0;32m    867\u001b[0m         \u001b[39m# Binary mode\u001b[39;00m\n\u001b[1;32m--> 868\u001b[0m         handle \u001b[39m=\u001b[39m \u001b[39mopen\u001b[39;49m(handle, ioargs\u001b[39m.\u001b[39;49mmode)\n\u001b[0;32m    869\u001b[0m     handles\u001b[39m.\u001b[39mappend(handle)\n\u001b[0;32m    871\u001b[0m \u001b[39m# Convert BytesIO or file objects passed with an encoding\u001b[39;00m\n",
      "\u001b[1;31mPermissionError\u001b[0m: [Errno 13] Permission denied: './data/libraries/APSP_50_allenai-specter/'"
     ]
    }
   ],
   "source": [
    "## Load library\n",
    "library_path = \"./data/libraries/APSP_50_allenai-specter/\"\n",
    "path_to_library_embeddings = (\n",
    "    \"./data/libraries/APSP_50_allenai-specter/embeddings.feather\"\n",
    ")\n",
    "\n",
    "library = ArXivData()\n",
    "library.load_from_feather(library_path)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [],
   "source": [
    "## Prepare the Library\n",
    "\n",
    "cleaner = TextCleaner()\n",
    "embedder = Embedder()\n",
    "\n",
    "clean_library = cleaner.transform(library)\n",
    "prepped_library = embedder.transform(\n",
    "    X=clean_library, load_from_file=True, path_to_embeddings=path_to_library_embeddings\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "## retrieve and pre-process the input\n",
    "\n",
    "input_id = \"1602.00730\"\n",
    "\n",
    "## create query string\n",
    "\n",
    "id_list = [input_id]\n",
    "\n",
    "input_article = ArXivData()\n",
    "input_article.load_from_id_list(id_list=id_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "c:\\Users\\Leems\\Desktop\\Coding\\Projects\\Fritz\\cleaning.py:23: SettingWithCopyWarning: \n",
      "A value is trying to be set on a copy of a slice from a DataFrame\n",
      "\n",
      "See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy\n",
      "  X.metadata.msc_tags[X.metadata.msc_tags.notna()] = X.metadata.msc_tags[\n",
      "Batches: 100%|██████████| 1/1 [00:00<00:00,  4.39it/s]\n"
     ]
    }
   ],
   "source": [
    "## Clean and process the input\n",
    "\n",
    "clean_input_article = cleaner.transform(input_article)\n",
    "prepped_input_article = embedder.transform(\n",
    "    X=clean_input_article,\n",
    "    model_name=\"allenai-specter\",\n",
    "    path_to_embeddings=\"./data/input_embedding.feather\",\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [],
   "source": [
    "## Perform the search and return the closest matches\n",
    "\n",
    "matches = util.semantic_search(\n",
    "    query_embeddings=prepped_input_article.embeddings,\n",
    "    corpus_embeddings=prepped_library.embeddings,\n",
    "    top_k=5,\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [],
   "source": [
    "indices = [dict[\"corpus_id\"] for dict in matches[0]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[38787, 39127, 9786, 49609, 14857]"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "indices"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>title</th>\n",
       "      <th>abstract</th>\n",
       "      <th>id</th>\n",
       "      <th>arxiv_subjects</th>\n",
       "      <th>msc_tags</th>\n",
       "      <th>doc_strings</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>38787</th>\n",
       "      <td>C-infinity Scaling Asymptotics for the Spectral Function of the Laplacian</td>\n",
       "      <td>This article concerns new off-diagonal estimates on the remainder and its derivatives in the pointwise Weyl law on a compact n-dimensional Riemannian manifold. As an application, we prove that near any non self-focal point, the scaling limit of the spectral projector of the Laplacian onto frequency windows of constant size is a normalized Bessel function depending only on n.</td>\n",
       "      <td>1602.00730v1</td>\n",
       "      <td>[math.AP, math-ph, math.DG, math.FA, math.MP, math.SP]</td>\n",
       "      <td>None</td>\n",
       "      <td>C-infinity Scaling Asymptotics for the Spectral Function of the Laplacian This article concerns new off-diagonal estimates on the remainder and its derivatives in the pointwise Weyl law on a compact n-dimensional Riemannian manifold. As an application, we prove that near any non self-focal point, the scaling limit of the spectral projector of the Laplacian onto frequency windows of constant size is a normalized Bessel function depending only on n.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39127</th>\n",
       "      <td>Scaling Limit for the Kernel of the Spectral Projector and Remainder Estimates in the Pointwise Weyl Law</td>\n",
       "      <td>Let (M, g) be a compact smooth Riemannian manifold. We obtain new off-diagonal estimates as {ambda} tend to infinity for the remainder in the pointwise Weyl Law for the kernel of the spectral projector of the Laplacian onto functions with frequency at most {ambda}. A corollary is that, when rescaled around a non self-focal point, the kernel of the spectral projector onto the frequency interval (ambda, ambda + 1] has a universal scaling limit as {ambda} goes to infinity (depending only on the dimension of M). Our results also imply that if M has no conjugate points, then immersions of M into Euclidean space by an orthonormal basis of eigenfunctions with frequencies in (ambda, ambda + 1] are embeddings for all {ambda} sufficiently large.</td>\n",
       "      <td>1411.0658v3</td>\n",
       "      <td>[math.SP, math.AP, math.DG]</td>\n",
       "      <td>None</td>\n",
       "      <td>Scaling Limit for the Kernel of the Spectral Projector and Remainder Estimates in the Pointwise Weyl Law Let (M, g) be a compact smooth Riemannian manifold. We obtain new off-diagonal estimates as {ambda} tend to infinity for the remainder in the pointwise Weyl Law for the kernel of the spectral projector of the Laplacian onto functions with frequency at most {ambda}. A corollary is that, when rescaled around a non self-focal point, the kernel of the spectral projector onto the frequency interval (ambda, ambda + 1] has a universal scaling limit as {ambda} goes to infinity (depending only on the dimension of M). Our results also imply that if M has no conjugate points, then immersions of M into Euclidean space by an orthonormal basis of eigenfunctions with frequencies in (ambda, ambda + 1] are embeddings for all {ambda} sufficiently large.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9786</th>\n",
       "      <td>A logarithmic improvement in the two-point Weyl law for manifolds without conjugate points</td>\n",
       "      <td>In this paper, we study the two-point Weyl Law for the Laplace-Beltrami operator on a smooth, compact Riemannian manifold LATEX  with no conjugate points. That is, we find the asymptotic behavior of the Schwartz kernel, LATEX  of the projection operator from LATEX  onto the direct sum of eigenspaces with eigenvalue smaller than LATEX  as LATEX  In the regime where LATEX  are restricted to a compact neighborhood of the diagonal in LATEX  we obtain a uniform logarithmic improvement in the remainder of the asymptotic expansion for LATEX  and its derivatives of all orders, which generalizes a result of Berard, who treated the on-diagonal case LATEX  When LATEX  avoid a compact neighborhood of the diagonal, we obtain this same improvement in an upper bound for LATEX  Our results imply that the rescaled covariance kernel of a monochromatic random wave locally converges in the LATEX  topology to a universal scaling limit at an inverse logarithmic rate.</td>\n",
       "      <td>1905.05136v3</td>\n",
       "      <td>[math.AP, math.SP]</td>\n",
       "      <td>[Asymptotic distributions of eigenvalues in context of PDEs]</td>\n",
       "      <td>A logarithmic improvement in the two-point Weyl law for manifolds without conjugate points In this paper, we study the two-point Weyl Law for the Laplace-Beltrami operator on a smooth, compact Riemannian manifold LATEX  with no conjugate points. That is, we find the asymptotic behavior of the Schwartz kernel, LATEX  of the projection operator from LATEX  onto the direct sum of eigenspaces with eigenvalue smaller than LATEX  as LATEX  In the regime where LATEX  are restricted to a compact neighborhood of the diagonal in LATEX  we obtain a uniform logarithmic improvement in the remainder of the asymptotic expansion for LATEX  and its derivatives of all orders, which generalizes a result of Berard, who treated the on-diagonal case LATEX  When LATEX  avoid a compact neighborhood of the diagonal, we obtain this same improvement in an upper bound for LATEX  Our results imply that the rescaled covariance kernel of a monochromatic random wave locally converges in the LATEX  topology to a universal scaling limit at an inverse logarithmic rate.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49609</th>\n",
       "      <td>The blowup along the diagonal of the spectral function of the Laplacian</td>\n",
       "      <td>We formulate a precise conjecture about the universal behavior near the diagonal of the spectral function of the Laplacian of a smooth compact Riemann manifold. We prove this conjecture when the manifold and the metric are real analytic, and we also present an alternate proof when the manifold is the round sphere.</td>\n",
       "      <td>1103.1276v4</td>\n",
       "      <td>[math.DG, math-ph, math.AP, math.MP]</td>\n",
       "      <td>[Spectral problems; spectral geometry; scattering theory on manifolds, Second-order elliptic equations]</td>\n",
       "      <td>The blowup along the diagonal of the spectral function of the Laplacian We formulate a precise conjecture about the universal behavior near the diagonal of the spectral function of the Laplacian of a smooth compact Riemann manifold. We prove this conjecture when the manifold and the metric are real analytic, and we also present an alternate proof when the manifold is the round sphere.</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14857</th>\n",
       "      <td>Growth of high LATEX  norms for eigenfunctions: an application of geodesic beams</td>\n",
       "      <td>This work concerns LATEX  norms of high energy Laplace eigenfunctions, LATEX  LATEX  In 1988, Sogge gave optimal estimates on the growth of LATEX  for a general compact Riemannian manifold. The goal of this article is to give general dynamical conditions guaranteeing quantitative improvements in LATEX  estimates for LATEX  where LATEX  is the critical exponent. We also apply previous results of the authors to obtain quantitative improvements in concrete geometric settings including all product manifolds. These are the first results improving estimates for the LATEX  growth of eigenfunctions that only require dynamical assumptions. In contrast with previous improvements, our assumptions are local in the sense that they depend only on the geodesics passing through a shrinking neighborhood of a given set in LATEX  Moreover, the article gives a structure theorem for eigenfunctions which saturate the quantitatively improved LATEX  bound. Modulo an error, the theorem describes these eigenfunctions as finite sums of quasimodes which, roughly, approximate zonal harmonics on the sphere scaled by LATEX</td>\n",
       "      <td>2003.04597v2</td>\n",
       "      <td>[math.AP, math.SP]</td>\n",
       "      <td>None</td>\n",
       "      <td>Growth of high LATEX  norms for eigenfunctions: an application of geodesic beams This work concerns LATEX  norms of high energy Laplace eigenfunctions, LATEX  LATEX  In 1988, Sogge gave optimal estimates on the growth of LATEX  for a general compact Riemannian manifold. The goal of this article is to give general dynamical conditions guaranteeing quantitative improvements in LATEX  estimates for LATEX  where LATEX  is the critical exponent. We also apply previous results of the authors to obtain quantitative improvements in concrete geometric settings including all product manifolds. These are the first results improving estimates for the LATEX  growth of eigenfunctions that only require dynamical assumptions. In contrast with previous improvements, our assumptions are local in the sense that they depend only on the geodesics passing through a shrinking neighborhood of a given set in LATEX  Moreover, the article gives a structure theorem for eigenfunctions which saturate the quantitatively improved LATEX  bound. Modulo an error, the theorem describes these eigenfunctions as finite sums of quasimodes which, roughly, approximate zonal harmonics on the sphere scaled by LATEX</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                          title  \\\n",
       "38787  C-infinity Scaling Asymptotics for the Spectral Function of the Laplacian                                  \n",
       "39127  Scaling Limit for the Kernel of the Spectral Projector and Remainder Estimates in the Pointwise Weyl Law   \n",
       "9786   A logarithmic improvement in the two-point Weyl law for manifolds without conjugate points                 \n",
       "49609  The blowup along the diagonal of the spectral function of the Laplacian                                    \n",
       "14857  Growth of high LATEX  norms for eigenfunctions: an application of geodesic beams                           \n",
       "\n",
       "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     abstract  \\\n",
       "38787  This article concerns new off-diagonal estimates on the remainder and its derivatives in the pointwise Weyl law on a compact n-dimensional Riemannian manifold. As an application, we prove that near any non self-focal point, the scaling limit of the spectral projector of the Laplacian onto frequency windows of constant size is a normalized Bessel function depending only on n.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                \n",
       "39127  Let (M, g) be a compact smooth Riemannian manifold. We obtain new off-diagonal estimates as {ambda} tend to infinity for the remainder in the pointwise Weyl Law for the kernel of the spectral projector of the Laplacian onto functions with frequency at most {ambda}. A corollary is that, when rescaled around a non self-focal point, the kernel of the spectral projector onto the frequency interval (ambda, ambda + 1] has a universal scaling limit as {ambda} goes to infinity (depending only on the dimension of M). Our results also imply that if M has no conjugate points, then immersions of M into Euclidean space by an orthonormal basis of eigenfunctions with frequencies in (ambda, ambda + 1] are embeddings for all {ambda} sufficiently large.                                                                                                                                                                                                                                                                                                                                                                                \n",
       "9786   In this paper, we study the two-point Weyl Law for the Laplace-Beltrami operator on a smooth, compact Riemannian manifold LATEX  with no conjugate points. That is, we find the asymptotic behavior of the Schwartz kernel, LATEX  of the projection operator from LATEX  onto the direct sum of eigenspaces with eigenvalue smaller than LATEX  as LATEX  In the regime where LATEX  are restricted to a compact neighborhood of the diagonal in LATEX  we obtain a uniform logarithmic improvement in the remainder of the asymptotic expansion for LATEX  and its derivatives of all orders, which generalizes a result of Berard, who treated the on-diagonal case LATEX  When LATEX  avoid a compact neighborhood of the diagonal, we obtain this same improvement in an upper bound for LATEX  Our results imply that the rescaled covariance kernel of a monochromatic random wave locally converges in the LATEX  topology to a universal scaling limit at an inverse logarithmic rate.                                                                                                                                                          \n",
       "49609  We formulate a precise conjecture about the universal behavior near the diagonal of the spectral function of the Laplacian of a smooth compact Riemann manifold. We prove this conjecture when the manifold and the metric are real analytic, and we also present an alternate proof when the manifold is the round sphere.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              \n",
       "14857  This work concerns LATEX  norms of high energy Laplace eigenfunctions, LATEX  LATEX  In 1988, Sogge gave optimal estimates on the growth of LATEX  for a general compact Riemannian manifold. The goal of this article is to give general dynamical conditions guaranteeing quantitative improvements in LATEX  estimates for LATEX  where LATEX  is the critical exponent. We also apply previous results of the authors to obtain quantitative improvements in concrete geometric settings including all product manifolds. These are the first results improving estimates for the LATEX  growth of eigenfunctions that only require dynamical assumptions. In contrast with previous improvements, our assumptions are local in the sense that they depend only on the geodesics passing through a shrinking neighborhood of a given set in LATEX  Moreover, the article gives a structure theorem for eigenfunctions which saturate the quantitatively improved LATEX  bound. Modulo an error, the theorem describes these eigenfunctions as finite sums of quasimodes which, roughly, approximate zonal harmonics on the sphere scaled by LATEX    \n",
       "\n",
       "                 id                                          arxiv_subjects  \\\n",
       "38787  1602.00730v1  [math.AP, math-ph, math.DG, math.FA, math.MP, math.SP]   \n",
       "39127  1411.0658v3   [math.SP, math.AP, math.DG]                              \n",
       "9786   1905.05136v3  [math.AP, math.SP]                                       \n",
       "49609  1103.1276v4   [math.DG, math-ph, math.AP, math.MP]                     \n",
       "14857  2003.04597v2  [math.AP, math.SP]                                       \n",
       "\n",
       "                                                                                                      msc_tags  \\\n",
       "38787  None                                                                                                      \n",
       "39127  None                                                                                                      \n",
       "9786   [Asymptotic distributions of eigenvalues in context of PDEs]                                              \n",
       "49609  [Spectral problems; spectral geometry; scattering theory on manifolds, Second-order elliptic equations]   \n",
       "14857  None                                                                                                      \n",
       "\n",
       "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   doc_strings  \n",
       "38787  C-infinity Scaling Asymptotics for the Spectral Function of the Laplacian This article concerns new off-diagonal estimates on the remainder and its derivatives in the pointwise Weyl law on a compact n-dimensional Riemannian manifold. As an application, we prove that near any non self-focal point, the scaling limit of the spectral projector of the Laplacian onto frequency windows of constant size is a normalized Bessel function depending only on n.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      \n",
       "39127  Scaling Limit for the Kernel of the Spectral Projector and Remainder Estimates in the Pointwise Weyl Law Let (M, g) be a compact smooth Riemannian manifold. We obtain new off-diagonal estimates as {ambda} tend to infinity for the remainder in the pointwise Weyl Law for the kernel of the spectral projector of the Laplacian onto functions with frequency at most {ambda}. A corollary is that, when rescaled around a non self-focal point, the kernel of the spectral projector onto the frequency interval (ambda, ambda + 1] has a universal scaling limit as {ambda} goes to infinity (depending only on the dimension of M). Our results also imply that if M has no conjugate points, then immersions of M into Euclidean space by an orthonormal basis of eigenfunctions with frequencies in (ambda, ambda + 1] are embeddings for all {ambda} sufficiently large.                                                                                                                                                                                                                                                                                                                                                       \n",
       "9786   A logarithmic improvement in the two-point Weyl law for manifolds without conjugate points In this paper, we study the two-point Weyl Law for the Laplace-Beltrami operator on a smooth, compact Riemannian manifold LATEX  with no conjugate points. That is, we find the asymptotic behavior of the Schwartz kernel, LATEX  of the projection operator from LATEX  onto the direct sum of eigenspaces with eigenvalue smaller than LATEX  as LATEX  In the regime where LATEX  are restricted to a compact neighborhood of the diagonal in LATEX  we obtain a uniform logarithmic improvement in the remainder of the asymptotic expansion for LATEX  and its derivatives of all orders, which generalizes a result of Berard, who treated the on-diagonal case LATEX  When LATEX  avoid a compact neighborhood of the diagonal, we obtain this same improvement in an upper bound for LATEX  Our results imply that the rescaled covariance kernel of a monochromatic random wave locally converges in the LATEX  topology to a universal scaling limit at an inverse logarithmic rate.                                                                                                                                               \n",
       "49609  The blowup along the diagonal of the spectral function of the Laplacian We formulate a precise conjecture about the universal behavior near the diagonal of the spectral function of the Laplacian of a smooth compact Riemann manifold. We prove this conjecture when the manifold and the metric are real analytic, and we also present an alternate proof when the manifold is the round sphere.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      \n",
       "14857  Growth of high LATEX  norms for eigenfunctions: an application of geodesic beams This work concerns LATEX  norms of high energy Laplace eigenfunctions, LATEX  LATEX  In 1988, Sogge gave optimal estimates on the growth of LATEX  for a general compact Riemannian manifold. The goal of this article is to give general dynamical conditions guaranteeing quantitative improvements in LATEX  estimates for LATEX  where LATEX  is the critical exponent. We also apply previous results of the authors to obtain quantitative improvements in concrete geometric settings including all product manifolds. These are the first results improving estimates for the LATEX  growth of eigenfunctions that only require dynamical assumptions. In contrast with previous improvements, our assumptions are local in the sense that they depend only on the geodesics passing through a shrinking neighborhood of a given set in LATEX  Moreover, the article gives a structure theorem for eigenfunctions which saturate the quantitatively improved LATEX  bound. Modulo an error, the theorem describes these eigenfunctions as finite sums of quasimodes which, roughly, approximate zonal harmonics on the sphere scaled by LATEX   "
      ]
     },
     "execution_count": 60,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "## Retrieve indices\n",
    "\n",
    "prepped_library._returned_metadata.iloc[indices]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "id_list = [\"1602.00730\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<module 'src.search' from 'c:\\\\Users\\\\Leems\\\\Desktop\\\\Coding\\\\Projects\\\\fritz\\\\src\\\\search.py'>"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import src.embedding as embedding\n",
    "import src.search as search\n",
    "import importlib\n",
    "from src.storage import Fetch\n",
    "from src.cleaning import TextCleaner\n",
    "from src.embedding import Embedder\n",
    "from src.search import Search\n",
    "\n",
    "importlib.reload(embedding)\n",
    "importlib.reload(search)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'id_list' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[11], line 3\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[39m## Fetch metadata of input\u001b[39;00m\n\u001b[0;32m      2\u001b[0m getter \u001b[39m=\u001b[39m Fetch()\n\u001b[1;32m----> 3\u001b[0m into_cleaner \u001b[39m=\u001b[39m getter\u001b[39m.\u001b[39mtransform(X\u001b[39m=\u001b[39mid_list)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'id_list' is not defined"
     ]
    }
   ],
   "source": [
    "## Fetch metadata of input\n",
    "getter = Fetch()\n",
    "into_cleaner = getter.transform(X=id_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'into_cleaner' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[12], line 3\u001b[0m\n\u001b[0;32m      1\u001b[0m cleaner \u001b[39m=\u001b[39m TextCleaner()\n\u001b[1;32m----> 3\u001b[0m into_embedder \u001b[39m=\u001b[39m cleaner\u001b[39m.\u001b[39mtransform(into_cleaner)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'into_cleaner' is not defined"
     ]
    }
   ],
   "source": [
    "cleaner = TextCleaner()\n",
    "\n",
    "into_embedder = cleaner.transform(into_cleaner)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'into_embedder' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[13], line 2\u001b[0m\n\u001b[0;32m      1\u001b[0m embedder \u001b[39m=\u001b[39m Embedder(model_name\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mallenai-specter\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m----> 2\u001b[0m into_search \u001b[39m=\u001b[39m embedder\u001b[39m.\u001b[39mtransform(into_embedder)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'into_embedder' is not defined"
     ]
    }
   ],
   "source": [
    "embedder = Embedder(model_name=\"allenai-specter\")\n",
    "into_search = embedder.transform(into_embedder)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'into_search' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[14], line 3\u001b[0m\n\u001b[0;32m      1\u001b[0m search \u001b[39m=\u001b[39m Search(path_to_library\u001b[39m=\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m./data/libraries/APSP_50_allenai-specter/\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m----> 3\u001b[0m search\u001b[39m.\u001b[39mtransform(X\u001b[39m=\u001b[39minto_search)\u001b[39m.\u001b[39mid\u001b[39m.\u001b[39mto_list()\n",
      "\u001b[1;31mNameError\u001b[0m: name 'into_search' is not defined"
     ]
    }
   ],
   "source": [
    "search = Search(path_to_library=\"./data/libraries/APSP_50_allenai-specter/\")\n",
    "\n",
    "search.transform(X=into_search).id.to_list()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'id_list' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "Cell \u001b[1;32mIn[15], line 13\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[39mfrom\u001b[39;00m \u001b[39msklearn\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39mpipeline\u001b[39;00m \u001b[39mimport\u001b[39;00m Pipeline\n\u001b[0;32m      3\u001b[0m pipe \u001b[39m=\u001b[39m Pipeline(\n\u001b[0;32m      4\u001b[0m     [\n\u001b[0;32m      5\u001b[0m         (\u001b[39m\"\u001b[39m\u001b[39mfetch\u001b[39m\u001b[39m\"\u001b[39m, Fetch()),\n\u001b[1;32m   (...)\u001b[0m\n\u001b[0;32m      9\u001b[0m     ]\n\u001b[0;32m     10\u001b[0m )\n\u001b[1;32m---> 13\u001b[0m pipe\u001b[39m.\u001b[39mtransform(X\u001b[39m=\u001b[39mid_list)\n",
      "\u001b[1;31mNameError\u001b[0m: name 'id_list' is not defined"
     ]
    }
   ],
   "source": [
    "from sklearn.pipeline import Pipeline\n",
    "\n",
    "pipe = Pipeline(\n",
    "    [\n",
    "        (\"fetch\", Fetch()),\n",
    "        (\"clean\", TextCleaner()),\n",
    "        (\"embed\", Embedder(model_name=\"allenai-specter\")),\n",
    "        (\"search\", Search(path_to_library=\"./data/libraries/APSP_50_allenai-specter/\")),\n",
    "    ]\n",
    ")\n",
    "\n",
    "\n",
    "pipe.transform(X=id_list)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [],
   "source": [
    "import src.model\n",
    "import importlib\n",
    "\n",
    "importlib.reload(src.model)\n",
    "from src.model import main"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>title</th>\n",
       "      <th>abstract</th>\n",
       "      <th>id</th>\n",
       "      <th>arxiv_subjects</th>\n",
       "      <th>msc_tags</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>9786</th>\n",
       "      <td>A logarithmic improvement in the two-point Weyl law for manifolds without conjugate points</td>\n",
       "      <td>In this paper, we study the two-point Weyl Law for the Laplace-Beltrami\\noperator on a smooth, compact Riemannian manifold $M$ with no conjugate points.\\nThat is, we find the asymptotic behavior of the Schwartz kernel,\\n$E_\\lambda(x,y)$, of the projection operator from $L^2(M)$ onto the direct sum\\nof eigenspaces with eigenvalue smaller than $\\lambda^2$ as $\\lambda \\to\\infty$.\\nIn the regime where $x,y$ are restricted to a compact neighborhood of the\\ndiagonal in $M\\times M$, we obtain a uniform logarithmic improvement in the\\nremainder of the asymptotic expansion for $E_\\lambda$ and its derivatives of\\nall orders, which generalizes a result of B\\'erard, who treated the on-diagonal\\ncase $E_\\lambda(x,x)$. When $x,y$ avoid a compact neighborhood of the diagonal,\\nwe obtain this same improvement in an upper bound for $E_\\lambda$. Our results\\nimply that the rescaled covariance kernel of a monochromatic random wave\\nlocally converges in the $C^\\infty$ topology to a universal scaling limit at an\\ninverse logarithmic rate.</td>\n",
       "      <td>1905.05136v3</td>\n",
       "      <td>[math.AP, math.SP]</td>\n",
       "      <td>[35P20]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>39127</th>\n",
       "      <td>Scaling Limit for the Kernel of the Spectral Projector and Remainder Estimates in the Pointwise Weyl Law</td>\n",
       "      <td>Let (M, g) be a compact smooth Riemannian manifold. We obtain new\\noff-diagonal estimates as {\\lambda} tend to infinity for the remainder in the\\npointwise Weyl Law for the kernel of the spectral projector of the Laplacian\\nonto functions with frequency at most {\\lambda}. A corollary is that, when\\nrescaled around a non self-focal point, the kernel of the spectral projector\\nonto the frequency interval (\\lambda, \\lambda + 1] has a universal scaling\\nlimit as {\\lambda} goes to infinity (depending only on the dimension of M). Our\\nresults also imply that if M has no conjugate points, then immersions of M into\\nEuclidean space by an orthonormal basis of eigenfunctions with frequencies in\\n(\\lambda, \\lambda + 1] are embeddings for all {\\lambda} sufficiently large.</td>\n",
       "      <td>1411.0658v3</td>\n",
       "      <td>[math.SP, math.AP, math.DG]</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>46524</th>\n",
       "      <td>On $L^p$-resolvent estimates and the density of eigenvalues for compact Riemannian manifolds</td>\n",
       "      <td>We address an interesting question raised by Dos Santos Ferreira, Kenig and\\nSalo about regions ${\\mathcal R}_g\\subset {\\mathbb C}$ for which there can be\\nuniform $L^{\\frac{2n}{n+2}}\\to L^{\\frac{2n}{n-2}}$ resolvent estimates for\\n$\\Delta_g+\\zeta$, $\\zeta \\in {\\mathcal R}_g$, where $\\Delta_g$ is the\\nLaplace-Beltrami operator with metric $g$ on a given compact boundaryless\\nRiemannian manifold of dimension $n\\ge3$. This is related to earlier work of\\nKenig, Ruiz and the third author for the Euclidean Laplacian, in which case the\\nregion is the entire complex plane minus any disc centered at the origin.\\nPresently, we show that for the round metric on the sphere, $S^n$, the\\nresolvent estimates in Ferreira et al, involving a much smaller region, are\\nessentially optimal. We do this by establishing sharp bounds based on the\\ndistance from $\\zeta$ to the spectrum of $\\Delta_{S^n}$.\\n  In the other direction, we also show that the bounds in \\cite{Kenig} can be\\nsharpened logarithmically for manifolds with nonpositive curvature, and by\\npowers in the case of the torus, ${\\mathbb T}^n={\\mathbb R}^n/{\\mathbb Z}^n$,\\nwith the flat metric. The latter improves earlier bounds of Shen.\\n  Further improvements for the torus are obtained using recent techniques of\\nthe first author and his work with Guth based on the multilinear estimates of\\nBennett, Carbery and Tao. Our approach also allows us to give a natural\\nnecessary condition for favorable resolvent estimates that is based on a\\nmeasurement of the density of the spectrum of $\\sqrt{-\\Delta_g}$, and,\\nmoreover, a necessary and sufficient condition based on natural improved\\nspectral projection estimates for shrinking intervals.</td>\n",
       "      <td>1204.3927v3</td>\n",
       "      <td>[math.AP, math.CA]</td>\n",
       "      <td>[58J50]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38787</th>\n",
       "      <td>C-infinity Scaling Asymptotics for the Spectral Function of the Laplacian</td>\n",
       "      <td>This article concerns new off-diagonal estimates on the remainder and its\\nderivatives in the pointwise Weyl law on a compact n-dimensional Riemannian\\nmanifold. As an application, we prove that near any non self-focal point, the\\nscaling limit of the spectral projector of the Laplacian onto frequency windows\\nof constant size is a normalized Bessel function depending only on n.</td>\n",
       "      <td>1602.00730v1</td>\n",
       "      <td>[math.AP, math-ph, math.DG, math.FA, math.MP, math.SP]</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>38299</th>\n",
       "      <td>A lower bound for the $Θ$ function on manifolds without conjugate points</td>\n",
       "      <td>In this short note, we prove that the usual $\\Theta$ function on a Riemannian\\nmanifold without conjugate points is uniformly bounded from below. This extends\\na result of Green in two dimensions. This elementary lemma implies that the\\nB\\'erard remainder in the Weyl law is valid for a manifold without conjugate\\npoints, without any restriction on the dimension.</td>\n",
       "      <td>1603.05697v1</td>\n",
       "      <td>[math.DG, math.SP]</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                                                                          title  \\\n",
       "9786   A logarithmic improvement in the two-point Weyl law for manifolds without conjugate points                 \n",
       "39127  Scaling Limit for the Kernel of the Spectral Projector and Remainder Estimates in the Pointwise Weyl Law   \n",
       "46524  On $L^p$-resolvent estimates and the density of eigenvalues for compact Riemannian manifolds               \n",
       "38787  C-infinity Scaling Asymptotics for the Spectral Function of the Laplacian                                  \n",
       "38299  A lower bound for the $Θ$ function on manifolds without conjugate points                                   \n",
       "\n",
       "                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  abstract  \\\n",
       "9786   In this paper, we study the two-point Weyl Law for the Laplace-Beltrami\\noperator on a smooth, compact Riemannian manifold $M$ with no conjugate points.\\nThat is, we find the asymptotic behavior of the Schwartz kernel,\\n$E_\\lambda(x,y)$, of the projection operator from $L^2(M)$ onto the direct sum\\nof eigenspaces with eigenvalue smaller than $\\lambda^2$ as $\\lambda \\to\\infty$.\\nIn the regime where $x,y$ are restricted to a compact neighborhood of the\\ndiagonal in $M\\times M$, we obtain a uniform logarithmic improvement in the\\nremainder of the asymptotic expansion for $E_\\lambda$ and its derivatives of\\nall orders, which generalizes a result of B\\'erard, who treated the on-diagonal\\ncase $E_\\lambda(x,x)$. When $x,y$ avoid a compact neighborhood of the diagonal,\\nwe obtain this same improvement in an upper bound for $E_\\lambda$. Our results\\nimply that the rescaled covariance kernel of a monochromatic random wave\\nlocally converges in the $C^\\infty$ topology to a universal scaling limit at an\\ninverse logarithmic rate.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             \n",
       "39127  Let (M, g) be a compact smooth Riemannian manifold. We obtain new\\noff-diagonal estimates as {\\lambda} tend to infinity for the remainder in the\\npointwise Weyl Law for the kernel of the spectral projector of the Laplacian\\nonto functions with frequency at most {\\lambda}. A corollary is that, when\\nrescaled around a non self-focal point, the kernel of the spectral projector\\nonto the frequency interval (\\lambda, \\lambda + 1] has a universal scaling\\nlimit as {\\lambda} goes to infinity (depending only on the dimension of M). Our\\nresults also imply that if M has no conjugate points, then immersions of M into\\nEuclidean space by an orthonormal basis of eigenfunctions with frequencies in\\n(\\lambda, \\lambda + 1] are embeddings for all {\\lambda} sufficiently large.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    \n",
       "46524  We address an interesting question raised by Dos Santos Ferreira, Kenig and\\nSalo about regions ${\\mathcal R}_g\\subset {\\mathbb C}$ for which there can be\\nuniform $L^{\\frac{2n}{n+2}}\\to L^{\\frac{2n}{n-2}}$ resolvent estimates for\\n$\\Delta_g+\\zeta$, $\\zeta \\in {\\mathcal R}_g$, where $\\Delta_g$ is the\\nLaplace-Beltrami operator with metric $g$ on a given compact boundaryless\\nRiemannian manifold of dimension $n\\ge3$. This is related to earlier work of\\nKenig, Ruiz and the third author for the Euclidean Laplacian, in which case the\\nregion is the entire complex plane minus any disc centered at the origin.\\nPresently, we show that for the round metric on the sphere, $S^n$, the\\nresolvent estimates in Ferreira et al, involving a much smaller region, are\\nessentially optimal. We do this by establishing sharp bounds based on the\\ndistance from $\\zeta$ to the spectrum of $\\Delta_{S^n}$.\\n  In the other direction, we also show that the bounds in \\cite{Kenig} can be\\nsharpened logarithmically for manifolds with nonpositive curvature, and by\\npowers in the case of the torus, ${\\mathbb T}^n={\\mathbb R}^n/{\\mathbb Z}^n$,\\nwith the flat metric. The latter improves earlier bounds of Shen.\\n  Further improvements for the torus are obtained using recent techniques of\\nthe first author and his work with Guth based on the multilinear estimates of\\nBennett, Carbery and Tao. Our approach also allows us to give a natural\\nnecessary condition for favorable resolvent estimates that is based on a\\nmeasurement of the density of the spectrum of $\\sqrt{-\\Delta_g}$, and,\\nmoreover, a necessary and sufficient condition based on natural improved\\nspectral projection estimates for shrinking intervals.   \n",
       "38787  This article concerns new off-diagonal estimates on the remainder and its\\nderivatives in the pointwise Weyl law on a compact n-dimensional Riemannian\\nmanifold. As an application, we prove that near any non self-focal point, the\\nscaling limit of the spectral projector of the Laplacian onto frequency windows\\nof constant size is a normalized Bessel function depending only on n.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         \n",
       "38299  In this short note, we prove that the usual $\\Theta$ function on a Riemannian\\nmanifold without conjugate points is uniformly bounded from below. This extends\\na result of Green in two dimensions. This elementary lemma implies that the\\nB\\'erard remainder in the Weyl law is valid for a manifold without conjugate\\npoints, without any restriction on the dimension.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          \n",
       "\n",
       "                 id                                          arxiv_subjects  \\\n",
       "9786   1905.05136v3  [math.AP, math.SP]                                       \n",
       "39127  1411.0658v3   [math.SP, math.AP, math.DG]                              \n",
       "46524  1204.3927v3   [math.AP, math.CA]                                       \n",
       "38787  1602.00730v1  [math.AP, math-ph, math.DG, math.FA, math.MP, math.SP]   \n",
       "38299  1603.05697v1  [math.DG, math.SP]                                       \n",
       "\n",
       "      msc_tags  \n",
       "9786   [35P20]  \n",
       "39127  None     \n",
       "46524  [58J50]  \n",
       "38787  None     \n",
       "38299  None     "
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "recs = main(id_list=[\"1905.05136v3\"])\n",
    "\n",
    "recs.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "lib = pd.read_feather(\"./data/libraries/APSP_50_allenai-specter/metadata.feather\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>title</th>\n",
       "      <th>abstract</th>\n",
       "      <th>id</th>\n",
       "      <th>arxiv_subjects</th>\n",
       "      <th>msc_tags</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>Post-Lie algebras in Regularity Structures</td>\n",
       "      <td>In this work, we construct the deformed Butche...</td>\n",
       "      <td>2208.00514v5</td>\n",
       "      <td>[math.PR, math.AP, math.RA]</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>Borderline gradient regularity estimates for q...</td>\n",
       "      <td>In this paper, we study some regularity issues...</td>\n",
       "      <td>2307.02420v1</td>\n",
       "      <td>[math.AP]</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>Deep Learning Hydrodynamic Forecasting for Flo...</td>\n",
       "      <td>Hydrodynamic flood modeling improves hydrologi...</td>\n",
       "      <td>2305.12052v2</td>\n",
       "      <td>[cs.LG, math.AP, physics.flu-dyn]</td>\n",
       "      <td>None</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>Gradient estimates for the non-stationary Stok...</td>\n",
       "      <td>For the non-stationary Stokes system, it is we...</td>\n",
       "      <td>2306.16480v2</td>\n",
       "      <td>[math.AP]</td>\n",
       "      <td>[35Q30, 35B65]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>Puiseux asymptotic expansions for convection-d...</td>\n",
       "      <td>This article completes the study of the influe...</td>\n",
       "      <td>2307.02387v1</td>\n",
       "      <td>[math.AP]</td>\n",
       "      <td>[35K20, 35R02, 35B40, 35B25, 35B45, 35K57, 35Q49]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49995</th>\n",
       "      <td>Singular Limits for Thin Film Superconductors ...</td>\n",
       "      <td>We consider singular limits of the three-dimen...</td>\n",
       "      <td>1209.3696v1</td>\n",
       "      <td>[math.AP, math-ph, math.MP]</td>\n",
       "      <td>[35J50, 35Q56, 49J45]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49996</th>\n",
       "      <td>Energy partition for the linear radial wave eq...</td>\n",
       "      <td>We consider the radial free wave equation in a...</td>\n",
       "      <td>1209.3678v1</td>\n",
       "      <td>[math.AP]</td>\n",
       "      <td>[35L05]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49997</th>\n",
       "      <td>Spectral stability for subsonic traveling puls...</td>\n",
       "      <td>We consider the spectral stability of certain ...</td>\n",
       "      <td>1209.3666v1</td>\n",
       "      <td>[math.AP]</td>\n",
       "      <td>[35B35, 35B40, 35G30]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49998</th>\n",
       "      <td>On the extension property of Reifenberg-flat d...</td>\n",
       "      <td>We provide a detailed proof of the fact that a...</td>\n",
       "      <td>1209.3602v1</td>\n",
       "      <td>[math.AP]</td>\n",
       "      <td>[49Q20, 49Q05, 46E35]</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49999</th>\n",
       "      <td>BMO estimates for nonvariational operators wit...</td>\n",
       "      <td>We consider a class of nonvariational linear o...</td>\n",
       "      <td>1209.3601v1</td>\n",
       "      <td>[math.AP]</td>\n",
       "      <td>[35B45]</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>50000 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                                   title  \\\n",
       "0             Post-Lie algebras in Regularity Structures   \n",
       "1      Borderline gradient regularity estimates for q...   \n",
       "2      Deep Learning Hydrodynamic Forecasting for Flo...   \n",
       "3      Gradient estimates for the non-stationary Stok...   \n",
       "4      Puiseux asymptotic expansions for convection-d...   \n",
       "...                                                  ...   \n",
       "49995  Singular Limits for Thin Film Superconductors ...   \n",
       "49996  Energy partition for the linear radial wave eq...   \n",
       "49997  Spectral stability for subsonic traveling puls...   \n",
       "49998  On the extension property of Reifenberg-flat d...   \n",
       "49999  BMO estimates for nonvariational operators wit...   \n",
       "\n",
       "                                                abstract            id  \\\n",
       "0      In this work, we construct the deformed Butche...  2208.00514v5   \n",
       "1      In this paper, we study some regularity issues...  2307.02420v1   \n",
       "2      Hydrodynamic flood modeling improves hydrologi...  2305.12052v2   \n",
       "3      For the non-stationary Stokes system, it is we...  2306.16480v2   \n",
       "4      This article completes the study of the influe...  2307.02387v1   \n",
       "...                                                  ...           ...   \n",
       "49995  We consider singular limits of the three-dimen...   1209.3696v1   \n",
       "49996  We consider the radial free wave equation in a...   1209.3678v1   \n",
       "49997  We consider the spectral stability of certain ...   1209.3666v1   \n",
       "49998  We provide a detailed proof of the fact that a...   1209.3602v1   \n",
       "49999  We consider a class of nonvariational linear o...   1209.3601v1   \n",
       "\n",
       "                          arxiv_subjects  \\\n",
       "0            [math.PR, math.AP, math.RA]   \n",
       "1                              [math.AP]   \n",
       "2      [cs.LG, math.AP, physics.flu-dyn]   \n",
       "3                              [math.AP]   \n",
       "4                              [math.AP]   \n",
       "...                                  ...   \n",
       "49995        [math.AP, math-ph, math.MP]   \n",
       "49996                          [math.AP]   \n",
       "49997                          [math.AP]   \n",
       "49998                          [math.AP]   \n",
       "49999                          [math.AP]   \n",
       "\n",
       "                                                msc_tags  \n",
       "0                                                   None  \n",
       "1                                                   None  \n",
       "2                                                   None  \n",
       "3                                         [35Q30, 35B65]  \n",
       "4      [35K20, 35R02, 35B40, 35B25, 35B45, 35K57, 35Q49]  \n",
       "...                                                  ...  \n",
       "49995                              [35J50, 35Q56, 49J45]  \n",
       "49996                                            [35L05]  \n",
       "49997                              [35B35, 35B40, 35G30]  \n",
       "49998                              [49Q20, 49Q05, 46E35]  \n",
       "49999                                            [35B45]  \n",
       "\n",
       "[50000 rows x 5 columns]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lib"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "emb = pd.read_feather(\"./data/libraries/APSP_50_allenai-specter/embeddings.feather\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>0</th>\n",
       "      <th>1</th>\n",
       "      <th>2</th>\n",
       "      <th>3</th>\n",
       "      <th>4</th>\n",
       "      <th>5</th>\n",
       "      <th>6</th>\n",
       "      <th>7</th>\n",
       "      <th>8</th>\n",
       "      <th>9</th>\n",
       "      <th>...</th>\n",
       "      <th>758</th>\n",
       "      <th>759</th>\n",
       "      <th>760</th>\n",
       "      <th>761</th>\n",
       "      <th>762</th>\n",
       "      <th>763</th>\n",
       "      <th>764</th>\n",
       "      <th>765</th>\n",
       "      <th>766</th>\n",
       "      <th>767</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>-0.354270</td>\n",
       "      <td>0.422403</td>\n",
       "      <td>-0.105672</td>\n",
       "      <td>-0.129077</td>\n",
       "      <td>0.289177</td>\n",
       "      <td>0.382220</td>\n",
       "      <td>0.183098</td>\n",
       "      <td>0.102091</td>\n",
       "      <td>0.635695</td>\n",
       "      <td>1.120547</td>\n",
       "      <td>...</td>\n",
       "      <td>0.843546</td>\n",
       "      <td>-0.591661</td>\n",
       "      <td>1.413266</td>\n",
       "      <td>0.980099</td>\n",
       "      <td>1.254564</td>\n",
       "      <td>-0.756020</td>\n",
       "      <td>0.614037</td>\n",
       "      <td>0.139899</td>\n",
       "      <td>0.117359</td>\n",
       "      <td>0.159412</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>-0.005778</td>\n",
       "      <td>0.875256</td>\n",
       "      <td>0.844623</td>\n",
       "      <td>-0.913219</td>\n",
       "      <td>-0.220542</td>\n",
       "      <td>0.457574</td>\n",
       "      <td>0.819090</td>\n",
       "      <td>0.658583</td>\n",
       "      <td>-0.206531</td>\n",
       "      <td>0.899738</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.000560</td>\n",
       "      <td>-0.572531</td>\n",
       "      <td>0.789380</td>\n",
       "      <td>1.063664</td>\n",
       "      <td>-0.072007</td>\n",
       "      <td>0.111034</td>\n",
       "      <td>0.270689</td>\n",
       "      <td>0.319568</td>\n",
       "      <td>1.085690</td>\n",
       "      <td>0.670377</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.115181</td>\n",
       "      <td>-0.087180</td>\n",
       "      <td>0.114065</td>\n",
       "      <td>0.246189</td>\n",
       "      <td>0.714248</td>\n",
       "      <td>0.402952</td>\n",
       "      <td>0.313888</td>\n",
       "      <td>0.908008</td>\n",
       "      <td>0.219879</td>\n",
       "      <td>1.368971</td>\n",
       "      <td>...</td>\n",
       "      <td>0.806028</td>\n",
       "      <td>-0.331930</td>\n",
       "      <td>1.068578</td>\n",
       "      <td>1.111367</td>\n",
       "      <td>-0.686173</td>\n",
       "      <td>-0.046650</td>\n",
       "      <td>-0.116867</td>\n",
       "      <td>0.380806</td>\n",
       "      <td>0.239970</td>\n",
       "      <td>0.928296</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.052282</td>\n",
       "      <td>0.800266</td>\n",
       "      <td>0.831988</td>\n",
       "      <td>0.155950</td>\n",
       "      <td>-0.213863</td>\n",
       "      <td>0.179749</td>\n",
       "      <td>1.394324</td>\n",
       "      <td>0.505120</td>\n",
       "      <td>-0.341608</td>\n",
       "      <td>0.040288</td>\n",
       "      <td>...</td>\n",
       "      <td>0.333275</td>\n",
       "      <td>-1.103323</td>\n",
       "      <td>0.387326</td>\n",
       "      <td>1.064309</td>\n",
       "      <td>0.196870</td>\n",
       "      <td>0.380791</td>\n",
       "      <td>1.301055</td>\n",
       "      <td>0.288548</td>\n",
       "      <td>0.353034</td>\n",
       "      <td>0.239037</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.095074</td>\n",
       "      <td>0.099750</td>\n",
       "      <td>0.638213</td>\n",
       "      <td>-1.026867</td>\n",
       "      <td>0.020405</td>\n",
       "      <td>0.488524</td>\n",
       "      <td>0.555310</td>\n",
       "      <td>0.269329</td>\n",
       "      <td>-0.769490</td>\n",
       "      <td>0.888668</td>\n",
       "      <td>...</td>\n",
       "      <td>0.319892</td>\n",
       "      <td>-0.673623</td>\n",
       "      <td>0.750743</td>\n",
       "      <td>0.930013</td>\n",
       "      <td>0.033606</td>\n",
       "      <td>0.261526</td>\n",
       "      <td>0.425253</td>\n",
       "      <td>0.908287</td>\n",
       "      <td>1.101179</td>\n",
       "      <td>0.378441</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49995</th>\n",
       "      <td>-0.522521</td>\n",
       "      <td>-0.330984</td>\n",
       "      <td>0.136525</td>\n",
       "      <td>-0.450189</td>\n",
       "      <td>-0.076839</td>\n",
       "      <td>1.248817</td>\n",
       "      <td>0.334444</td>\n",
       "      <td>0.873641</td>\n",
       "      <td>0.188449</td>\n",
       "      <td>0.102323</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.237047</td>\n",
       "      <td>-0.376410</td>\n",
       "      <td>1.547221</td>\n",
       "      <td>1.126172</td>\n",
       "      <td>-0.722363</td>\n",
       "      <td>0.549418</td>\n",
       "      <td>0.979395</td>\n",
       "      <td>0.055092</td>\n",
       "      <td>0.610912</td>\n",
       "      <td>-0.126857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49996</th>\n",
       "      <td>-0.470180</td>\n",
       "      <td>-0.401946</td>\n",
       "      <td>0.982030</td>\n",
       "      <td>-0.207640</td>\n",
       "      <td>0.532523</td>\n",
       "      <td>0.231821</td>\n",
       "      <td>0.380483</td>\n",
       "      <td>1.066097</td>\n",
       "      <td>0.130898</td>\n",
       "      <td>0.458105</td>\n",
       "      <td>...</td>\n",
       "      <td>0.178845</td>\n",
       "      <td>-0.644469</td>\n",
       "      <td>1.544612</td>\n",
       "      <td>0.765639</td>\n",
       "      <td>0.171692</td>\n",
       "      <td>0.082497</td>\n",
       "      <td>0.258444</td>\n",
       "      <td>0.898845</td>\n",
       "      <td>-0.184204</td>\n",
       "      <td>-0.039506</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49997</th>\n",
       "      <td>-1.095224</td>\n",
       "      <td>0.074697</td>\n",
       "      <td>0.357558</td>\n",
       "      <td>-0.289866</td>\n",
       "      <td>0.776415</td>\n",
       "      <td>1.029506</td>\n",
       "      <td>1.334372</td>\n",
       "      <td>0.711085</td>\n",
       "      <td>-0.037792</td>\n",
       "      <td>0.165926</td>\n",
       "      <td>...</td>\n",
       "      <td>-0.528522</td>\n",
       "      <td>-0.889131</td>\n",
       "      <td>1.200090</td>\n",
       "      <td>1.039473</td>\n",
       "      <td>0.167707</td>\n",
       "      <td>0.511078</td>\n",
       "      <td>-0.065529</td>\n",
       "      <td>0.447770</td>\n",
       "      <td>0.551285</td>\n",
       "      <td>0.328493</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49998</th>\n",
       "      <td>-0.344982</td>\n",
       "      <td>0.121328</td>\n",
       "      <td>0.305855</td>\n",
       "      <td>-0.381629</td>\n",
       "      <td>-0.181680</td>\n",
       "      <td>0.434278</td>\n",
       "      <td>1.460984</td>\n",
       "      <td>0.992868</td>\n",
       "      <td>0.167097</td>\n",
       "      <td>1.005540</td>\n",
       "      <td>...</td>\n",
       "      <td>0.580155</td>\n",
       "      <td>-0.436302</td>\n",
       "      <td>0.818202</td>\n",
       "      <td>0.528767</td>\n",
       "      <td>0.078137</td>\n",
       "      <td>0.811233</td>\n",
       "      <td>0.269796</td>\n",
       "      <td>0.241384</td>\n",
       "      <td>-0.356777</td>\n",
       "      <td>0.245386</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>49999</th>\n",
       "      <td>-0.758263</td>\n",
       "      <td>0.188403</td>\n",
       "      <td>0.582321</td>\n",
       "      <td>-1.106614</td>\n",
       "      <td>0.063970</td>\n",
       "      <td>0.288577</td>\n",
       "      <td>0.510509</td>\n",
       "      <td>0.543814</td>\n",
       "      <td>-0.262185</td>\n",
       "      <td>0.727537</td>\n",
       "      <td>...</td>\n",
       "      <td>0.017372</td>\n",
       "      <td>-0.628980</td>\n",
       "      <td>1.412982</td>\n",
       "      <td>1.034429</td>\n",
       "      <td>0.289884</td>\n",
       "      <td>-0.282774</td>\n",
       "      <td>0.831488</td>\n",
       "      <td>0.248558</td>\n",
       "      <td>0.771177</td>\n",
       "      <td>-0.124385</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>50000 rows × 768 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "              0         1         2         3         4         5         6  \\\n",
       "0     -0.354270  0.422403 -0.105672 -0.129077  0.289177  0.382220  0.183098   \n",
       "1     -0.005778  0.875256  0.844623 -0.913219 -0.220542  0.457574  0.819090   \n",
       "2      0.115181 -0.087180  0.114065  0.246189  0.714248  0.402952  0.313888   \n",
       "3      0.052282  0.800266  0.831988  0.155950 -0.213863  0.179749  1.394324   \n",
       "4      0.095074  0.099750  0.638213 -1.026867  0.020405  0.488524  0.555310   \n",
       "...         ...       ...       ...       ...       ...       ...       ...   \n",
       "49995 -0.522521 -0.330984  0.136525 -0.450189 -0.076839  1.248817  0.334444   \n",
       "49996 -0.470180 -0.401946  0.982030 -0.207640  0.532523  0.231821  0.380483   \n",
       "49997 -1.095224  0.074697  0.357558 -0.289866  0.776415  1.029506  1.334372   \n",
       "49998 -0.344982  0.121328  0.305855 -0.381629 -0.181680  0.434278  1.460984   \n",
       "49999 -0.758263  0.188403  0.582321 -1.106614  0.063970  0.288577  0.510509   \n",
       "\n",
       "              7         8         9  ...       758       759       760  \\\n",
       "0      0.102091  0.635695  1.120547  ...  0.843546 -0.591661  1.413266   \n",
       "1      0.658583 -0.206531  0.899738  ... -0.000560 -0.572531  0.789380   \n",
       "2      0.908008  0.219879  1.368971  ...  0.806028 -0.331930  1.068578   \n",
       "3      0.505120 -0.341608  0.040288  ...  0.333275 -1.103323  0.387326   \n",
       "4      0.269329 -0.769490  0.888668  ...  0.319892 -0.673623  0.750743   \n",
       "...         ...       ...       ...  ...       ...       ...       ...   \n",
       "49995  0.873641  0.188449  0.102323  ... -0.237047 -0.376410  1.547221   \n",
       "49996  1.066097  0.130898  0.458105  ...  0.178845 -0.644469  1.544612   \n",
       "49997  0.711085 -0.037792  0.165926  ... -0.528522 -0.889131  1.200090   \n",
       "49998  0.992868  0.167097  1.005540  ...  0.580155 -0.436302  0.818202   \n",
       "49999  0.543814 -0.262185  0.727537  ...  0.017372 -0.628980  1.412982   \n",
       "\n",
       "            761       762       763       764       765       766       767  \n",
       "0      0.980099  1.254564 -0.756020  0.614037  0.139899  0.117359  0.159412  \n",
       "1      1.063664 -0.072007  0.111034  0.270689  0.319568  1.085690  0.670377  \n",
       "2      1.111367 -0.686173 -0.046650 -0.116867  0.380806  0.239970  0.928296  \n",
       "3      1.064309  0.196870  0.380791  1.301055  0.288548  0.353034  0.239037  \n",
       "4      0.930013  0.033606  0.261526  0.425253  0.908287  1.101179  0.378441  \n",
       "...         ...       ...       ...       ...       ...       ...       ...  \n",
       "49995  1.126172 -0.722363  0.549418  0.979395  0.055092  0.610912 -0.126857  \n",
       "49996  0.765639  0.171692  0.082497  0.258444  0.898845 -0.184204 -0.039506  \n",
       "49997  1.039473  0.167707  0.511078 -0.065529  0.447770  0.551285  0.328493  \n",
       "49998  0.528767  0.078137  0.811233  0.269796  0.241384 -0.356777  0.245386  \n",
       "49999  1.034429  0.289884 -0.282774  0.831488  0.248558  0.771177 -0.124385  \n",
       "\n",
       "[50000 rows x 768 columns]"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "emb"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.4"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}