예제 #1
0
파일: paper_2.py 프로젝트: xiaojimao18/BGLL
def start():
    connectDB()

    calc.init_similarity()

    createSourceFile()
    callBGLL()
    getAllResult()

    clearHierarchyRelation()

    # group: the id of each tree
    for (group, pid_set) in result_paper_cate[total_level].items():
        print "======================level:%s====================" % group
        is_selected = set()
        updateHierarchyRelation(group, pid_set, total_level, -1, is_selected)

    closeDB()
예제 #2
0
파일: paper_2.py 프로젝트: xiaojimao18/BGLL
def start():
	connectDB()

	calc.init_similarity()

	createSourceFile()
	callBGLL()
	getAllResult()
	
	clearHierarchyRelation()

	# group: the id of each tree
	for (group, pid_set) in result_paper_cate[total_level].items():
		print "======================level:%s====================" % group
		is_selected = set()
		updateHierarchyRelation(group, pid_set, total_level, -1, is_selected)

	closeDB()
예제 #3
0
파일: papers.py 프로젝트: xiaojimao18/BGLL
    def __init__(self):
        self.BGLL     = BGLL(self.output_path, self.is_weighted)
        self.database = Database(self.db_host, self.db_user, self.db_pass, self.db_name)

        calc.init_similarity()
예제 #4
0
import MySQLdb
import os
import CalcFather as calc

# database config
db_host = "localhost"
db_user = "******"
db_pass = "******"
db_name = "papernet"

# global database connection and cursor
conn = MySQLdb.connect(db_host, db_user, db_pass, db_name)
cursor = conn.cursor()

calc.init_similarity()

# read the database paper_paper_relation and write into paper.txt
map1 = dict()	# from old to new
map2 = dict()	# from new to old

file_path = '/home/cowx/workspace/BGLL/paper/paper.txt'
f = open(file_path, 'w+')

sql = "select pid1, pid2 from paper_paper_relation order by pid1, pid2"
cursor.execute(sql)
result = cursor.fetchall()

pid_set = set() # the set of all nodes
for row in result:
	pid_set.add(row[0])
	pid_set.add(row[1])
예제 #5
0
import MySQLdb
import os
import CalcFather as calc

# database config
db_host = "localhost"
db_user = "******"
db_pass = "******"
db_name = "papernet"

# global database connection and cursor
conn = MySQLdb.connect(db_host, db_user, db_pass, db_name)
cursor = conn.cursor()

calc.init_similarity()

# read the database paper_paper_relation and write into paper.txt
map1 = dict()	# from old to new
map2 = dict()	# from new to old

file_path = '/home/cowx/workspace/BGLL/paper/paper.txt'
f = open(file_path, 'w+')

sql = "select pid1, pid2 from paper_paper_relation order by pid1, pid2"
cursor.execute(sql)
result = cursor.fetchall()

pid_set = set() # the set of all nodes
for row in result:
	pid_set.add(row[0])
	pid_set.add(row[1])