Spaces:
Runtime error
Runtime error
fix acl author
Browse files- run.py +3 -7
- src/interfaces/aclanthology.py +10 -6
run.py
CHANGED
|
@@ -2,8 +2,8 @@ from src.interfaces.aclanthology import AclanthologyPaperList
|
|
| 2 |
from src.interfaces.arxiv import ArxivPaperList
|
| 3 |
from src.interfaces.dblp import DblpPaperList
|
| 4 |
from src.utils import (
|
| 5 |
-
dump_paper_list_to_markdown_checklist,
|
| 6 |
dump_paper_list_to_jsonlines,
|
|
|
|
| 7 |
)
|
| 8 |
|
| 9 |
if __name__ == "__main__":
|
|
@@ -85,9 +85,7 @@ if __name__ == "__main__":
|
|
| 85 |
dump_paper_list_to_markdown_checklist(
|
| 86 |
arxiv_ee_papers, "results/arxiv-ee-paper-list.md"
|
| 87 |
)
|
| 88 |
-
dump_paper_list_to_jsonlines(
|
| 89 |
-
arxiv_ee_papers, "results/arxiv-ee-paper-list.jsonl"
|
| 90 |
-
)
|
| 91 |
|
| 92 |
# dblp papers
|
| 93 |
dblp_paper_list = DblpPaperList(
|
|
@@ -124,6 +122,4 @@ if __name__ == "__main__":
|
|
| 124 |
dump_paper_list_to_markdown_checklist(
|
| 125 |
dblp_ee_papers, "results/dblp-ee-paper-list.md"
|
| 126 |
)
|
| 127 |
-
dump_paper_list_to_jsonlines(
|
| 128 |
-
dblp_ee_papers, "results/dblp-ee-paper-list.jsonl"
|
| 129 |
-
)
|
|
|
|
| 2 |
from src.interfaces.arxiv import ArxivPaperList
|
| 3 |
from src.interfaces.dblp import DblpPaperList
|
| 4 |
from src.utils import (
|
|
|
|
| 5 |
dump_paper_list_to_jsonlines,
|
| 6 |
+
dump_paper_list_to_markdown_checklist,
|
| 7 |
)
|
| 8 |
|
| 9 |
if __name__ == "__main__":
|
|
|
|
| 85 |
dump_paper_list_to_markdown_checklist(
|
| 86 |
arxiv_ee_papers, "results/arxiv-ee-paper-list.md"
|
| 87 |
)
|
| 88 |
+
dump_paper_list_to_jsonlines(arxiv_ee_papers, "results/arxiv-ee-paper-list.jsonl")
|
|
|
|
|
|
|
| 89 |
|
| 90 |
# dblp papers
|
| 91 |
dblp_paper_list = DblpPaperList(
|
|
|
|
| 122 |
dump_paper_list_to_markdown_checklist(
|
| 123 |
dblp_ee_papers, "results/dblp-ee-paper-list.md"
|
| 124 |
)
|
| 125 |
+
dump_paper_list_to_jsonlines(dblp_ee_papers, "results/dblp-ee-paper-list.jsonl")
|
|
|
|
|
|
src/interfaces/aclanthology.py
CHANGED
|
@@ -15,7 +15,7 @@ class AclanthologyPaperList(SearchAPI):
|
|
| 15 |
self.papers = []
|
| 16 |
for d in data:
|
| 17 |
authors = " , ".join(
|
| 18 |
-
[self.extract_author_full(author) for author in d.get("
|
| 19 |
)
|
| 20 |
venue = d.get("venue", [])
|
| 21 |
if venue:
|
|
@@ -36,9 +36,13 @@ class AclanthologyPaperList(SearchAPI):
|
|
| 36 |
continue
|
| 37 |
self.papers.append(paper)
|
| 38 |
|
| 39 |
-
def extract_author_full(self, name:
|
| 40 |
-
|
| 41 |
-
if
|
| 42 |
-
|
|
|
|
|
|
|
| 43 |
else:
|
| 44 |
-
|
|
|
|
|
|
|
|
|
| 15 |
self.papers = []
|
| 16 |
for d in data:
|
| 17 |
authors = " , ".join(
|
| 18 |
+
[self.extract_author_full(author) for author in d.get("author", [])]
|
| 19 |
)
|
| 20 |
venue = d.get("venue", [])
|
| 21 |
if venue:
|
|
|
|
| 36 |
continue
|
| 37 |
self.papers.append(paper)
|
| 38 |
|
| 39 |
+
def extract_author_full(self, name: dict) -> str:
|
| 40 |
+
full_name = ""
|
| 41 |
+
if hasattr(name, "full"):
|
| 42 |
+
match = re.search(r".*?\((.*?)\)", name)
|
| 43 |
+
if match:
|
| 44 |
+
full_name = match.group(1)
|
| 45 |
else:
|
| 46 |
+
full_name = f"{name['first']} {name['last']}"
|
| 47 |
+
|
| 48 |
+
return full_name
|