Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update
Browse files
papers.py
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
import dataclasses
|
2 |
import datetime
|
3 |
import operator
|
4 |
|
@@ -21,17 +20,6 @@ ABSTRACT_RETRIEVER = RAGPretrainedModel.from_index(INDEX_DIR_PATH)
|
|
21 |
ABSTRACT_RETRIEVER.search("LLM")
|
22 |
|
23 |
|
24 |
-
@dataclasses.dataclass(frozen=True)
|
25 |
-
class PaperInfo:
|
26 |
-
date: str
|
27 |
-
arxiv_id: str
|
28 |
-
github: str
|
29 |
-
title: str
|
30 |
-
paper_page: str
|
31 |
-
upvotes: int
|
32 |
-
num_comments: int
|
33 |
-
|
34 |
-
|
35 |
def get_df() -> pd.DataFrame:
|
36 |
df = pd.merge(
|
37 |
left=datasets.load_dataset("hysts-bot-data/daily-papers", split="train").to_pandas(),
|
@@ -43,12 +31,11 @@ def get_df() -> pd.DataFrame:
|
|
43 |
|
44 |
paper_info = []
|
45 |
for _, row in tqdm.auto.tqdm(df.iterrows(), total=len(df)):
|
46 |
-
info =
|
47 |
-
|
48 |
-
|
49 |
-
)
|
50 |
paper_info.append(info)
|
51 |
-
return pd.DataFrame(
|
52 |
|
53 |
|
54 |
class Prettifier:
|
|
|
|
|
1 |
import datetime
|
2 |
import operator
|
3 |
|
|
|
20 |
ABSTRACT_RETRIEVER.search("LLM")
|
21 |
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
def get_df() -> pd.DataFrame:
|
24 |
df = pd.merge(
|
25 |
left=datasets.load_dataset("hysts-bot-data/daily-papers", split="train").to_pandas(),
|
|
|
31 |
|
32 |
paper_info = []
|
33 |
for _, row in tqdm.auto.tqdm(df.iterrows(), total=len(df)):
|
34 |
+
info = row.copy()
|
35 |
+
del info["abstract"]
|
36 |
+
info["paper_page"] = f"https://huggingface.co/papers/{row.arxiv_id}"
|
|
|
37 |
paper_info.append(info)
|
38 |
+
return pd.DataFrame(paper_info)
|
39 |
|
40 |
|
41 |
class Prettifier:
|