我正在做一个需要与Genia语料库一起工作的项目。根据文献,Genia语料库是通过搜索Medline/Pubmed上的“转录因子”、“血细胞”和“人”这三个术语提取的。我想从Pubmed的Genia语料库中提取全文文章(这是免费的)。我尝试了许多方法,但我无法找到下载全文的方法,或XML或Pdf格式。
使用NCBI提供的Entrez utils:
如何使用NCBI提供的Entrez实用程序以文本、XML或Pdf格式下载文章全文?或者我已经可以使用的脚本或网页爬虫了吗?
发布于 2016-06-14 10:07:11
您可以使用biopython获取PubMedCentral上的文章,然后从文章中获取PDF。对于所有托管在其他地方的文章,很难获得一个通用的解决方案来获得PDF。
PubMedCentral似乎不希望你大量下载文章。通过urllib的请求被阻止,但是相同的URL在浏览器中工作。
from Bio import Entrez
Entrez.email = "Your.Name.Here@example.org"
#id is a string list with pubmed IDs
#two of have a public PMC article, one does not
handle = Entrez.efetch("pubmed", id="19304878,19088134", retmode="xml")
records = Entrez.parse(handle)
#checks for all records if they have a PMC identifier
#prints the URL for downloading the PDF
for record in records:
if record.get('MedlineCitation'):
if record['MedlineCitation'].get('OtherID'):
for other_id in record['MedlineCitation']['OtherID']:
if other_id.title().startswith('Pmc'):
print('http://www.ncbi.nlm.nih.gov/pmc/articles/%s/pdf/' % (other_id.title().upper()))发布于 2018-04-12 10:04:30
我也在用红宝石解决同样的问题。到目前为止,通过使用红宝石,我取得了一定的成功:
这绝不是直截了当的,但仍然没有那么糟糕。有一个创业板声称做同样的(https://github.com/billgreenwald/Pubmed-Batch-Download)。我计划很快检验一下。
发布于 2022-11-23 08:54:52
如果您希望通过XML ID或PMC访问JSON或PubMed,那么您希望使用"BioC API“来访问PubMed Central (PMC)的开放访问文章。
(见https://www.ncbi.nlm.nih.gov/research/bionlp/APIs/BioC-PMC/ )
这里是一个代码-示例
https://www.ncbi.nlm.nih.gov/research/bionlp/RESTful/pmcoa.cgi/BioC_xml/19088134/asciihttps://stackoverflow.com/questions/37804479
复制相似问题