首页 > 解决方案 > 是否可以获得一篇文章被引用的次数?

问题描述

我正在使用 Entrez 搜索 Pubmed 上的文章。是否可以使用 Entrez 来确定使用我的搜索参数找到的每篇文章的引用次数?如果没有,我可以使用其他方法吗?到目前为止,我的谷歌搜索并没有出现太多。

注意:引用次数(在我的上下文中)相关特定文章在其他文章中被引用的次数。

我发现的一件事:https ://gist.github.com/mcfrank/c1ec74df1427278cbe53 这可能表明我可以获得同样在 Pubmed DB 中的文章的引用编号,但我不清楚(对我来说)我是如何可以使用它来确定每篇文章的引用次数。

以下是我目前正在使用的代码(我想包括引用次数的“打印”行):

#search pubmed

from Bio import Entrez
from Bio import Medline

search_string = r'("Blah Blah")'

Entrez.email = "hello_world@example.com" 
handle = Entrez.egquery(term=search_string)
record = Entrez.read(handle)
count = 0
for row in record["eGQueryResult"]:
        if row["DbName"]=="pubmed":
            print("Number of articles found with requested search parameters:", row["Count"])
            count = row["Count"]


handle = Entrez.esearch(db="pubmed", term=search_string, retmax=count)
record = Entrez.read(handle)
handle.close()
idlist = record["IdList"]

handle = Entrez.efetch(db="pubmed", id=idlist, rettype="medline", retmode="text")
records = Medline.parse(handle)

records = list(records)
x=1
for record in records:
    print("(" + str(x) + ")")
    print("Title:", record.get("TI", "?"))
    print("Authors: ", ", ".join(record.get("AU", "?")))
    print("Pub Date:", record.get("DP", "?"))
    print("Journal:", record.get("JT", "?"))
    print("DOI:", record.get("LID", "?")[:-6])
    #print("number of citations:", get.number_of_citations) #<--what I am requesting help about
    print("\n")
    x += 1

标签: python-3.xweb-crawlercitationspubmedrentrez

解决方案


不幸的是,您只能获取 pubmed Central 中的文章列表,其中引用了相关文章。

idlist = ['2344532', '2445435'] # this is your PMID list    

citations = []

for pmid in idlist:


q = Entrez.read(Entrez.elink(dbfrom="pubmed", db="pmc", LinkName="pubmed_pubmed_citedin", from_uid=pmid))

for i in range(0, len(q)):
    if len(q[i]["LinkSetDb"]) > 0:
        pmids_list = [link["Id"] for link in q[i]["LinkSetDb"][0]["Link"]]
        pmids = ";".join(pmids_list)
        citations.append([q[i]["IdList"][0], pmids])
    else:
        citations.append([q[i]["IdList"][0]])

推荐阅读