Spaces:
Runtime error
Runtime error
Michael-Geis
commited on
Commit
•
77ce2b6
1
Parent(s):
3d2ca49
reorganized file structure
Browse files- prediction-flow-sample.ipynb +113 -0
- src/model.py +4 -4
prediction-flow-sample.ipynb
CHANGED
@@ -503,6 +503,119 @@
|
|
503 |
"\n",
|
504 |
"pipe.transform(X=id_list)"
|
505 |
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
506 |
}
|
507 |
],
|
508 |
"metadata": {
|
|
|
503 |
"\n",
|
504 |
"pipe.transform(X=id_list)"
|
505 |
]
|
506 |
+
},
|
507 |
+
{
|
508 |
+
"cell_type": "code",
|
509 |
+
"execution_count": 10,
|
510 |
+
"metadata": {},
|
511 |
+
"outputs": [],
|
512 |
+
"source": [
|
513 |
+
"import src.model\n",
|
514 |
+
"import importlib\n",
|
515 |
+
"\n",
|
516 |
+
"importlib.reload(src.model)\n",
|
517 |
+
"from src.model import main"
|
518 |
+
]
|
519 |
+
},
|
520 |
+
{
|
521 |
+
"cell_type": "code",
|
522 |
+
"execution_count": 11,
|
523 |
+
"metadata": {},
|
524 |
+
"outputs": [
|
525 |
+
{
|
526 |
+
"data": {
|
527 |
+
"text/html": [
|
528 |
+
"<div>\n",
|
529 |
+
"<style scoped>\n",
|
530 |
+
" .dataframe tbody tr th:only-of-type {\n",
|
531 |
+
" vertical-align: middle;\n",
|
532 |
+
" }\n",
|
533 |
+
"\n",
|
534 |
+
" .dataframe tbody tr th {\n",
|
535 |
+
" vertical-align: top;\n",
|
536 |
+
" }\n",
|
537 |
+
"\n",
|
538 |
+
" .dataframe thead th {\n",
|
539 |
+
" text-align: right;\n",
|
540 |
+
" }\n",
|
541 |
+
"</style>\n",
|
542 |
+
"<table border=\"1\" class=\"dataframe\">\n",
|
543 |
+
" <thead>\n",
|
544 |
+
" <tr style=\"text-align: right;\">\n",
|
545 |
+
" <th></th>\n",
|
546 |
+
" <th>title</th>\n",
|
547 |
+
" <th>abstract</th>\n",
|
548 |
+
" <th>id</th>\n",
|
549 |
+
" <th>arxiv_subjects</th>\n",
|
550 |
+
" <th>msc_tags</th>\n",
|
551 |
+
" </tr>\n",
|
552 |
+
" </thead>\n",
|
553 |
+
" <tbody>\n",
|
554 |
+
" <tr>\n",
|
555 |
+
" <th>9786</th>\n",
|
556 |
+
" <td>A logarithmic improvement in the two-point Wey...</td>\n",
|
557 |
+
" <td>In this paper, we study the two-point Weyl Law...</td>\n",
|
558 |
+
" <td>1905.05136v3</td>\n",
|
559 |
+
" <td>[math.AP, math.SP]</td>\n",
|
560 |
+
" <td>[35P20]</td>\n",
|
561 |
+
" </tr>\n",
|
562 |
+
" <tr>\n",
|
563 |
+
" <th>39127</th>\n",
|
564 |
+
" <td>Scaling Limit for the Kernel of the Spectral P...</td>\n",
|
565 |
+
" <td>Let (M, g) be a compact smooth Riemannian mani...</td>\n",
|
566 |
+
" <td>1411.0658v3</td>\n",
|
567 |
+
" <td>[math.SP, math.AP, math.DG]</td>\n",
|
568 |
+
" <td>None</td>\n",
|
569 |
+
" </tr>\n",
|
570 |
+
" <tr>\n",
|
571 |
+
" <th>46524</th>\n",
|
572 |
+
" <td>On $L^p$-resolvent estimates and the density o...</td>\n",
|
573 |
+
" <td>We address an interesting question raised by D...</td>\n",
|
574 |
+
" <td>1204.3927v3</td>\n",
|
575 |
+
" <td>[math.AP, math.CA]</td>\n",
|
576 |
+
" <td>[58J50]</td>\n",
|
577 |
+
" </tr>\n",
|
578 |
+
" <tr>\n",
|
579 |
+
" <th>38787</th>\n",
|
580 |
+
" <td>C-infinity Scaling Asymptotics for the Spectra...</td>\n",
|
581 |
+
" <td>This article concerns new off-diagonal estimat...</td>\n",
|
582 |
+
" <td>1602.00730v1</td>\n",
|
583 |
+
" <td>[math.AP, math-ph, math.DG, math.FA, math.MP, ...</td>\n",
|
584 |
+
" <td>None</td>\n",
|
585 |
+
" </tr>\n",
|
586 |
+
" <tr>\n",
|
587 |
+
" <th>38299</th>\n",
|
588 |
+
" <td>A lower bound for the $Θ$ function on manifold...</td>\n",
|
589 |
+
" <td>In this short note, we prove that the usual $\\...</td>\n",
|
590 |
+
" <td>1603.05697v1</td>\n",
|
591 |
+
" <td>[math.DG, math.SP]</td>\n",
|
592 |
+
" <td>None</td>\n",
|
593 |
+
" </tr>\n",
|
594 |
+
" </tbody>\n",
|
595 |
+
"</table>\n",
|
596 |
+
"</div>"
|
597 |
+
],
|
598 |
+
"text/plain": [
|
599 |
+
" title ... msc_tags\n",
|
600 |
+
"9786 A logarithmic improvement in the two-point Wey... ... [35P20]\n",
|
601 |
+
"39127 Scaling Limit for the Kernel of the Spectral P... ... None\n",
|
602 |
+
"46524 On $L^p$-resolvent estimates and the density o... ... [58J50]\n",
|
603 |
+
"38787 C-infinity Scaling Asymptotics for the Spectra... ... None\n",
|
604 |
+
"38299 A lower bound for the $Θ$ function on manifold... ... None\n",
|
605 |
+
"\n",
|
606 |
+
"[5 rows x 5 columns]"
|
607 |
+
]
|
608 |
+
},
|
609 |
+
"execution_count": 11,
|
610 |
+
"metadata": {},
|
611 |
+
"output_type": "execute_result"
|
612 |
+
}
|
613 |
+
],
|
614 |
+
"source": [
|
615 |
+
"recs = main(id_list=[\"1905.05136v3\"])\n",
|
616 |
+
"\n",
|
617 |
+
"recs.head()"
|
618 |
+
]
|
619 |
}
|
620 |
],
|
621 |
"metadata": {
|
src/model.py
CHANGED
@@ -6,10 +6,8 @@ from src.embedding import Embedder
|
|
6 |
from src.search import Search
|
7 |
|
8 |
|
9 |
-
def main():
|
10 |
-
|
11 |
-
path_to_library = ""
|
12 |
-
save_recs = False
|
13 |
path_to_save_recs = ""
|
14 |
|
15 |
## Create pipeline
|
@@ -28,6 +26,8 @@ def main():
|
|
28 |
if save_recs:
|
29 |
recommendation_df.to_feather(path_to_save_recs)
|
30 |
|
|
|
|
|
31 |
|
32 |
if __name__ == "main":
|
33 |
main()
|
|
|
6 |
from src.search import Search
|
7 |
|
8 |
|
9 |
+
def main(id_list, save_recs=False):
|
10 |
+
path_to_library = "./data/libraries/APSP_50_allenai-specter"
|
|
|
|
|
11 |
path_to_save_recs = ""
|
12 |
|
13 |
## Create pipeline
|
|
|
26 |
if save_recs:
|
27 |
recommendation_df.to_feather(path_to_save_recs)
|
28 |
|
29 |
+
return recommendation_df
|
30 |
+
|
31 |
|
32 |
if __name__ == "main":
|
33 |
main()
|