-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPaperLauncher.py
More file actions
49 lines (43 loc) · 1.47 KB
/
PaperLauncher.py
File metadata and controls
49 lines (43 loc) · 1.47 KB
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
# ##############################################################
# 论文引用相关功能的创建
# ##############################################################
import os
from PySide6.QtCore import QObject, Signal
import Kernel.DrawChart as DC
import Kernel.PageRank as PR
import KnowledgeGraph.build_knowledge_graph as KG
import Thesis.Matrix as PMat
import neochecker
class PaperLauncher(QObject):
progress = Signal(int)
complete = Signal(int)
def __init__(self):
super().__init__()
def work(self):
self.progress.emit(1)
if not neochecker.isNeoRun:
os.system('neolauncher.bat')
neochecker.isNeoRun = True
self.progress.emit(2)
kg = KG.KnowledgeGraph()
kg.build_paper_knowledge_graph()
self.progress.emit(3)
pr = PR.PageRank()
mat = PMat.build_paper_matrix()
rpv = pr.run_Implemented_PageRank_algorithm(mat)
print(rpv)
val = []
dirname = os.listdir('./Thesis/resources')
data = []
for filename in dirname:
data.append(filename[:len(filename) - 4])
finaldata = []
for i in range(len(rpv)):
finaldata.append(data[rpv[i][1]-1])
print(finaldata)
for i in range(len(rpv)):
val.append(rpv[i][2])
self.progress.emit(4)
dc = DC.DrawChart()
dc.drawScatter(list(range(1, len(rpv) + 1)), val, 5, finaldata)
self.complete.emit(5)