clouds.py 文件源码

python
阅读 22 收藏 0 点赞 0 评论 0

项目:KDDCUP2016 作者: hugochan 项目源码 文件源码
def get_citation_positions(db, paper_id) :
    query = """SELECT r.paper_id, 
                                        cg.start, cg.end 
                                        FROM refs r 
                                        JOIN citations c ON r.id=c.ref_id 
                                        JOIN citation_groups cg ON c.group_id=cg.id 
                                        WHERE cited_paper_id='%s' """ % paper_id
    cursor = db.query(query)
    rows = cursor.fetchall()

    # Group citations by paper
    citations = defaultdict(list)
    for citing_paper, start, end in rows :
        citations[citing_paper].append((start, end))

    return citations
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号