MCPcopy Create free account
hub / github.com/ResearAI/DeepReviewer-v2 / PaperNode

Class PaperNode

pasa/pasa/paper_node.py:16–43  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14from __future__ import annotations
15
16class PaperNode:
17 def __init__(self, attrs):
18 self.title = attrs.get("title", "")
19 self.arxiv_id = attrs.get("arxiv_id", "")
20 self.depth = attrs.get("depth", -1)
21 self.child = {k: [PaperNode(i) for i in v] for k, v in attrs.get("child", {}).items()}
22 self.abstract = attrs.get("abstract", "")
23 self.sections = attrs.get("sections", "") # section name -> list of citation papers
24 self.source = attrs.get("source", "Root") # Root, Search, Expand
25 self.select_score = attrs.get("select_score", 0.0) # the result of the selecte model
26 self.extra = attrs.get("extra", {})
27
28 def todic(self):
29 return {
30 "title": self.title,
31 "arxiv_id": self.arxiv_id,
32 "depth": self.depth,
33 "child": {k: [i.todic() for i in v] for k, v in self.child.items()},
34 "abstract": self.abstract,
35 "sections": self.sections,
36 "source": self.source,
37 "select_score": self.select_score,
38 "extra": self.extra,
39 }
40
41 @staticmethod
42 def sort_paper(item):
43 return item.select_score

Callers 4

__init__Method · 0.85
__init__Method · 0.85
search_paperMethod · 0.85
do_expandMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected