def main(): import sys print(sys.path) comatrix = ReadingFile.reading("transition.txt") Rvector = GPR(comatrix) with open("GPR-10.txt","w") as f: count = 1 for item in Rvector: temp = str(count) + " " + str(item) f.write("%s\n" % temp) count=count+1
def main(): comatrix = ReadingFile.reading("transition.txt") n = comatrix.shape[0] TpageRank = pagerank(comatrix, n) TSPR = query_topic(TpageRank, n) UTSPR = query_topic2(TpageRank, n) with open("QTSPR-U2Q2-10.txt", "w") as f: count = 1 for item in TSPR["22"]: temp = str(count) + " " + str(item) f.write("%s\n" % temp) count = count + 1 with open("PTSPR-U2Q2-10.txt", "w") as f: count = 1 for item in UTSPR["22"]: temp = str(count) + " " + str(item) f.write("%s\n" % temp) count = count + 1